My project for a technical test was to develop two micro services: authentification and a basic CRUD
- Clone the project
- Install the dependencies
- run npm install in the root, authentification and crud directories
- Create an .
env
at the root and fill it (use.env.example
as an example) - Start the app
- Run at the root
npm run dev
This is a project I developed to respond to a technical test during a recruiting process to develop two micro service, one is about authentification and the second one is a basic CRUD
This is a 3 endpoints API
- /user
- To post a new user
- To get all users
- /Login (1st authentification step)
- To log the app: The app will send a 4 digits code to the user email
- /validation (2nd authentification step)
- To post the 4 digits code and receive the token
This is a 1 endpoint API /product
- To post a new product
- To get one specific product
- To get all products
- To update one specific product
- To remove one specific product
- In development environment, the microservice will use Environment variables defined in the file
.env
- In production environment, the microservice will use Environment variables defined in the production environment (AWS, Heroku…)
- Create and fill a file
.env
(at the root). One example is available.env.example
at the root - Execute
npm run dev
- Define the Environment variable in production
NODE_ENV = production
- Define in production environment all Environment variables used by the app (list of is available
.env.example
at the root)
- Tests are inside the authentification/tests
- To run the tests, inside the directory authentification,
- Execute
npm run dev
- Execute
npm test