This project was developed to practice REST API creation skills with NestJs. Its a API connected to a relational database, the API's main function is to simulate a dynamic of creation and recording of transactions and payments between users and companies, and as a support function, it creates and manipulates users.
The business rules were based on the challenge in the link: https://github.com/pagarme/vagas/tree/master/desafios/software-engineer-backend
- OOP in Typescript is the base language;
- NestJs framework;
- TypeORM for MYSQL database modeling;
- Unit and E2E tests with JEST
- Swagger to create API documentation;
On terminal:
- Please install and check the version of the following services on your system:
npm -v node -v mysql --version- Clone the repository in your preferred folder
git clone git@github.com:rtxnak/PaymentServiceProviderAPI.git- Install the dependencies
- move to app folder:
cd PaymentServiceProviderAPI/ - Install dependencies:
npm install
- Create enviroment file for database conection:
- create the file .env and .test.env based on the exemple:
ENV="development" DB_USERNAME="root" DB_PASSWORD="root@123" DB_DATABASE="pspnestjs" DB_HOST="localhost" DB_PORT="3306" JWT_SECRET="Wfw!aX60yMVp9jH853!3ERMX$M6pCiIJ"
5 Run the application
- Start the api:
npm run dev
-
The API can be accessed through:
-
The API documentation can be acessed through:
-
To run tests:
- Unit tests:
npm test - E2E tests:
npm run test:e2e
On terminal:
- Please install and check the version of the following services on your system:
docker -v docker-compose -v- Clone the repository in your preferred folder
git clone git@github.com:rtxnak/PaymentServiceProviderAPI.git- Move to app folder
cd PaymentServiceProviderAPI/- Run the application with docker-compose
docker-compose up --build -
The API can be accessed through:
-
the API documentation can be acessed through:
-
To run tests:
- Unit tests:
npm test - E2E tests:
npm run test:e2e
- Finishing the application
docker-compose down