Skip to content

Repository files navigation

Payment Service Provider API

About project

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

Skills

  • 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;

Opening the app locally

On terminal:

  1. Please install and check the version of the following services on your system:

NPM & Node

  npm -v
  node -v

MySQL

  mysql --version
  1. Clone the repository in your preferred folder
  git clone git@github.com:rtxnak/PaymentServiceProviderAPI.git
  1. Install the dependencies
  • move to app folder:
       cd PaymentServiceProviderAPI/
  • Install dependencies:
       npm install  
  1. 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
  1. The API can be accessed through:

    http://localhost:3000/

  2. The API documentation can be acessed through:

    http://localhost:3000/api

  3. To run tests:

  • Unit tests:
       npm test
  • E2E tests:
       npm run test:e2e 

Opening the app locally with Docker

On terminal:

  1. Please install and check the version of the following services on your system:

Docker

  docker -v

Docker-Compose

  docker-compose -v
  1. Clone the repository in your preferred folder
  git clone git@github.com:rtxnak/PaymentServiceProviderAPI.git
  1. Move to app folder
  cd PaymentServiceProviderAPI/
  1. Run the application with docker-compose
  docker-compose up --build 
  1. The API can be accessed through:

    http://localhost:3000/

  2. the API documentation can be acessed through:

    http://localhost:3000/api

  3. To run tests:

  • Unit tests:
       npm test
  • E2E tests:
       npm run test:e2e 
  1. Finishing the application
  docker-compose down

About

A REST API on Typescript and NestJs with MYSQL database to simulate a payment service provider dinamic

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages