This is the backend for the Wallet Digital module inside the app.
Make sure you have all this installed:
Dockernodeyarn.env.developmentand.env.testinside thesrc/configfolder.- Simple copy the file
docker-compose.example.ymlrenaming it todocker-compose.yml.
This project uses the following stack:
- Node 16.x.x
- PostgreSQL
- Typescript
- Express
- TypeORM
- Node-Cache
- EsLint
- Jest
- AdminJS (aka Admin Bro)
- Open API (aka Swagger UI)
- RabbitMQ
- Pino (logger)
To build and run the project just run the following command:
$ docker-compose up --buildTo run the project follow these steps:
$ yarn install
$ docker-compose up db db_test -d # running the databases
$ yarn nodemonRunning tests using yarn:
$ yarn testObs.: Make sure that the DATABASE_URL is configured to the correct host. Docker uses the service name (i.e. db) to find the database service. When running with yarn is necessary to modify it to localhost or add the service name to /etc/hosts using 127.0.0.1 as the address.
The database used in this project is PostgresSQL. There are necessary two databases instances running for the project development. One for migrations and storing data and the other to run the tests. The default ports are 5432 to the system database and 5433 to the tests database. Also, there's a shell script to avoid running the express server before the database goes up.
The API's documentation can be found accessing the route http://localhost:9000/docs.
