1.4.0 • Published 4 years ago

myid-back v1.4.0

Weekly downloads
10
License
MIT
Repository
-
Last release
4 years ago

kvalifika-backend

See dev api, staging, prod


this project was bootstraped by Nest CLI

Tech Stack

Directory Layout

├── .ebextensions/                 # elastic beanstalk config
├── dist/                          # Compiled output
├── node_modules/                  # 3rd-party libraries and utilities
├── deployment/                    # Deployment infrastructure
├── jest-stare/                    # Nest generated test stats
├── config/                        # Application config
├── views/                         # Application view engine files for generating html
├── src/                           # Application source code
│   ├── shared/                    # Shared modules decorators helpers etc.
│   │   │── decorator/             # NestJS Shared decorators
│   │   │── middleware/            # NestJS Shared middleware
│   │   │── interceptor/           # NestJS Shared interceptors
│   │   │── scalars/               # Graphql Shared scalars
│   │   │── types/                 # Typescript shared types
├── cli/                           # cli commands
├── tsconfig.json                  # Typescript configuration
├── jest.config.js                 # Jest configuration
├── nest-cli.json                  # NestJS Config file

Getting Started

$ git clone https://github.com/vobi-io/myid-backend
$ cd myid-backend
$ yarn
$ yarn start

Environment Variables

environment variable is set by NODE_ENV env variable

Running the app

# development (starts with development environment)
$ yarn start:develop

# development (starts with development_local environment)
$ yarn start:local

# production mode (starts with staging environment)
$ yarn start:staging

Then open http://localhost:8000/ to see your app.

Open http://localhost:8000/api/ to see swagger documentation

Open http://localhost:8000/graphql/ to see graphql playground

Scripts

Start scripts

$ yarn start # takes NODE_ENV variable from cli
$ yarn start:local # starts with development_local env
$ yarn start:staging # starts with staging env
$ yarn start:prod # takes NODE_ENV variable from cli
$ yarn start:debug # starts NestJS with debug mode

Build

$ yarn prebuild # removes built directory
$ yarn build # runs nest build
$ yarn build:staging # building application on staging environment
$ yarn build:prod # building application on production environment

Testing

$ yarn test:e2e # runs jest tests
$ yarn test:e2e:coverage # runs jest tests and generates coverage
$ yarn gen:e2e:report # generates test report

CLI Commands

$ yarn set:admin <email> <isAdmin> # sets isSuperAdmin field on production db
$ yarn set:admin:dev # sets isSuperAdmin field on development db
$ yarn import:storage # this was used to import google bucket images into s3

Other Scripts

$ yarn lint # runs linter on application
$ yarn eject # not used
$ yarn analyze # analyzes sourcemap of application

Hooks

we have pre commit hook which runs linter on application and makes sure everything is okay before committing changes

Git Flow

we use Semantic Commits for branch creation and commit messages

example:

$ git checkout develop
$ git pull
$ git checkout -b feat/some-feature
$ git add .
$ git commit -m "feat: feature description"
$ git push -u origin feat/some-feature

and then create pull request to develop branch

deployment flow

Deployment

Follow this link

DB

database architecture

UML

database architecture

Packages

Yarn packages

  • For installing dependensies use yarn add <package>
  • To add de dependency use yarn add <package> --dev

Api versioning guides.

! Moving breaking changes to new version. old one remains unchanged.

Note

Version incriment should follow release managment principles. First Digit. Major Change Second Digit. Minor Change