This app uses an express api to create,read,update and delete habit trackers by interacting with an HTML front end.
- html, css, vanilla/javascript
- bootstrap
- node.js
- jest
- express.js
- mongodb / mongoose / atlas
- docker
- github
- slack
- trello
- excalidraw
- zoom
how to run*
- it is recommended you have docker desktop installed on your machine.
-
clone the Repo
-
navigate into the project directory your terminal.
-
run command:
- for windows :
bash _script/startDev.sh
- for linux :
sudo bash _script/startDev.sh
- for windows :
-
navigate to http://localhost:3000 to view the api responses within your browser
- terminate the docker containers by replacing startDev.sh with teardown.sh in step 3
- http://localhost:3000/users
searches database and returns ALL users if authenticated and authorized as ADMIN e.g. user.isAdmin = true;
- http://localhost:3000/users/1
searches database for user with the id of 1
- http://localhost:3000/habits
creates a new habit tracker and stores it inside the user model which is found by the accesstoken header
{
"id": "654dw6e5d6s54d6f5s4",
"username":"fakeUsername",
"email":"[email protected]",
"password":"fakepassword" * passwords are hashed+salted on registration"
"habits":["array","of","habits"]
}
schema yet to be updated here soon...