You may check my portfolio in Github as well as my webpage at Hamro Dev.
This exercise has been developed using Nest. It fulfills the endpoint described in /docs/swagger.yaml. Needless to say, in order for this to work, make sure that you have Nodejs installed.
$ npm install
Before you run the app. Make sure that you prepare your .env file. You can find a preset .env file with all the necessary strings in .env.dist file . Rename it to .env and change the mongo DB connection string accordingly. Make sure that your mongoDB has a Users collection created as well as a UserLists collection created before initializing.
This endpoint uses MONGODB to run so remember to have a mongoDB server running for the app to work. You can use docker compose and run the following commands.
# modern versions of docker
$ docker compose up db
# older versions of docker
$ docker-compose up db
This will create a mongoDB container that the app can connect to. If you cannot run your own mongoDB database, try Cloud Atlas from Mongodb here and use your own connection string to store data. Make sure you set the right connection string into the .env file.
Once you have your mongo db system ready, you can run the following commands:
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
You can run the following tests. Tests are found inside of the modules//test folder. e2e tests can be found in the /test folder.
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
Note You can launch the whole environment in production using docker compose up.