/ts-express-boilerplate

Typescript Express Boilerplate

Primary LanguageTypeScript

Typescript Express Boilerplate

CircleCI (all branches)

This boilerplate is a generic "template" for a web application based on following components:

Web framework

Logging:

Utilities:

Testing:

Linting:

Installation

  1. Install dependencies
$ npm -i
  1. Build sources
$ npm run build
  1. If you need, create a database

  2. Copy .env.example to .env

  3. Edit .env file and put required variables

  4. Migrate database

  5. To run tests

$ npm run test
  1. To start
$ npm start

Docker

  1. Build image
$ docker build -t ts-express-boilerplate .
  1. Run image :)
$ docker run -d -p 3000:3000 --name ts-express-boilerplate ts-express-boilerplate:latest

Coding guidelines

I suggest reading this useful article:

Using ESLint and Prettier in a TypeScript Project

To activate ESlint in Webstorm, follow this link:

ESLint in Webstorm

To use ESlint from command line:

$ eslint --fix --ignore-path .eslintignore src/*.ts

Some useful references:

For testing:

Deploy to openshift