This boilerplate is a generic "template" for a web application based on following components:
Web framework
Logging:
Utilities:
Testing:
Linting:
- Install dependencies
$ npm -i
- Build sources
$ npm run build
-
If you need, create a database
-
Copy .env.example to .env
-
Edit .env file and put required variables
-
Migrate database
-
To run tests
$ npm run test
- To start
$ npm start
- Build image
$ docker build -t ts-express-boilerplate .
- Run image :)
$ docker run -d -p 3000:3000 --name ts-express-boilerplate ts-express-boilerplate:latest
I suggest reading this useful article:
Using ESLint and Prettier in a TypeScript Project
To activate ESlint in Webstorm, follow this link:
To use ESlint from command line:
$ eslint --fix --ignore-path .eslintignore src/*.ts
- TypeORM - http://typeorm.io/#/
- TypeScript Deep Dive - https://basarat.gitbooks.io/typescript/content/
- Tutorial on Typescript - https://blog.risingstack.com/building-a-node-js-app-with-typescript-tutorial/
- Cheatsheet - https://www.sitepen.com/blog/typescript-cheat-sheet
- Jest - https://jestjs.io/docs
- Supertest - https://github.com/visionmedia/supertest
- Superagent - http://visionmedia.github.io/superagent/#post-put-requests
- Sinon - https://sinonjs.org/
- Tutorial typescript api - https://tutorialedge.net/typescript/testing-typescript-api-with-jest/
- Automatic build and deploy - http://www.admin-magazine.com/Archive/2018/47/Automatic-build-and-deploy-with-OpenShift-and-GitLab-CI