1- # Express Typescript Boilerplate [ ![ Build Status] ( https://travis-ci.org/w3tecch/express-typescript-boilerplate.svg?branch=master )] ( https://travis-ci.org/w3tecch/express-typescript-boilerplate )
1+ # Express Typescript Boilerplate
2+ [ ![ Dependency Status] ( https://david-dm.org/w3tecch/express-typescript-boilerplate/status.svg?style=flat )] ( https://david-dm.org/w3tecch/express-typescript-boilerplate ) [ ![ Build Status] ( https://travis-ci.org/w3tecch/express-typescript-boilerplate.svg?branch=master )] ( https://travis-ci.org/w3tecch/express-typescript-boilerplate )
23
34A delightful way to building a RESTful API with NodeJs & TypeScript.
45- ** Beautiful Syntax** thanks to the awesome annotations from [ Inversify Express Utils] ( https://github.com/inversify/inversify-express-utils ) .
@@ -12,6 +13,8 @@ A delightful way to building a RESTful API with NodeJs & TypeScript.
1213- ** Custom Commands** are also available in our setup and really easy to use.
1314- ** Smart Validation** thanks to [ class-validator] ( https://github.com/pleerock/class-validator ) with some nice annotations.
1415- ** API Documentation** thanks to [ swagger] ( http://swagger.io/ ) .
16+ - ** API Monitoring** thanks to [ express-status-monitor] ( https://github.com/RafalWilinski/express-status-monitor ) .
17+ - ** Integrated Testing Tool** thanks to [ Wallaby.js] ( https://wallabyjs.com/ )
1518
1619## Getting Started
1720### Prerequisites
@@ -20,7 +23,7 @@ A delightful way to building a RESTful API with NodeJs & TypeScript.
2023 * on Windows use [ chocolatey] ( https://chocolatey.org/ ) ` choco install nodejs `
2124* Install yarn globally ` npm install yarn -g `
2225
23- ## Installing
26+ ### Installing
2427* ` fork ` this repo
2528* ` clone ` your fork
2629* ` yarn install ` to install all dependencies and typings
@@ -29,12 +32,14 @@ A delightful way to building a RESTful API with NodeJs & TypeScript.
2932* ` npm run db:seed ` to insert some test data
3033* ` npm run serve ` to start the dev server in another tab
3134
32- ## Running the app
35+ ### Running the app
3336After you have installed all dependencies you can now run the app.
3437Run ` npm run serve ` to start a local server using ` nodemon ` which will watch for changes and then will restart the sever.
3538The port will be displayed to you as ` http://0.0.0.0:3000 ` (or if you prefer IPv6, if you're using ` express ` server, then it's ` http://[::1]:3000/ ` ).
3639
37- ## Scripts / Commands
40+ ## Scripts / Tasks
41+ All script are defined in the package.json file, but the most important ones are listed here.
42+
3843### Install
3944* Install all dependencies with ` yarn install `
4045
@@ -51,9 +56,6 @@ The port will be displayed to you as `http://0.0.0.0:3000` (or if you prefer IPv
5156* Run ` npm run serve ` to start nodemon with ts-node, which will serve your app.
5257* The server address will be displayed to you as ` http://0.0.0.0:3000 `
5358
54- ### Cleaning the project
55- * Run ` npm run clean ` to remove all generated JavaScript files.
56-
5759### Building the project and run it
5860* Run ` npm run build ` to generated all JavaScript files from your TypeScript sources. After this step you can deploy the app on any server.
5961* There is also a vscode task for this called build.
@@ -68,7 +70,51 @@ The port will be displayed to you as `http://0.0.0.0:3000` (or if you prefer IPv
6870### Console
6971* To run your own created cli script enter ` npm run console <command-name> `
7072
73+ ## Using the debugger in VS Code
74+ Just set a breakpoint and hit ` F5 ` in your Visual Studio Code.
75+
76+ ## API Routes
77+ The route prefix is by default ` /api/v1 ` , but you can change this in the .env.example file.
78+
79+ | Route | Description |
80+ | ----------- | ----------- |
81+ | ** /info** | Shows us the name, description and the version of the package.json |
82+ | ** /docs** | This is the Swagger UI with our API Documentation |
83+ | ** /status** | Shows a small monitor app for our API |
84+
85+ ## Project Structure
86+
87+ | Name | Description |
88+ | ----------------------------- | ----------- |
89+ | ** .vscode/** | VSCode tasks, launch configuration and some other settings |
90+ | ** build/** | Task Runner configurations and tasks |
91+ | ** dist/** | Compiled source files will be placed here |
92+ | ** src/** | Source-Files |
93+ | ** src/api/controllers/** | REST-API - Controllers |
94+ | ** src/api/exceptions/** | Exceptions like 404 NotFound |
95+ | ** src/api/middlewares/** | Express Middlewares like populateUser |
96+ | ** src/api/models/** | Bookshelf Models |
97+ | ** src/api/repositories/** | Repository Layer |
98+ | ** src/api/requests/** | Request Bodys with Validations |
99+ | ** src/api/services/** | Service Layer |
100+ | ** src/api/** swagger.json | Swagger Documentation |
101+ | ** src/console/** | Command Line scripts |
102+ | ** src/constants/** | Global Constants |
103+ | ** src/core/** | All the libraries configurations and our small framework |
104+ | ** src/database/factories/** | Model Factories to generate database records |
105+ | ** src/database/migrations/** | Migrations scripts to build up our database schema |
106+ | ** src/database/seeds/** | Seed scripts to fake some data into our database |
107+ | ** src/public/** | Static assets (fonts, css, js, img). |
108+ | ** src/types/** * .d.ts | Custom Type Definitions and files that aren't on DefinitelyTyped |
109+ | ** test** | All our test cases |
110+ | ** test/setup/** | Some setup scripts to create a needed test environment |
111+ | ** test/black-box/** * .test.ts | Black-Box Testing (like e2e) |
112+ | ** test/unit/** * .test.t | Unit Testing |
113+ | .env.example | All environment configurations |
114+ | knexfile.ts | This file is used for the migrations and seed task of knex |
115+
71116## Related Projects
117+ * [ Microsoft/TypeScript-Node-Starter] ( https://github.com/Microsoft/TypeScript-Node-Starter ) - A starter template for TypeScript and Node with a detailed README describing how to use the two together.
72118* [ express-graphql-typescript-boilerplate] ( https://github.com/w3tecch/express-graphql-typescript-boilerplate ) - A starter kit for building amazing GraphQL API's with TypeScript and express by @w3tecch
73119* [ aurelia-typescript-boilerplate] ( https://github.com/w3tecch/aurelia-typescript-boilerplate ) - An Aurelia starter kit with TypeScript
74120* [ Auth0 Mock Server] ( https://github.com/hirsch88/auth0-mock-server )
0 commit comments