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
A delightful way to building a RESTful API with NodeJs & 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
@@ -44,19 +52,20 @@ The port will be displayed to you as `http://0.0.0.0:3000` (or if you prefer IPv
44
52
45
53
### Cleaning the project
46
54
* Run `npm run clean` to remove all generated JavaScript files.
47
-
* Run `npm run db:clean` to drop all tables of the database.
48
55
49
56
### Building the project and run it
50
57
* Run `npm run build` to generated all JavaScript files from your TypeScript sources. After this step you can deploy the app on any server.
51
58
* There is also a vscode task for this called build.
52
59
* To start the builded app use `npm start`.
53
60
54
-
### Seed
55
-
* Run `npm run db:seed` to seed some data into the database
56
-
57
-
### Migration
61
+
### Database
58
62
* Run `npm run db:migrate` to migration the new schema to the database
59
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>`
60
69
61
70
## Related Projects
62
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
@@ -69,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