GithubHelp home page GithubHelp logo

vs4vijay / typescript-express-template Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 126 KB

A Microservice Template in NodeJS, TypeScript, and Express

License: MIT License

Shell 1.46% Dockerfile 2.97% JavaScript 27.84% TypeScript 67.72%
microservice nodejs typescript express typeorm typedi routing-controllers api rest-api http-server

typescript-express-template's Introduction

typescript-express-template

A Microservice Template in NodeJS, TypeScript, and Express

Express + Routing-Controllers + TypeScript + TypeORM + TypeDI


Installation

npm install
  • Create .env file from .env.example and populate environment variables

Running

# Build and Run
npm start

# Run on local machine with watcher
npm run start:dev

Features

  • TypeScript
  • Depedency Injection of Services, Repositories, Controllers
  • Modular App.ts
  • Properly structured codebase models, repositories, services, controllers, migrations etc.
  • ORM Migrations used for maintaining database schemas
  • Follows pure REST APIs
  • Input validations
  • Use of .env file
  • Git pre-commit hooks setup
  • Linting and Standard Formatting
  • Added system metadata like createdAt, updatedAt
  • Use of DTOs
  • Added audit log like createdBy, updatedBy
  • isActive
  • uuid as primary key
  • Soft Delete Options
  • Pagination
  • Structured Logging
  • Unit Testing
  • Authentication
  • Authorization
  • Error Handling and Generic Error Middleware
  • Search Framework
  • AbstractService or interface Service
  • Graceful Shutdown
  • Containerized with Docker

Libraries Used


Development

  • Create an entity: npm run typeorm -- entity:create -n User
  • Generate migration: npm run typeorm -- migration:generate -n CreateUser
  • Run the migrations: npm run typeorm -- migration:run

Notes:

  • Migration name pattern: AddTo
    • AddLastNameToUser
    • UpdateEmailToEmployee

Development Guidelines

  • Make use of index.ts in folder which has multiple files

Development Notes

typescript-express-template's People

Contributors

renovate-bot avatar vs4vijay avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

typescript-express-template's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update dependency @types/jest to v26.0.24
  • Update dependency body-parser to v1.20.2
  • Update dependency reflect-metadata to ^0.2.0
  • Update dependency winston to v3.13.0
  • Update Node.js to v20 (node, @types/node)
  • Update dependency dotenv to v16
  • Update dependency eslint to v9
  • Update dependency eslint-config-prettier to v9
  • Update dependency eslint-plugin-prettier to v5
  • Update dependency helmet to v7
  • Update dependency husky to v9
  • Update dependency jest-junit to v16
  • Update dependency lint-staged to v15
  • Update dependency prettier to v3
  • Update dependency rimraf to v5
  • Update dependency ts-node-dev to v2
  • Update dependency typescript to v5
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Other Branches

These updates are pending. To force PRs open, click the checkbox below.

  • Update dependency express to v4.19.2 [SECURITY]
  • Update dependency sqlite3 to v5.1.5 [SECURITY]

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
Dockerfile
  • node 14.16.1-alpine
  • node 14.16.1-alpine
npm
package.json
  • body-parser ^1.19.0
  • class-transformer ^0.3.2
  • class-validator 0.13.1
  • cors ^2.8.5
  • dotenv ^8.2.0
  • express ^4.17.1
  • helmet ^4.4.1
  • morgan ^1.10.0
  • reflect-metadata ^0.1.13
  • routing-controllers ^0.8.1
  • sqlite3 ^5.0.1
  • typedi ^0.8.0
  • typeorm ^0.2.28
  • typeorm-typedi-extensions ^0.2.3
  • winston ^3.3.3
  • @types/cors 2.8.10
  • @types/express 4.17.11
  • @types/jest 26.0.22
  • @types/node 14.14.43
  • @typescript-eslint/eslint-plugin 4.22.0
  • @typescript-eslint/parser 4.22.0
  • eslint 7.24.0
  • eslint-config-prettier 7.2.0
  • eslint-plugin-prettier 3.3.1
  • husky 6.0.0
  • lint-staged 10.5.4
  • prettier 2.2.1
  • ts-node 9.1.1
  • ts-node-dev 1.1.6
  • typescript 4.1.5
  • jest 26.6.3
  • jest-junit 12.0.0
  • rimraf 3.0.2

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.