Skip to content

Modular Monolith, The result of my research about software architecture

Notifications You must be signed in to change notification settings

gustialfian/nodejs-modular-monolith

Repository files navigation

Nodejs Modular Monolith

Getting Started

npm install

cp .env.example .env

docker run --name db --rm \
  -e POSTGRES_PASSWORD=sandbox \
  -e POSTGRES_USER=sandbox \
  -e POSTGRES_DB=sandbox \
  -p 6543:5432 \
  postgres:13-alpine

# manualy run schema

npm run dev

production

npm install -g pm2

pm2 start ecosystem.config.js
pm2 restart ecosystem.config.js
pm2 stop ecosystem.config.js
pm2 delete ecosystem.config.js

Component

  • domain module: modul yang berhubungan dengan bisnis proses
    • controller: melakukan request, response, validation
    • service: bisnis logic.
    • repository: satu2nya component yang secara langsung mengakses DB
    • plain function
    • plain object
  • shared module
    • plain function
    • plain object
    • constant
  • infastructure module
    • configs
    • database
    • logger
  • router.js: list route
  • server.js: bootstraping all module
  • app.js: entry point

About

Modular Monolith, The result of my research about software architecture

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published