All Projects β†’ falsy β†’ React With Clean Architecture

falsy / React With Clean Architecture

Clean architecture based react project sample code.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to React With Clean Architecture

Dev Stuff
😎 Programming stuff for everyone. Collection of articles, videos about architecture, Domain Driven Design, microservices, testing etc.
Stars: ✭ 105 (-20.45%)
Mutual labels:  clean-architecture
Deptrac
Keep your architecture clean.
Stars: ✭ 1,784 (+1251.52%)
Mutual labels:  clean-architecture
Go Bank Transfer
Simple API for banking routines using a Clean Architecture in Golang. πŸ’³ πŸ’° πŸ’Έ
Stars: ✭ 123 (-6.82%)
Mutual labels:  clean-architecture
Android Kotlin Clean Architecture
Android Sample Clean Architecture App written in Kotlin
Stars: ✭ 1,562 (+1083.33%)
Mutual labels:  clean-architecture
Todo
βœ… Commad-Line Task management with storage on your GitHub πŸ”₯
Stars: ✭ 111 (-15.91%)
Mutual labels:  clean-architecture
Ddd On Scala
DDD sample implementation by Scala.
Stars: ✭ 113 (-14.39%)
Mutual labels:  clean-architecture
Clean Architecture
A (work-in-progress) guide to the methodology behind Made Tech Flavoured Clean Architecture
Stars: ✭ 101 (-23.48%)
Mutual labels:  clean-architecture
Swift Cleanarchitecture
Simple Swift project applying concepts inspired on the Clean Architecture
Stars: ✭ 133 (+0.76%)
Mutual labels:  clean-architecture
Nim Basolato
An asynchronous fullstack web framework for Nim.
Stars: ✭ 111 (-15.91%)
Mutual labels:  clean-architecture
Episodie
Episodie is a TV show time tracker app with unusual design written in kotlin and clean architecture approach. Get to know how much time you spent watching tv shows.
Stars: ✭ 125 (-5.3%)
Mutual labels:  clean-architecture
Polysemycleanarchitecture
Showcasing how the Polysemy library can be used to implement a REST application conforming to the guidelines of the Clean Architecture model.
Stars: ✭ 106 (-19.7%)
Mutual labels:  clean-architecture
Clean Flutter
This repo is a small explanation of clean architecture on with flutter framework and some test where added
Stars: ✭ 108 (-18.18%)
Mutual labels:  clean-architecture
Movieapp Clean Architecture
Learning Project (Movie App) For Applying Android Architecture Components And Clean Architecture Using MVVM With Kotlin
Stars: ✭ 123 (-6.82%)
Mutual labels:  clean-architecture
Android Kotlin Mvp Clean Architecture
Clean architecture blueprint using Kotlin and MVP pattern.
Stars: ✭ 105 (-20.45%)
Mutual labels:  clean-architecture
Modular App Core
Core implementations for a modular Android App
Stars: ✭ 127 (-3.79%)
Mutual labels:  clean-architecture
Clean Arch Pokemon
Clean Architecture de um modo divertido e prΓ‘tico integrando uma API com uma API de PokΓ©mon.
Stars: ✭ 103 (-21.97%)
Mutual labels:  clean-architecture
Rxviper
Android micro framework for developing apps based on clean VIPER architecture.
Stars: ✭ 112 (-15.15%)
Mutual labels:  clean-architecture
Eve
Eve and Wall-e
Stars: ✭ 133 (+0.76%)
Mutual labels:  clean-architecture
Propertyfindar
🏘 πŸŽƒ Real Estate Sample App with RxJava3+Coroutines Flow, Dynamic Feature Modules, Dagger Hilt, Offline First, ConcatAdapter, Animations and tests for Room, Retrofit, useCase and ViewModels with TDD.
Stars: ✭ 133 (+0.76%)
Mutual labels:  clean-architecture
Federatedandroidtrainer
See new version https://github.com/mccorby/PhotoLabeller
Stars: ✭ 123 (-6.82%)
Mutual labels:  clean-architecture

Sample code of React with Clean architecture

This project is a small idea sample code to introduce a Clean Architecture to a web service or to use a Redux Architecture and a Clean Architecture together.

if you leave an issue or a pull request, we will reflect the insufficient part or improvement. ☺️
(+ i am not good at English.)

Language

πŸ‡°πŸ‡· πŸ‡ΊπŸ‡²

Use Stack

Typescript, Webpack, React, React-Native, Redux, Styled-Components

Clean Architecture

Alt Clean architecture As with various architectures, the primary purpose of a clean architecture is to separate concerns. Divide the hierarchy according to each interest, design domain-centric rather than detailed implementation, and make sure that the internal area does not depend on external elements such as the framework or database UI.

  • Distinguish between detailed implementation areas and domain areas.
  • Architecture does not depend on the framework.
  • The outer zone can depend on the inner zone, but the inner zone cannot depend on the outer zone.
  • Both high-level and low-level modules rely on abstraction..

Communitaction Flow

Alt Communitaction Flow in simple diagram, it is as above.

Session

After the user logs in, the issued authentication token is stored and used in the web storage. web storage is accessible globally, but the sample code follows the flow above and is controlled by 'Storege' in 'Infrastructures'. this is part of a detailed implementation that can change, and is positioned according to its role to improve maintenance.

