Skip to content

diegobaptista/bank-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Test-Bank


Related Technologies

  • Typescript
  • Node
  • Hapi
  • Swagger
  • Typeorm
  • Joi
  • Postgres
  • Jest
  • JWT

About

Test api about a test bank.

For now there are just CRUDs and basic features about account and bank management.

You need to run the project

Running the application

After installing all the prerequisites

  1. Import the project using your favorite IDE
  2. Download all dependencies with yarn or npm
  3. After you'll need to up the docker image with postgres, then tip the following command
$ sudo docker-compose up -d
  1. Run yarn start
  2. You can check the endpoints on swagger.io
http://localhost:3000/documentation

Testing API

  1. You need to login to get an token

{{host}}/auth

{
    "username": "test-user",
    "password": "@changeme"
}
  1. Get token property returned

  2. To test in Swagger you need to click on big button Authorization

  3. Paste the code, but before you need to digit Bearer Ex:

Bearer TOKENTOKENTOKENTOKENTOKENTOKENTOKENTOKENTOKEN

  1. And don't forget to run request in HTTPS mode in swagger

I suggest that you download too

  • Postman or Insomnia (Test endpoints)
  • DBeaver (Manage database)

dotenv example

NODE_ENV=local

DATABASE_HOST="localhost"
DATABASE_PORT=5454
DATABASE_USERNAME="postgres"
DATABASE_PASSWORD="@changeme"
DATABASE_NAME="postgres"

JWT_AUDIT="aud:test-bank"
JWT_ISSUER="issuer:test-bank"
JWT_SECRET="your-secret"
JWT_VALID_IN_SECONDS=14400

USER_MOCK_USERNAME="test-user"
USER_MOCK_PASSWORD="@changeme"
USER_MOCK_EMAIL="test-user@test.com"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors