- Node.js
- Express.js
- bcrypt for encrypting passwords
- JWTs for token-based authentication
- MongoDB & Mongoose
-
models
directory containing all the DB models implemented -
server.js
containing all endpoints' logic and functionality
- create a
.env
file with JWT_SECRET - run
npm install
to 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
,y
orvar1
naming - used
const
instead oflet
almost 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