Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Description

Nest framework TypeScript repository. This repo represents an attenpt to build a system give the following requirements:

  • A user can create an account
  • A user can fund their account
  • A user can transfer funds to another user’s account
  • A user can withdraw funds from their account.

Installation

$ npm install

Running the app

# Migrations
npx knex migrate:up 20220317153305_init.ts --knexfile src/database/knexfile.ts 
npx knex migrate:down 20220317153305_init.ts --knexfile src/database/knexfile.ts
npx knex migrate:latest --knexfile src/database/knexfile.ts 

# Seed the database
npx knex seed:run --knexfile src/database/knexfile.ts

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# Migrations
npx knex migrate:up 20220317153305_init.ts --knexfile src/database/knexfile-test.ts 
npx knex migrate:down 20220317153305_init.ts --knexfile src/database/knexfile-test.ts 
npx knex migrate:latest --knexfile src/database/knexfile-test.ts 

# Seed the database
npx knex seed:run --knexfile src/database/knexfile-test.ts

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Gotchas

# MYSQL Config
Remember to change the mysql config to your liking.

# Authentication
PassportJS (a local strategy) is used for the authentication.
The payload expected is { username: '', password: ' }

# Environment variables
Create a .dev.env file in the root of the project.

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

Nest is MIT licensed.