Skip to content

mohhasbias/dicoding-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Using Clean Architecture Implementation in NodeJS

Node.js CI

This is an implementaion of back end API using clean architecture approach.

Requirements

  1. NodeJS (v.14.7.0)
  2. PostgreSQL

Dependencies

  • Install dependencies using npm install

  • Setup appropriate database migrations using npm run migrate:latest

Configuration

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

Running the Application

Run the application using npm start

Testing

  • Test the app using command line version of postman using npm test:postman or 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

Clean Architecture Elements

Infrastructures

  • hapijs (server.js)
  • postgresql (db.js)
    • repository (db queries)
  • winston (logger.js)

Interfaces

  • http handlers
  • repl

Use Cases

As listed in use-cases folder

Entities

As listed in entities folder

References

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 2

  •  
  •