How danielrodriguez26/fe-events works
Project Type & Purpose
• Front-end single-page application for event management (“Mis Eventos”)
• Built with React + TypeScript + Tailwind CSS, following Clean (Hexagonal) Architecture
• Consumes a RESTful backend (VITE_API_URL) via HTTP (Axios)
Key Architectural Layers (to represent
a. Presentation Layer
• UI Components (src/components/, public/index.html)
• Pages & Layouts (src/application/pages/…, src/application/layout/Layout.tsx)
• Custom Hooks (presentation-focused) in src/application/hooks/
b. Application Layer
• Use-case orchestration via hooks (e.g., useEvents, useRegisterForm)
• Coordinates between UI and domain services
c. Domain Layer
• Business entities & interfaces (src/domain/*/*.interface.ts)
• Domain services (src/domain/*/*.service.ts) implementing business logic
d. Infrastructure Layer
• Router configuration (src/infrastructure/router/index.tsx)
• HTTP adapters and environment config (src/domain/settings/axios.config.ts, backend.config.ts, http.service.ts)
e. State Management
• Zustand stores in src/store/store.ts (slices: auth, events, sessions, speakers, etc.)
f. Utilities & Testing
• Utility modules (src/utils/) and test harness (jest.config.ts, src/__tests__/)
External & Deployment Components
• External REST API (hosted at VITE_API_URL)
• Build tools: Vite dev server, Docker image, Nginx web server
• CI/CD / Docker Compose (docker-compose.yml)
Relationships & Data Flows
• User Action → Presentation Components → Custom Hook (Application Layer)
• Hook invokes Domain Service → Domain Service calls HTTP Service (Infrastructure Layer)
• HTTP Service → External API → Response → Domain Service → Hook → Component (update UI)
• State updates stored in Zustand → UI subscribes to store slices → re‐render
Architectural Patterns & Principles
• Hexagonal/Clean Architecture: strict separation of concerns by layers
• “Ports & Adapters”: Domain services define interfaces, Infrastructure layer provides adapters (HTTP)
• Unidirectional data flow: UI → Hooks → Services → HTTP → API → Response → Store → UI
• Optimistic updates for sessions (Hook/Service pattern)
• Component reuse: atomic UI components in components/ui, higher-level composed components