How emersonbraun/react-clean-arch works
This React application lets a user view and edit a profile, inspect membership features, list users, and request an eligible premium upgrade. The profile page is the documented entry point; hooks resolve use cases through the container, which wires application operations to a repository and analytics service. Domain entities enforce user rules, while use cases produce profile data and perform updates/upgrades. The repository implementation is an in-memory, Faker-seeded store despite its Http name. Edges reflect shown source references and explicit README capabilities; unsampled feature internals are represented at their exact directories.
Main entry points: container.ts DI container · hooks Profile hooks · GetUserProfile.ts View profile · UpgradeMembership.ts Upgrade membership
Components 20
Presentation
- App shell
src/App.tsx - Profile page
src/ui/pages/UserProfilePage.tsx - Profile hooks
src/ui/hooks - Edit form
src/ui/components/UserProfile/EditProfileForm.tsx - Membership UI
src/ui/components/UserProfile - Form validation
src/ui/hooks/useFormValidation.ts - Container provider
src/ui/providers/ContainerProvider.tsx
Application
- View profile
src/application/use-cases/GetUserProfile.ts - List users
src/application/use-cases/ListUsers.ts - Update profile
src/application/use-cases/UpdateUserProfile.ts - Upgrade membership
src/application/use-cases/UpgradeMembership.ts - Profile DTO
src/application/dto/UserProfileDto.ts - Validation service
src/application/services/FormValidationService.ts
Domain
- User rules
src/domain/entities/User.ts - Profile validation
src/domain/entities/UserProfileValidation.ts - User repository contract
src/domain/repositories/UserRepository.ts
Infrastructure
- DI container
src/infrastructure/config/container.ts - User store
src/infrastructure/repositories/HttpUserRepository.ts - Analytics service
src/infrastructure/services/AnalyticsService.ts
Other components
- End user
Connections 33
- End user → App shell: uses
src/App.tsx - App shell → Profile page: renders
src/App.tsx - App shell → Container provider: provides
src/App.tsx - Profile page → Profile hooks: uses
src/ui/pages/UserProfilePage.tsx - Profile page → Edit form: renders
src/ui/pages/UserProfilePage.tsx - Profile page → Membership UI: renders
src/ui/pages/UserProfilePage.tsx - Edit form → Form validation: validates with
src/ui/components/UserProfile/EditProfileForm.tsx - Form validation → Validation service: delegates to
src/ui/hooks/useFormValidation.ts - Profile hooks → Container provider: resolves through
src/ui/hooks/useUserProfile.ts - Profile hooks → View profile: executes
src/ui/hooks/useUserProfile.ts - Profile hooks → List users: executes
src/ui/hooks/useListUsers.ts - Profile hooks → Update profile: executes
src/ui/hooks/useUpdateUserProfile.ts - Profile hooks → Upgrade membership: executes
src/ui/hooks/useUpgradeMembership.ts - Container provider → DI container: exposes
src/ui/providers/ContainerProvider.tsx - DI container → View profile: registers
src/infrastructure/config/container.ts - DI container → List users: registers
src/infrastructure/config/container.ts - DI container → Update profile: registers
src/infrastructure/config/container.ts - DI container → Upgrade membership: registers
src/infrastructure/config/container.ts - DI container → User store: registers
src/infrastructure/config/container.ts - DI container → Analytics service: registers
src/infrastructure/config/container.ts - View profile → User repository contract: reads
src/application/use-cases/GetUserProfile.ts - List users → User repository contract: queries
src/application/use-cases/ListUsers.ts - Update profile → User repository contract: reads and saves
src/application/use-cases/UpdateUserProfile.ts - Upgrade membership → User repository contract: reads and saves
src/application/use-cases/UpgradeMembership.ts - User store → User repository contract: implements
src/infrastructure/repositories/HttpUserRepository.ts - User store → User rules: creates
src/infrastructure/repositories/HttpUserRepository.ts - View profile → Profile DTO: returns
src/application/use-cases/GetUserProfile.ts - View profile → User rules: derives profile from
src/application/use-cases/GetUserProfile.ts - Update profile → User rules: constructs
src/application/use-cases/UpdateUserProfile.ts - Upgrade membership → User rules: checks and constructs
src/application/use-cases/UpgradeMembership.ts - Validation service → Profile validation: uses rules
src/application/services/FormValidationService.ts - View profile → Analytics service: tracks events
src/application/use-cases/GetUserProfile.ts - Upgrade membership → Analytics service: tracks events
src/application/use-cases/UpgradeMembership.ts