- Node.js
- Express.js
- bcrypt for encrypting passwords
- JWTs for token-based authentication
- MongoDB & Mongoose
-
modelsdirectory containing all the DB models implemented -
server.jscontaining all endpoints' logic and functionality
- create a
.envfile with JWT_SECRET - run
npm installto include all dependencies - have mongoDB server running
- run your server with
npm run start
| Endpoint | Functionality |
|---|---|
| POST/signup | Registers new user |
| POST/login | Log in existing user |
| GET/isUserAuth | Checks if user is authenticated |
| GET/todos | List all todos |
| GET/todos/:id | get specific todo |
| POST/todos/create | Create new todo |
| POST/todos/edit/:id | Updates existing todo |
- Single Responsbility Princible: writing functions with descriptive names that have one sole purpose
- all variables and constants have descriptive names, no
x,yorvar1naming - used
constinstead ofletalmost always, I believe that if I find myself needing to use a variable I ask myself "is there a better way to do this?"
- add middleware authentication checker to each private route
- add DB seed
- add test cases