Skip to content

The project Bank API were made to start my journey learning backend using NodeJS and Typescript.

Notifications You must be signed in to change notification settings

joaorpereira/bank-api

Repository files navigation

Bank API

Made by Joao Paulo Pereira License TypeScript server Node.js

AboutTechnologiesHow to start the projectMySQL databaseLicenseDeveloper


About

The project Bank API were made to start my journey learning backend using NodeJS and Typescript.


Technologies


How to start the project

Clone repository:
$ git clone https://github.com/joaorpereira/bank-api.git
Get inside folder:
$ cd bank-api
Install dependencies:
$ npm install
Create MySQL database:
$ create database as bank_database at MySQL 
Get inside folder:
$ create database as bank_database at MySQL 
Create database connection:
  client: 'mysql',
  connection: {
    host: proccess.env.HOST,
    port: 3306,
    user: proccess.env.DB_NAME,
    password: proccess.env.DB_PASSWORD,
    database: proccess.env.DB_DATABASE,
  },
Create MySQL tables:
$ npm create-tables
Start project:
$ npm run dev
The endpoints of this API are at the file .rest in this repository

MySQL database

Users Table
    id VARCHAR(255) PRIMARY KEY,
    name VARCHAR(255) NOT NULL,
    password VARCHAR(255) NOT NULL,
    email VARCHAR(255) NOT NULL UNIQUE,
    cpf VARCHAR(255) NOT NULL,
    date_of_birth DATETIME NOT NULL,
    is_admin ENUM('NORMAL', 'ADMIN') DEFAULT 'NORMAL'
Transactions Table
    id VARCHAR(255) PRIMARY KEY,
    user_id VARCHAR(255) NULL,
    value FLOAT NOT NULL,
    type VARCHAR(50) NOT NULL,
    description TEXT,
    created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
    FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE ON UPDATE CASCADE
Accounts Table
    id VARCHAR(255) PRIMARY KEY,
    user_id VARCHAR(255) NULL,
    user_name VARCHAR(255) NOT NULL REFERENCES users(name),                
    balance FLOAT DEFAULT 0,             
    FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE ON UPDATE CASCADE

License

This project is under MIT license


Developer

Foto
Joao Paulo

Desenvolvido por Joao Paulo.

Linkedin Joao Paulo Rodrigues gmail Joao Paulo

About

The project Bank API were made to start my journey learning backend using NodeJS and Typescript.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages