Skip to content

Team-number-7/great-equalizer-backend

Repository files navigation

Great Equalizer backend

tested with jest CircleCI

Stack

  • TypeScript - JavaScript with syntax for types
  • Express - Back end web application framework for Node.js
  • MongoDB - Document-oriented NoSQL database
  • Docker - Containerization platform
  • Jest - JavaScript Testing Framework
  • InversifyJS - Inversion of control container
  • CircleCI - Continuous Integration and Delivery

Project structure

$PROJECT_ROOT
└── dist
    ├── index.js            # Entry point
    ├── interfaces          # Interfaces
    ├── inversify.config    # IoC Container
    ├── Mongo               # DB class
    ├── Server              # Express app class
    ├── types               # Types
    └── cotrollers    
        └── TransactionController # Controller for app.* methods

Set-up

Define your environment variables:

cp .env.example .env.production 
cp .env.example .env.development
cp .env.example .env.test

Put your values in a new files.

Install dependencies

npm install 

Run tests

npm run lint
npm run test

Docker

Build Container

docker build -t containername:tag

To start MongoDB

docker compose up -d

Scripts

npm run dev - start application in development mode

npm run start - start application in production mode

npm run build - build application into /dist directory

npm run lint - run eslint

npm run eslint:fix - run eslint with fixing

npm run test - run jest