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

Feature

  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

Best practice

  1. Install Settings GitHub app in your account or organization
  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

Type package

Sign in GitHub packages with NPM

  1. Generate a PAT with read:packages authorization
  2. Run Sign-in command in your terminal, and use PAT as password:
npm login --scope=@your-org --registry=https://npm.pkg.github.com

Installation

npm i pnpm -g

pnpm i @your-org/rest-node-ts -D

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 v0.6.0  # this version tag comes from ./package.json
git push origin master --tags

Publish Type Package

git checkout master
git tag type-v0.6.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