NicholasKao1029 / express-api-template

Barebones express API template following the MVC pattern

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Description

Barebones express API template following the MVC pattern MVC

NOTES

Prefer yarn but npm can be used instead.

To install packages run yarn add ___ and yarn.

Deployment

Cloud Run

There is a cloudbuild.yaml to be used in conjunction with cloudbuild Learn more

Or use any deployment platform that can use Docker.

Code Quality Enforcement

References:

  1. Huksy Set Up https://medium.com/angular-in-depth/husky-6-lint-prettier-eslint-and-commitlint-for-javascript-project-d7174d44735a
  2. Lint Config Generator: https://eslint.org/demo#
  3. Commit Linting Rules: https://github.com/conventional-changelog/commitlint/#what-is-commitlint

TODOs

CI/CD/Devops

  • Make tests be able to run while app is running (current issue: port conflict)
  • Run tests before deployment, only deploy if all pass
  • Local Docker PostGres SQL container
    • Based on production or development flows use different docker files

Logging

Mocks

  • Mock database connection (relates to docker)

Typescript

  • Common interface/naming for common controller, dao, service functions.
  • interfaces and classes, lower repition.

Best practices

Documentation

Testing

  • Unit testing is not expansive
  • E2E testing needs work

About

Barebones express API template following the MVC pattern


Languages

Language:JavaScript 95.0%Language:Shell 4.3%Language:Dockerfile 0.7%