Code Monkey home page Code Monkey logo

nodejs-clean's Introduction

Node.js + Express.js + Clean Architecture

This is the spike code to architect node.js, express.js using clean architecture.

Architecture Overview

This project's architecture is based on Uncle Bob's The Clean Architecture. Please at least skim through his blog as you will have a better understanding of how it works.

We are separated this application into 4 different layers

  1. Domains (highest)
  2. Use cases
  3. Interfaces
  4. Infrastructure (lowest)

The gist of it is a separation of concerns. Outer layer (lower) can reference (or know) the inner (highest) layer, however, the inner layers can not know about outer layer. We accomplished this by using Dependency Injection and Duck Typing since Javascript doesn't have the concept of Interface.

(highest)                                    (lowest, most detail implementation)
domains ---> user cases ---> interfaces ---> infrastructure

Run the server

$ npm install
$ NODE_ENV=development node server.js

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.