All Projects β†’ rasouza β†’ Node Clean Architecture

rasouza / Node Clean Architecture

Clean Architecture implementation written in NodeJS

Projects that are alternatives of or similar to Node Clean Architecture

Systemizer
A system design tool that allows you to simulate data flow of distributed systems.
Stars: ✭ 1,219 (+1547.3%)
Mutual labels:  backend, architecture
Cake Slayer
🍰πŸ”ͺ Architecture of Haskell backend applications
Stars: ✭ 92 (+24.32%)
Mutual labels:  architecture, backend
Web Skills
A visual overview of useful skills to learn as a web developer
Stars: ✭ 5,107 (+6801.35%)
Mutual labels:  architecture, backend
Software Engineer Interview Questions
A lot of questions and links to prepare yourself for an interview.
Stars: ✭ 176 (+137.84%)
Mutual labels:  architecture, backend
Awesome Scalability
The Patterns of Scalable, Reliable, and Performant Large-Scale Systems
Stars: ✭ 36,688 (+49478.38%)
Mutual labels:  architecture, backend
Porto
Porto is a Modern Software Architectural Pattern that scales with your business!
Stars: ✭ 1,106 (+1394.59%)
Mutual labels:  architecture
Graphql Microservices
Showcasing a graphql microservice setup
Stars: ✭ 68 (-8.11%)
Mutual labels:  backend
Gaia
C++ framework for rapid server development
Stars: ✭ 58 (-21.62%)
Mutual labels:  backend
Node Javascript Ecommerce
Build ECommece Like Amazona Using Vanilla JS
Stars: ✭ 57 (-22.97%)
Mutual labels:  backend
Devis
A microservices framework for Node.js
Stars: ✭ 72 (-2.7%)
Mutual labels:  architecture
Xadmin
😘 admin system based on Laravel5.3
Stars: ✭ 70 (-5.41%)
Mutual labels:  backend
Elm Street
🌳 Crossing the road between Haskell and Elm
Stars: ✭ 65 (-12.16%)
Mutual labels:  backend
Layr
Dramatically simplify full‑stack development
Stars: ✭ 1,111 (+1401.35%)
Mutual labels:  backend
Kotlincleanarchitecture
Approach to Clean Architecture in Kotlin
Stars: ✭ 68 (-8.11%)
Mutual labels:  architecture
Danf
Danf is a Node.js full-stack isomorphic OOP framework allowing to code the same way on both client and server sides. It helps you to make deep architectures and handle asynchronous flows in order to help in producing scalable, maintainable, testable and performant applications.
Stars: ✭ 58 (-21.62%)
Mutual labels:  architecture
Vos backend
vangav open source - backend; a backend generator (generates more than 90% of the code needed for big scale backend services)
Stars: ✭ 71 (-4.05%)
Mutual labels:  backend
Vipera
Project is now called Swift template, check the link ➑️
Stars: ✭ 57 (-22.97%)
Mutual labels:  architecture
Dev Practice
Practice your skills with these ideas.
Stars: ✭ 1,127 (+1422.97%)
Mutual labels:  backend
Patterns
Complete catalog of all classical patterns in the Archimate language
Stars: ✭ 70 (-5.41%)
Mutual labels:  architecture
Nebula Css
πŸ’« ITCSS and BEM based Sass/CSS toolkit; extensible & scalable to any project size
Stars: ✭ 62 (-16.22%)
Mutual labels:  architecture

Code Coverage

Node Clean Architecture

Preview

Table of Contents

This backend implements a RESTful CRUD interface for users and complies with Eric Evan's DDD and Uncle Bob's Clean Architecture which is briefly explained here in the document.

It also exposes a /docs/ endpoint for further reference and /coverage/ for test coverage.

Libs

Installation

docker-compose up -d
cp .env.example .env
npm start

You should get

restify listening at http://[::]:8080
connected to MongoDB database!

Access http://localhost:8080/docs/ and http://localhost:8080/coverage/

Testing

npm test

It uses an in-memory DB to run tests so you don't need to have mongodb up and running

Clean Architecture

Cleab Architecture

Folder structure



β”” application                   β†’ Application services layer
    β”” use_cases                 β†’ Application business rules 
β”” domain                        β†’ Enterprise core business layer such as domain model objects (Aggregates, Entities, Value Objects) and repository interfaces
β”” infrastructure                β†’ Frameworks, drivers and tools such as Database, the Web Framework, mailing/logging/glue code etc.
    β”” config                    β†’ Application configuration files, modules and services
        β”” container.js          β†’ Module that manage service implementations by environment
    β”” database                  β†’ Database ORMs middleware
        β”” schemas               β†’ Mongoose schemas
    β”” repositories              β†’ Implementation of domain repository interfaces
    β”” webserver                 β†’ Restify Web server configuration (server, routes, plugins, etc.)
        β”” server.js             β†’ Restify server definition
β”” ports/http                    β†’ Adapters and formatters for use cases and entities to external agency such as Database or the Web
    β”” UserController.js         β†’ Restify route handlers
    β”” routes.js                 β†’ Restify route definitions
    β”” errors.js                 β†’ Standard errors for the whole application
 β”” index.js                     β†’ Main application entry point

The Dependency Rule

The overriding rule that makes this architecture work is The Dependency Rule. This rule says that source code dependencies can only point inwards. Nothing in an inner circle can know anything at all about something in an outer circle. In particular, the name of something declared in an outer circle must not be mentioned by the code in the an inner circle. That includes, functions, classes. variables, or any other named software entity.

Extracted from https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html#the-dependency-rule

Typical Request

Request

Troubleshooting

Log connected to MongoDB database! doesn't appear

The backend uses its own database (users) to run its business logic, so you need to ensure this database is created with proper user credentials. The script mongo-init.js is run when docker-compose up runs for the first time.

Check in docker-compose logs mongo to see if something unusual is happening

I'm getting EADDRINUSE upon application start

You need port 8080 to be free in order to boot up the application. Check if it's already in use and shut the application down before you npm start again

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].