src
├── controllers
│ ├── accountController.ts
│ └── transactionController.ts
│
├── services
│ ├── accountService.ts
│ └── transactionService.ts
│
├── entities
│ ├── Account.ts
│ └── Transaction.ts
│
├── db
│ ├── index.ts
│ ├── seed.ts
│ └── data
│ ├── accounts-api.json
│ ├── accounts-api-large.json
│ ├── transactions-api.json
│ └── transactions-api-large.json
│
├── routes
│ ├── accountRoutes.ts
│ ├── transactionRoutes.ts
│ └── schemas
│ ├── accountSchemas.ts
│ ├── transactionSchemas.ts
│ └── index.ts
│
└── index.ts
To run the project, follow these steps:
Make sure you have Docker and Node.js installed on your machine.
Run the following command at the root of the project to start the PostgreSQL database using Docker Compose:
docker-compose up
Run the following command to install project dependencies:
npm install
After installing dependencies, run the following command to start the server:
npm run build
npm run start
DEV (it runs with hot reload):
npm run start:dev
This will start the application server on port 8080.
To run tests, execute the following command:
npm run test
This command will run unit tests.
To run seed, execute the following command:
npm run build
npm run db:seed
Optionally, if you want to seed the database with a larger dataset, you can use the following command:
npm run db:seed:large
The OpenAPI Spec file (swagger.yml) is available for testing purposes. You can open it in the Swagger Editor or Postman to explore and interact with the API documentation.