This is a compilation of exercises for the Fundamentals in Backend Development
course.
Look out for the TODO comments to find where to include your additions to complete the exercise
- nodejs 16
- docker & docker-compose
- heroku-cli
Create a CRUD application. Fill in the missing sections in src/controllers/user.js
to get the APIs working
Add JWT cookie based user authentication. Fill in the implementation in src/services/authentication.js
.
Two endpoints have been added for you to test your implementation.
POST /users/login
- Takes in anemail
andpassword
as JSON in the request body and adds the JWT in your cookiesGET /users/whoami
- Returns the current login user based on the JWT in the cookie'
Added the multer
library
A simple program to write your unit tests against.
Fill in the unit test in the following files:
src/middlewares/authentication.test.js
src/services/authentication.test.js
src/services/authentication.test.js
Run npm test
to execute the tests
Fill in the implementation in api-tests/users.test.js
Run npm test
to execute the tests
Refactored the application to use postgres instead of the naive file system storage.
The postgres repository has already been implemented.
Run npm run db:migrate
to create the tables required for the application.
Use DATABASE_URL
in the env to specfy the connection to a postgres instance.
Added CI and a way to deploy to heroku. Requires a new github repo and a heroku account
Added an email repository to send emails using SMTP.