https://github.com/every-io/engineering-interivew-be
To setup this project you have a multiple of options
Install Docker in your computer
https://docs.docker.com/get-docker/
Use this command
docker-compose up
To run this project you need to have nodejs18 installed and mongodb running in your local computer
npm i
npm run build
MONGODB_HOST=YOUR_MONGODB_HOST npm start
Run tests
npm test
Run project as devcontainer, this option requires Docker and VSCode to be installed in your computer
https://code.visualstudio.com/download
https://docs.docker.com/get-docker/
In vscode open your command palette and run Dev Containers: Reopen in Container
and wait for it to finish
npm i
Go to VScode RUN (shift+cmd+d) and run it
reference: https://code.visualstudio.com/docs/devcontainers/containers
You can find the graphql scheme here
For time contrains only unittest for the busines logic have been inplemented you can find them here
For simplicity in this challenge authentication and jwt token validation was omited When the docker-compose runs 3 users are created with the following email and role
- carlos@every.io - MEMBER
- jose@every@io - MEMBER
- admin@every.io - MEMBER
These users are created when the mongodb container runs for the first time see: mongo-init.js
To make a request authenticated with a user you just dend a http header Authorization: user@every.io
you can use any of the above or create you own straight in mongodb.
There is graphql resolver to manage users.
- add integration tests
- add cors headers
- add graphql mapper to return dates as rfc3999
- add jwt token validation
- add user resolver