Software Engineering School 4.0 // Case
- create
.env.developmentfor dev mode and.end.productionfor production mode. The respective fields you can find in.env.example npm run ito install packages
npm run env:devto start postgres container- (a)
npm run devto start the application in watch mode - (b)
npm run startto start the application
The second point will automatically run migrations.
npm run env:prodto run docker compose yaml that consists of application docker image and postgres. It will automatically pull the required packages and install node_modules.
- More basic things like base classes for controllers, services, entities, validators and so on.
- Better segregation of duties. Currently there is no separate service for a specific logic as the task is quite easy/fuzzy. Due to the lack of details/domain knowledge it is hard to highlight specific modules.
- Naming for sure (scripts, functions)
- The task with cron jobs should be solved not by Node.js, but with queues like bull queue (based on Redis). But it would complicate the solution having simple API requirements.
- Emails sending logic could be implemented with queue as well. Currently, we would stuck at some point of 1000x emails at the moment. The mechanism like semaphore is viable here, but passing the responsibility of handling it to the queue is superior.
- Having tests :/
In a nutshell, it is not expedient to build a spaceship having 4 days deadline to handle 2 endpoints. But the improvement path is quite clear.