About • Technologies • How to start the project • MySQL database • License • Developer
The project Bank API were made to start my journey learning backend using NodeJS and Typescript.
$ git clone https://github.com/joaorpereira/bank-api.git
$ cd bank-api
$ npm install
$ create database as bank_database at MySQL
$ create database as bank_database at MySQL
client: 'mysql',
connection: {
host: proccess.env.HOST,
port: 3306,
user: proccess.env.DB_NAME,
password: proccess.env.DB_PASSWORD,
database: proccess.env.DB_DATABASE,
},
$ npm create-tables
$ npm run dev
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'
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
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
This project is under MIT license