This is an idea sample code based on the React Clean Architecture sample code written earlier. (react-with-clean-architecture) It's still not enough, but it's actually the structure i'm using for the project, and i'm trying to improve it with better ideas little by little.
if you leave an issue or a pull request, we will reflect the insufficient part or improvement.
Typescript, Webpack, React, Recoil, Emotion
in simple diagram, it is as above.
In the infrastructure layer, the medium for communication with the outside is abstracted.
In the repository layer, you select an external element to request the necessary data and configure the data type required for the request.
In the presenter layer, the data received from the outside is converted to the View Model.
The UI layer manages the global and component state, and outputs views.
./src
├─ constants
├─ adapters
│ ├─ infrastructures
│ │ └─ interfaces
│ ├─ repositories
│ │ └─ interfaces
│ ├─ presenters
│ │ ├─ interfaces
│ │ └─ converter-interfaces
│ ├─ dto
│ └─ vm
├─ services
│ └─ converters
├─ di
└─ ui
├─ components
│ └─ ...
└─ hooks
└─ ...
# ./mock-server
$ npm install
# ./mock-server
$ npm start
# ./
$ npm install
# ./
$ npm start
v1.1.1 - ChangeLog