This package contains the base code for the system.
- NodeJS v12.16.3
- Docker
| S/N | Name | Type | Description |
|---|---|---|---|
| 1 | external | dir | This holds the code for building external system which is required for question 2. There is no need to modify anything inside or start it manually |
| 2 | typescript | dir | This holds the base code which you should extend in order to fulfil the requirements |
| 3 | NodeJS_Assessment_v2.docx | file | The specification for the assignment |
| 4 | README.md | file | This file |
| 5 | data.sample.csv | file | Sample csv for question 1 |
| 6 | school-administration-system.postman_collection.json | file | Postman script for uploading file |
| S/N | Application | Exposed Port |
|---|---|---|
| 1 | database | 3306 |
| 2 | external | 5000 |
| 3 | applicaiton | 3000 |
All the commands listed should be ran in ./typescript directory.
npm installStarting the project in local environment. This will start all the dependencies services i.e. database and external (folder).
npm startThis will start the application in watch mode.
npm run start:devYou should be able to call (GET) the following endpoint and get a 200 response
http://localhost:3000/api/healthcheck
You should be able to call (POST) the following endpoint and get a 200 response
http://localhost:5000/students?class=2&offset=1&limit=2
You can place your database migration scripts in typescript/database folder.
It will be ran the first time MySQL docker container is first initialised.
Please provide the instruction on how to initialise the database if you are not using the above method.
If you encounter the following error when running npm start, it is due to the slow startup of your database container.
Please run npm start again.
[server.js] ERROR SequelizeConnectionError: Connection lost: The server closed the connection.
[server.js] ERROR Unable to start application
You can import the included postman script (school-administration-system.postman_collection.json) into your postman.