Skip to content
/ REST-Node-ts Public template

RESTful API service scaffold based on Node.js & TypeScript, which is a lite Back-end framework compared with Nest.js. And it can be deployed to Docker-compose-based clouds much more easier with GitHub actions.

Notifications You must be signed in to change notification settings

idea2app/REST-Node-ts

Repository files navigation

REST-Node-ts

RESTful API service scaffold based on Node.js & TypeScript

Deploy to Production environment

Deploy to Render

Open in GitHub Codespaces Open in Gitpod

Technology stack

  1. HTTP server: Koa
  2. Controller framework: Routing Controllers
  3. Model framework: Class Transformer & Class Validator
  4. ORM framework: TypeORM
  5. API document: Swagger
  6. Mock API: OpenAPI backend
  7. Test framework: Jest

Major features

  1. API entry & Health checking
  2. User & Session
  3. OAuth sign in
  4. Activity logging

Best practice

  1. Install GitHub apps in your organization or account:

    1. Probot settings: set up Issue labels & Pull Request rules
    2. PR badge: set up Online VS Code editor entries in Pull Request description
  2. Click the Use this template button on the top of this GitHub repository's home page, then create your own repository in the app-installed namespace above

  3. Click the Open in GitHub codespaces button on the top of ReadMe file, then an online VS Code development environment will be started immediately

  4. Recommend to add a Notification step in GitHub actions for your Team IM app

  5. Remind the PMs & users of your product to submit Feature/Enhancement requests or Bug reports with Issue forms instead of IM messages or Mobile Phone calls

  6. Collect all these issues into Project kanbans, then create Pull requests & add closes #issue_number into its description for automation

API Usage

Environment variables

Name Usage
APP_SECRET encrypt Password & Token
DATABASE_URL PostgreSQL connection string

Development

Installation

npm i pnpm -g
pnpm i

Start Development environment

pnpm dev

or just press F5 key in VS Code.

Migration

pnpm upgrade:dev

Deployment

Start Production environment

npm start

Migration

pnpm upgrade:pro

Docker

pnpm pack-image
pnpm container

Releasing

Deploy Application

git checkout master
git tag v1.0.0  # this version tag comes from ./package.json
git push origin master --tags

Publish Type Package

git checkout master
git tag type-v1.0.0  # this version tag comes from ./type/package.json
git push origin master --tags

About

RESTful API service scaffold based on Node.js & TypeScript, which is a lite Back-end framework compared with Nest.js. And it can be deployed to Docker-compose-based clouds much more easier with GitHub actions.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published