You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-10Lines changed: 22 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,16 @@
1
1
# Express Typescript Boilerplate
2
2
3
-
> Boilerplate for an restful express-application written in TypeScript
3
+
Delightful building a RESTful API in TypeScript.
4
+
-*Beautiful Syntax* thanks to the awesome annotations from [Inversify Express Utils](https://github.com/inversify/inversify-express-utils).
5
+
-*Easy API Testing* with included black-box testing.
6
+
-*Dependency Injection* done with the nice framework from [Inversify](http://inversify.io/).
7
+
-*Fast Database Building* with simple migration and seeding from [Knex](http://knexjs.org/).
8
+
-*Simplified Database Query* with the ORM of [Knex](http://knexjs.org/) called [Bookshelf](http://bookshelfjs.org/).
9
+
-*Clear Structure* with controllers, services, repositories, models, middlewares...
10
+
-*Easy Exception Handling* with our own simple classes. You will see.
11
+
-*Easy Data Seeding* with our own factories.
12
+
-*Custom Commands* are also available in our setup and really easy to use.
13
+
-*Smart Validation* thanks to [class-validator](https://github.com/pleerock/class-validator) with some nice annotations.
4
14
5
15
## Getting Started
6
16
### Prerequisites
@@ -12,8 +22,8 @@
12
22
## Installing
13
23
*`fork` this repo
14
24
*`clone` your fork
15
-
*`install:dev` to install all dependencies and typings
16
-
* Create new database. You will find the name in the `src/config.ts` file.
25
+
*`yarn install` to install all dependencies and typings
26
+
* Create new database. You will find the name in the .env files.
17
27
*`npm run db:migrate` to create the schema
18
28
*`npm run db:seed` to insert some test data
19
29
*`npm run serve` to start the dev server in another tab
@@ -26,16 +36,14 @@ The port will be displayed to you as `http://0.0.0.0:3000` (or if you prefer IPv
26
36
## Scripts / Commands
27
37
### Install
28
38
* Install all dependencies with `yarn install`
29
-
* Install all typings with `npm run install:typings`
30
-
* To install all dependencies and typings use `npm run install:dev`
31
-
* Remove not needed libraries with `npm run install:clean`
32
39
33
40
### Linting
34
41
* Run code analysis using `npm run lint`. This runs tslint.
35
42
* There is also a vscode task for this called lint.
36
43
37
44
### Tests
38
45
* Run the unit tests using `npm test`.
46
+
* Run the black-box tests using `npm run test:black-box`.
39
47
* There is also a vscode task for this called test.
40
48
41
49
### Running in dev mode
@@ -50,12 +58,14 @@ The port will be displayed to you as `http://0.0.0.0:3000` (or if you prefer IPv
50
58
* There is also a vscode task for this called build.
51
59
* To start the builded app use `npm start`.
52
60
53
-
### Seed
54
-
* Run `npm run db:seed` to seed some data into the database
55
-
56
-
### Migration
61
+
### Database
57
62
* Run `npm run db:migrate` to migration the new schema to the database
58
63
* Run `npm run db:migrate:rollback` to rollback one version
64
+
* Run `npm run db:seed` to seed some data into the database
65
+
* Run `npm run db:reset` to clean the database and migrate again
66
+
67
+
### Console
68
+
* To run your own created cli script enter `npm run console <command-name>`
59
69
60
70
## Related Projects
61
71
*[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
@@ -68,6 +78,8 @@ The port will be displayed to you as `http://0.0.0.0:3000` (or if you prefer IPv
0 commit comments