- Develop a Web application in React and a Rest API in NodeJS connected to MongoDB
- Upload the source code to a public repository (GitLab,GitHub,BitBucket...)
- Create a README file containing instructions for preparing the environment and executing the application
- Use of good practices, design patterns and UI/UX
- Repository versioning flow
- Fork and clone the repository
- Create a file on
api
called:.env
with the following structure (don't replace any value, I created a user tester on mongoDB Atlas so you can test the web without creating a local DB):
PORT=3001
USER_MONGODB=usertester
PASS_MONGODB=tester123
NAME_MONGODB=Sensor
- Go to https://console.cloud.google.com, log in with your Gmail account, click on the left corner on
new project
and create one with any name. - Once the project is created and you are on it click on
+ ENABLE APIS AND SERVICES
. - Look for
Maps JavaScript API
and click on it, then click onENABLE
. - Click on
credentials
on the left panel. - Click on
Create credentials
and then onAPI key
. - Copy yout API KEY and click on
save
. - Create a file on
client
called:.env
with the following structure and replace the APIKEY value:
REACT_APP_MAPS_APIKEY='AIzaSyDmdQvWfvchoEkxaOdCZSFUavKR7Q-bBuY'
Can use this APIKEY if you couldn´t do the google steps.
- Run
npm install
on client and api to install the dependencies and thennpm start
on both sides
- Expose a "Sensor" resource with their respective endpoints
- Endpoint to add, remove, modify and list the sensors
- Expose a "SensorEvent" resource with their respective endpoints
- Endpoint to add events associated with a sensor
- Endpoint to list all events associated with a sensor
- Persist in the MongoDB
Sensors component
- List + CRUD
- Link to sensor events Sensors events component
- Section 1: Sensor Name
- Section 2: Form for creating sensor events
- Section 3: Sensor events list (auto refresh) Models properties
- Sensor: id, name, location(lat/long), active, minval,maxval
- Sensor Event: id, sensorid, createat, value
- Implements of good practices, design patterns and UX
- Implements ExpressJS
- Implements socket.io to show changes in real time
- Implements API middleware to authorize requests using JWT
- Implements Unit Test