We need you to build a simple backend API that can be accessed by an admin user. This user can be hard-coded for this exercise and there is no need to manage users roles. This user will need to create and suspend drivers and monitor ongoing rides. Also we would like for you to simulate passengers calling drivers, and have you create some endpoints to register passengers and perform a ride simulation (no geolocation calculation is necessary to link the passenger with the best driver, this can be passed in the API).
NestJS REST API simulating a taxi ordering ride by a passenger.
- Database (typeorm).
- Seeding.
- Config Service (@nestjs/config).
- Sign in and sign up via email.
- Admin and User roles.
- Swagger.
- E2E and units tests.
- Docker.
- TypeScript / JavaScript
- NestJS Framework
- Docker for containerization
- Postgis / Postgres - Database
- Jest for testing
- Shell
- Git and GitHub
- Visual Studio Code
git clone --depth 1 git@github.com:Muchori/taxi-simulator.git
cd taxi-simulator/
cp env-example .env
docker compose up -d
For check status run
docker compose logs
I would recommend this for better experience
git clone --depth 1 git@github.com:Muchori/taxi-simulator.git
cd taxi-simulator/
cp env-example .env
Run additional container:
docker compose up -d postgres
npm install
npm run migration:run
npm run seed:run
npm run start:dev
- Swagger: http://localhost:3000/docs
Generate migration
npm run migration:generate -- src/database/migrations/CreateNameTable
Run migration
npm run migration:run
Revert migration
npm run migration:revert
Drop all tables in database
npm run schema:drop
Run seed
npm run seed:run
# unit tests
npm run test
# e2e tests
npm run test:e2e
docker compose -f docker-compose.ci.yaml --env-file env-example -p ci up --build --exit-code-from api && docker compose -p ci rm -svf
docker run --rm jordi/ab -n 100 -c 100 -T application/json -H "Authorization: Bearer USER_TOKEN" -v 2 http://<server_ip>:3000/api/v1/users