This repository is a part of the Flight Tracker project.
Repository contains an ADS-B receiver API that receives data from virtual, flight-simulator-based sources. Project is using Node.js with TypeScript, with Nest.js framework and handles HTTP requests. It is close-to-real ADS-B over HTTP implementation, which can be used to test ADS-B clients or other applications that consume ADS-B data.
Locally, environment is set up using docker compose.
This app uses docker-based virtualization to run. To set up a project, follow these steps:
-
Clone project by running:
git clone [email protected]:oskarbarcz/adsb-receiver-api.git
-
Prepare an environment variable file by copying
.env.distto.envand fill it with your data.cd adsb-receiver-api cp .env.dist .env -
Use
docker composeto set up the environmentdocker compose up -d --build
Packages, database schema, seed data will be configured automatically.
-
Your project should be up and running. Open browser and go to http://localhost/api to see the api documentation. You can preview app logs by running:
docker compose logs -f app
Do not execute NPM or any other commands regarding project from your host machine, use container shell instead. For example, to generate Prisma schema run:
docker compose exec app npm run lintIt will execute the
npm run lintcommand in the container shell.
To shut the containers run:
docker compose downTo run tests, execute the following commands:
# unit tests
$ docker compose exec app npm run test
# functional tests
$ docker compose exec app npm run test:functionalWe use Jest for unit tests, and cucumber-js for functional tests. Unit tests are stored in the src directory
just near the tested module, while functional tests are stored in the features directory.
Before merging Pull Request to the main branch, make sure to bump the project version in the
package.jsonfile, line3. Then it is a good practice to runnpm installinside a docker container to update thepackage-lock.jsonfile.Not bumping the version will result in the release failure. There is a step in CI that will protect the main branch from being merged without bumping the version.
