diff --git a/README.md b/README.md index 09aaedd..1baae88 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,19 @@ # MyFreight Assessment +## How to run +Easiest way to run this project is using docker compose: +`docker compose up` + +It is possible that this will give some database connection issues on the first try, but after a couple of seconds, it should automatically reconnect. + +Alternatively, it is possible to use your own mysql database, and run the code locally: + +1. Import the `database/entrypoint/init.sql` into your own database +2. Update the `.env` file with the database credentials +3. Run `npm ci` to install all npm packages +4. Run `npm run build` to build the nestjs application +5. Run `npm run start:prod` to start the nestjs application + ## Receiving Tracking information When receiving Tracking information, the following steps need to be completed to process the data ```mermaid @@ -36,6 +50,10 @@ containerNumber:**string** - Sending the actual notification, there should be a more general way to setup notifiers - Moving some variables to config files - when is a shipment "arriving soon" - - database credentials (via an .env) - mock date -- +- Use the uuid package + - was not possible since the uuid's from the sample data were invalid uuid's +- Add end-to-end tests as well +- Get shipments should be paginated + - Could use a package like typeorm-crud +- Cleanup duplicate OpenApi decorators, perhaps consolidate them in a custom decorator diff --git a/docker-compose.yml b/docker-compose.yml index 0aca8dd..4edb992 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ services: build: . ports: - "3001:3000" - command: "npm run start:dev" + command: "npm run start:prod" depends_on: - database volumes: diff --git a/package.json b/package.json index 8895414..c5f75a9 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "start": "nest start", "start:dev": "nest start --watch", "start:debug": "nest start --debug --watch", - "start:prod": "node dist/main", + "start:prod": "node dist/src/main", "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", "test": "jest", "test:watch": "jest --watch",