Code Monkey home page Code Monkey logo

clean-architecture-posts's Introduction

clean-architecture-posts

clean architecture / hexagonal architecture - FrontEnd

License

Building project

You must have npm and node.js installed to continue...

    npm install

To run tests

    npm run test

To start Vanilla (Javascript native) app :

    npm run start:vanilla

To start React app :

    npm run start:react

To start Angular app :

    npm run start:angular

To build Vanilla (Javascript native) app for production :

    npm run build:vanilla

To build React app for production :

    npm run build:react

To build Angular app for production :

    npm run build:angular

Description project

This project was made to show hexagonal architecture power. It's a simple application which shows some posts... The user can read a post's details by clicking on a post's button read more...

Main application

Details posts

Hexagonal architecture

Thanks to the hexagonal architecture, we can focus only in the business logic of the application without knowing frameworks, libraries used. Indeed, what matter if it is a REST API or a GRAPHQL API or Cloud API (Firebase, Amazon...), the business logic will stay the same without change it. The philosophy stays the same with "tools frontal" like Angular, React, VueJS... If tomorrow, i want to switch React by Angular without change the business logic or the API layer, i can do it and easily ! This is the power of the hexagonal architecture. Moreover, thanks to the hexagonal architecture, you can focus easily on TDD and BDD (DDD too, i didn't use it in this project).

Some avantages :

  • The business logic is independent

  • Maintenance and Evolutions are easy to do

  • We can test without to worry about frameworks and infrastructures used

  • Dependency inversion used

Some cons :

  • Not practical for little application

Hexagonal architecture used by this project :

Architecture

Where can i change adapters around the business logic in the user application ?

  • Just change environment variable API to choose graphQL or rest API (API Layer)

  • Just run the script from package.json to choose the front application desired (react, vanilla, angular)

Resources

https://www.amazon.fr/Clean-Architecture-Robert-Martin-2016-12-10/dp/B01N2GDUQ9

https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html

https://herbertograca.com/2017/11/16/explicit-architecture-01-ddd-hexagonal-onion-clean-cqrs-how-i-put-it-all-together/

clean-architecture-posts's People

Contributors

sunnybeach1337 avatar

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.