A minimal sample that demonstrates Clean Reactive Architecture implemented in a single React component.
All architectural units — gateway interface, gateway implementations, entities,
presenter, controller, and user interface — live in
src/App.tsx with inline comments identifying each unit. The
intent is to show the architecture clearly, without the file structure of a full
project getting in the way.
Install dependencies:
npm ciStart the development server:
npm run devThe table below shows how each unit from the Clean Reactive Architecture diagram
maps to App.tsx.
| Architectural unit | Implementation |
|---|---|
| Entities | count (useState) |
| Presenter | countValue, countStatus |
| Controller | onIncrementButtonClick, onDecrementButtonClick, onAppMount |
| User interface | JSX returned from App |