Current Account Example Project
This project exposes various endpoints to:
- create/read/update/delete/authenticate a customer
- create/read/update/delete a current account
- create/read/delete a transaction
and an 'Insomnia' export is provided to be used to check out the endpoints.
The main endpoints are:
POST /api/v1/accounts
providing Auth token and body as ```{ customerId: some id, initialCredit: 2000} to create a current account.GET /api/v1/accounts
providing Auth token to get all the accounts and transactions for the logged in customer.
Some points of improvement are:
- Encrypt the customer/account/transactions id sent in the http requests using (eg. using Hashids lib).
- Move all the text and numeric constants in a separate configuration file.
- Add in-memory database for testing in the CI.
Features
- Graceful Shutdown, HealthCheck, SQL Database & Migrations, Authentication, Validation, Integration & Unit Testing, Git Hook
- npm install - Install dependencies
- docker-compose up (compose and run, it also creates the mysql database)
- docker-compose down (Destroy application and mysql containers)
Make sure to have run docker-compose up before these steps. The database is needed.
- npm run test - Run unit tests
- npm run test:integration - Run integration tests
- npm run test:all - Run Unit and Integration tests