A NodeJS starter template with NodeJS + TypeScript + Hapi + TypeORM + Postgres + GraphQL
- Visit https://typescript-node-starter.herokuapp.com/doc to view swagger docs.
- Visit https://typescript-node-starter.herokuapp.com to view the status monitor.
- Visit https://typescript-node-starter.herokuapp.com/graphql to view GraphQl Playground.
This starter kit comes with the following features:
- Swagger-UI
- Status Monitor
- Authorization with Basic and JWT
- Apollo GraphQL
- TypeORM and Postgres
- .env files support
- nodemon for hot-reload
- Pretty Console Logger with Winston
- Code formatting with Prettier as hook for Pre-commit
- Dockerfile + docker-compose for development
- Basic Test Suite with Tape and Test coverage
- Coverage Report
- Supports Github Action
- Supports Heroku Deployment
- Supports Prettier for code formating
- Supports commitlint via husky to have standarized commit messages
- NodeJS > 10.x
- Yarn > 1.x
- NPM > 5.x
- Postgres 11.5
- CLone this project
- Run
npm install
- Run
npm run dev
- Visit http://localhost:8080/doc to view swagger docs.
- Visit http://localhost:8080 to view the status monitor.
- Visit http://localhost:8080/graphql to view GraphQl Playground.
- Update
ormconfig.yml
to configure Database - Add or update other configurations in
.env
,src/config.ts
tsc
: Compiles typescript based on config set in tsconfig.json.start
: Starts node with the compiled typescript. Used by eg. Heroku.docker:logs
: View Docker logsdocker:ps
: List Docker containersdocker:start
: Start Docker container based on docker-compose.yml file.docker:stop
: Stop Docker containernodemon:start
: Starts the Nodemon using ts-node. No need to compile beforehand.dev
: Same as nodemon:startformat:lint
: Runs tslint on the typescipt files, based on tslint.js settings.format:prettier
: Runs prettier on all ts-files.test
: Runs tests using nyc, and creates coverage report.
If you found a bug, or you have an answer, or whatever. Please, raise an issue.
Of course, if you see something that you want to upgrade from this library, or a bug that needs to be solved, PRs are welcome!
Distributed under the MIT license. See LICENSE for more information.