Board

Board posts and comments are fetched through http communication from 'Infrastructures', encapsulated as Board Root Entity including Comment Entity in 'Use Case' and delivered to 'Presenter', and 'Presenter' returns 'Action' with Entity data.
In 'View', the Action value is dispatched according to the flow of Redux architecture, and the Dispatcher updates the Store value to notify that it is changed. In View, the 'Entity' value of the Store is re-encapsulated as 'View Model' and is based on the 'View Model' value. Draw a view.

Inversion of Control

Alt Communitaction Flow In the case of 'Repository', it is an adapter layer, so you should not know about 'Repository' in 'Use Case'. Therefore, in 'Use Case', it is implemented through the Repository Interface located in the domain layer, which is then operated through Dependency Injection.
The Action Interface of 'Presenter' is also the same.

Directory Structure

./src
β”œβ”€ adapters
β”‚  β”œβ”€ infrastructures
β”‚  β”‚  └─ interfaces
β”‚  β”œβ”€ presenters
β”‚  β”‚  β”œβ”€ interfaces
β”‚  β”‚  └─ action-interfaces
β”‚  └─ repositories
β”œβ”€ domains
β”‚  β”œβ”€ aggregates
β”‚  β”‚  └─ interfaces
β”‚  β”œβ”€ entities
β”‚  β”‚  └─ interfaces
β”‚  β”œβ”€ useCases
β”‚  β”‚  β”œβ”€ interfaces
β”‚  β”‚  └─ repository-interfaces
β”‚  └─ dto
└─ frameworks
   β”œβ”€ web
   β”‚  β”œβ”€ di
   β”‚  β”œβ”€ components
   β”‚  β”œβ”€ redux
   β”‚  β”‚  β”œβ”€ interfaces
   β”‚  β”‚  β”œβ”€ actions
   β”‚  β”‚  β”œβ”€ reducers
   β”‚  β”‚  └─ store
   β”‚  └─ vm
   └─ mobile(React Native)
      β”œβ”€ android
      β”œβ”€ ios
      β”œβ”€ di
      β”œβ”€ components
      β”œβ”€ redux
      β”‚  β”œβ”€ interfaces
      β”‚  β”œβ”€ actions
      β”‚  β”œβ”€ reducers
      β”‚  └─ store
      └─ vm
  • The basic directory is organized based on layers of clean architecture.
    [ frameworks / adapters / domains(useCases / entities) ]
  • The component's directory structure is freely structured in the form promised between services or members.

Screenshots

Alt Screenshot 1 Alt Screenshot 2

Alias

Web

tsconfig.json

/src/frameworks/web/tsconfing.json

{
  "compilerOptions": {
    //...
    "baseUrl": ".",
    "paths": {
      "@adapters/*": ["../../adapters/*"],
      "@domains/*": ["../../domains/*"],
      "@frameworks/*": ["../../frameworks/*"],
      "@di": ["./di/index.ts"]
    }
  },
}

webpack.config.js

/src/frameworks/web/webpack.config.js

{
  //...
  resolve: {
    extensions: [".tsx", ".ts", ".js"],
    alias: { 
      "@adapters": path.resolve(__dirname, "../../adapters/"),
      "@domains": path.resolve(__dirname, "../../domains/"),
      "@frameworks": path.resolve(__dirname, "../../frameworks/"),
      "@di": path.resolve(__dirname, "./di/index.ts")
    }
  },
}

Mobile

tsconfig.json

/src/frameworks/mobile/tsconfing.json

{
  "compilerOptions": {
    //...
    "baseUrl": ".",
    "paths": {
      "@adapters/*": ["../../adapters/*"],
      "@domains/*": ["../../domains/*"],
      "@frameworks/*": ["../../frameworks/*"],
      "@di": ["./di/index.ts"]
    }
  },
}

metro.config.js

/src/frameworks/mobile/metro.config.js

const path = require('path')
const extraNodeModules = {
  '@adapters': path.resolve(__dirname + './../../adapters'),
  '@domains': path.resolve(__dirname + './../../domains'),
  '@frameworks': path.resolve(__dirname + './../../frameworks'),
}
const watchFolders = [
  path.resolve(__dirname + './../../adapters'),
  path.resolve(__dirname + './../../domains'),
  path.resolve(__dirname + './../../frameworks'),
]

module.exports = {
  //...
  resolver: {
    extraNodeModules: new Proxy(extraNodeModules, {
      get: (target, name) =>
        name in target ? target[name] : path.join(process.cwd(), `node_modules/${name}`),
    }),
  },
  watchFolders,
}

Run Project

1. Mock Server

Install

# $ cd /mock-server
$ npm install

Start

# $ cd /mock-server
$ npm start

2-1. Web

Install

# $ cd /src/frameworks/web
$ npm install

Start

# $ cd /src/frameworks/web
$ npm start

2-2. Mobile(ios)

Install

# $ cd /src/frameworks/mobile
$ npm install

# $ cd /src/frameworks/mobile/ios
$ pod install

Start

# $ cd /src/frameworks/mobile
$ npx react-native run-ios

Version

v1.8.1 - ChangeLog

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].