typescript-clean-architecture
typescript-clean-architecture copied to clipboard
An experiment on creating a Clean Architecture based Application in Typescript
Typescript Clean Architecture
Intro
Typescript + Clean architecture
:warning: This is still (and maybe will always be) under development! Any PR is greatly welcome!
This project tries to follow the rules of Uncle Bob's Clean Architecture.
Project structure
.
├── src
| ├── app - Enterprise business rules
| | ├── core - Core business rules
| | | ├── entities - Interfaces and classes that defines the app.
| | | └── definitions - Interfaces and classes complement the app.
| | └── {feat-name} - Business features
| ├── data - Interfaces adapters
| └── frameworks - Frameworks and drivers that exposes the app
└── build - Compiled javascript files
Install
-
Clone the project
-
Install dependencies:
- Using yarn
$ yarn install
- Using npm
$ npm install
Running
-
Running the script
This will run a single node script file and will execute pre-defined methods as an example.
- Using yarn
$ yarn start:script
- Using npm
$ npm run start:script
-
Running the Rest Server
This will start an express rest server at localhost:3000. You can use this example to consume endpoints.
- Using yarn
$ yarn start:api
- Using npm
$ npm run start:api
Executing tests
- Using yarn
$ yarn test
- Using npm
$ npm test