Before coding directly, i let myself a big time to read the assessment and organizing tasks. So i put a little plan so that for the three first days it’s about coding and the last two parts its mostly deployment of the api online, more tests, and refactoring/cleaning code.

The tasks that I will have to do during my project:

Initialization of the project

mkdir api; cd api
npm init
npm install -g typescript
npm install ts-node express @types/node @types/express --save-dev
tsc --init
touch server.ts
/* 
	adding in package.json :
    "build": "npx tsc",
    "start": "node dist/index.js"
*/

Since i am a bit familiar with express, i prefered to install express because it provides a set of features for web including routing, middleware and more. I want to keep it simple.

I added folder for the controller and route so the code stay clean and correctly organized.

On this day i simply test if the server’s working on localhost with the port 3000 for the two endpoints. At this point, there’s no error handling.

I let the env deliberatly because this project is a little exercice, there’s no sensible data.

Todo for tomorrow:

Day 2 - 07/03/2024 - justification algo + docker