This is an implementaion of back end API using clean architecture approach.
- Using Clean Architecture Implementation in NodeJS
- Requirements
- Dependencies
- Configuration
- Running the Application
- Testing
- Clean Architecture Elements
- References
- NodeJS (v.14.7.0)
- PostgreSQL
-
Install dependencies using
npm install -
Setup appropriate database migrations using
npm run migrate:latest
Modify the .env to configure the app. here is the list of configurable options
| Name | Description |
|---|---|
| HOST | hostname |
| PORT | port number to listen |
| PG_DATABASE | database name |
| PG_USER | database username |
| PG_PASS | database password |
| ACCESS_TOKEN_KEY | key for access token |
| ACCESS_TOKEN_AGE | expiration time for key in seconds |
| REFRESH_TOKEN_KEY | key for refresh token |
Run the application using npm start
- Test the app using command line version of postman using
npm test:postmanor use Postman App - Unit testing using jest via
npm run test:unit - Integration testing using jest via
npm run test:integration - Testing and coverage using jest via
npm test
- hapijs (server.js)
- postgresql (db.js)
- repository (db queries)
- winston (logger.js)
- http handlers
- repl
As listed in use-cases folder
As listed in entities folder