Skip to content

codescouts-academy/react-clean-architecture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CodeScouts

Clean architecture template for react and vite πŸš€

React Clean Architecture Template πŸ—οΈ

Stars are welcome 😊 Report an error πŸ› Contact us πŸ€”

view - Documentation

maintained - yes contributions - welcome Clean - Architecture

πŸš€ Getting started

⬇️ Template downloading

npx degit codescouts-academy/react-clean-architecture my-app

πŸ‚ Install dependencies

npm i

🏁 Start

npm run dev

πŸ₯‹ Dependencies

  • πŸ§ͺ codescouts/test -> Jest & Vite mocking library easy to use
  • πŸ’‰ codescouts/di -> agnostic ependency injection container
  • ⚑️ codescouts/events -> agnostic library to create and handle domain events
  • πŸ›Ÿ codescouts/store -> reactive store to allow update ui from domain
  • πŸ‘©β€πŸ’» codescouts/ui -> components for events and di only for react

πŸ‘©β€πŸ’» Project explanation

πŸ“ Recommended folder structure


public/
β”œβ”€β”€ favicon.png --> CodeScouts's logo
β”‚
src/
β”œβ”€β”€ application/ Our use cases
β”‚   β”œβ”€β”€ add-log-user-case.test --> add-log-use-case tests
β”‚   └── add-log-use-case.ts --> Here we model the use cases
β”œβ”€β”€ domain/ Our Business logic
β”‚   β”œβ”€β”€ events --> Here we model the domain events
β”‚   β”œβ”€β”€ model --> Here we model our business logic
β”‚   └── services --> Here exists the domain services (only abstractions)
β”‚
β”œβ”€β”€ infrastructure/ Our external services implementations
β”‚   └── services
β”‚       └── LoggerService.ts
β”‚
β”œβ”€β”€ ui/ React things
β”‚   β”œβ”€β”€ components/ --> stateless components
β”‚   └── pages/
β”‚       └── home/
β”‚           β”œβ”€β”€ Home.tsx --> Page component (View)
β”‚           └── useHomeViewModel.ts --> Home UI business logic (ViewModel)
β”‚
β”œβ”€β”€ App.tsx
β”œβ”€β”€ di.ts --> Dependency injection configuration
└── main.tsx --> Main component loaded, referenced in index.html

πŸ€” Contributing

If you find any mistake, you think there are things to improve or simply want to contribute, you are welcome. Just make a fork and send us your PR πŸ™.

LICENSE

Released under MIT by @codescouts-academy.