This application allows you to create an account while being able to deposit, transfer and withdraw from it.
If you would still prefer to do the installation manually, follow these steps:
Clone the repo:
git clone --depth 1 https://github.com/Vectormike/lite-bank
cd lite-bank
Install the dependencies:
npm install
Set the environment variables:
cp .env.example .env
# open .env and modify the environment variables (if needed)
Run the migration:
knex migrate:latest
Start the server in development"
npm run dev
Run in production
npm run serve
Start up the containers
docker-compose up -d on the root directory of the project
Run Migration
docker exec -t -i app knex migrate:latest
To view the list of available APIs and their specifications, vist Postman API documentation
List of available routes:
Auth routes:
POST /api/auth/register
- register
POST /api/auth/login
- login\
Account routes:
POST /api/account/deposit
- fund
POST /api/account/transfer
- transfer
POST /api/account/withdraw
- withdraw\
- MySQL database: MySQL object data modeling using Knex
- Authentication and authorization: using passport
- Validation: request data validation using Joi
- Logging: using winston and morgan
- Testing: unit and integration tests using Jest
- Dependency management: with NPM
- Environment variables: using dotenv
- Compression: gzip compression with compression
- Docker support
- Git hooks: with husky and lint-staged
- Linting: with ESLint and Prettier
- Editor config: consistent editor configuration using EditorConfig
The environment variables can be found and modified in the .env
file. They come with these default values:
# Port number
NODE_ENV=development
PORT=8000
BASE_URL_DEV=http://localhost:8000
BCRYPT_SALT=12
REFRESH_TOKEN_SECRET=hththjjkekdkkkdkd
JWT_AUTH_SECRET=kdkdkkdkk
ELK_VERSION=7.5.1
DB_NAME=lendsqr
TEST_DB_NAME=lendsqr_test
DB_HOST=127.0.0.1
DB_PORT=8889
DB_USERNAME=root
DB_PASSWORD=root
src\
|--components\ # Modules for each services
|--config\ # Database, jwt and redis configuration
|--database\ # Migrations
|--errors\ # Error handlers
|--helpers\ # Helpers
|--middlewares\ # Custom express middleware
|--shared\ # Utility classes and functions
|--tests\ # Unit tests
|--app.js # Express app
|--server.js # App entry point