# edwinballestero/proyectofinalisw architecture

> Architecture diagram of the GitHub repository edwinballestero/proyectofinalisw, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/edwinballestero/proyectofinalisw
- Repository: https://github.com/edwinballestero/proyectofinalisw

## Overview

#### Purpose and Topology
This is an event-management system split into a React/Vite single-page client and a Node.js/TypeScript REST API. It supports event discovery, event creation/detail views, categories, tags, organizers, users/roles, registrations and registration statuses, plus event images.

- Client bootstrap: `app/src/main.jsx`, `app/src/App.jsx`
- API bootstrap: `api/src/server.ts`, `api/src/routes/routes.ts`

#### Frontend Application Shell
The Vite React application composes page-level event and registration workflows from reusable components and UI primitives. Routing and top-level application composition originate in `app/src/App.jsx`; common navigation and page framing are in `app/src/components/Navbar.jsx` and `app/src/components/PageHeader.jsx`.

Primary user-facing screens:
- Event browsing/detail/creation: `app/src/pages/EventsPage.jsx`, `app/src/pages/EventDetailPage.jsx`, `app/src/pages/CreateEventPage.jsx`
- Registration workflow: `app/src/pages/Registration/RegistrationPage.jsx`, `app/src/pages/Registration/CreateRegistration.jsx`

#### Frontend Data Boundary
Client service modules isolate API or browser-storage access from page/components. Event-related views use event, category, organizer, and tag services, while registration pages use a dedicated registration service.

- Event access: `app/src/services/eventsService.js`, `app/src/services/eventsData.js`
- Reference data: `app/src/services/categoriesService.js`, `app/src/services/organizersService.js`, `app/src/services/tagsService.js`
- Registration and local storage boundary: `app/src/services/registrationsService.js`, `app/src/services/storageService.js`

Forms validate event input through `app/src/schemas/eventSchema.js` and render via `app/src/components/EventForm.jsx`.

#### API Request Pipeline
The API exposes resource-specific Express route modules, aggregated at the central route registration point. Requests flow from routes to controllers, then domain services; async/error, authentication, validation, and image configuration are cross-cutting middleware boundaries.

- Routing: `api/src/routes/routes.ts`, `api/src/routes/event.routes.ts`, `api/src/routes/registration.routes.ts`
- Middleware: `api/src/middlewares/auth.middleware.ts`, `api/src/middlewares/validate-request.middleware.ts`, `api/src/middlewares/error.middleware.ts`
- Shared API errors/responses: `api/src/utils/app-error.ts`, `api/src/utils/http-response.ts`

#### Event Catalog and Media Domain
Events are the central aggregate, associated with categories, tags, organizers, registrations, and images. The event controller/service pair owns event operations, while separate resource layers manage its classification and media concerns.

- Events: `api/src/controllers/event.controller.ts`, `api/src/services/event.service.ts`
- Categories and tags: `api/src/controllers/category.controller.ts`, `api/src/services/categoria.service.ts`, `api/src/services/tag.service.ts`
- Images and cleanup: `api/src/controllers/image.controller.ts`, `api/src/services/image.service.ts`, `api/src/config/delete-event-images.ts`

#### Registration and Identity Domain
Registration is independently modeled with a status resource. User, role, and organizer resources provide identity/ownership relationships used by the event workflow.

- Registrations: `api/src/controllers/registration.controller.ts`, `api/src/services/registration.service.ts`
- Registration statuses: `api/src/controllers/registration-status.controller.ts`, `api/src/services/registrationStatus.service.ts`
- Users, roles, organizers: `api/src/services/user.service.ts`, `api/src/services/userRole.service.ts`, `api/src/services/organizer.service.ts`

#### Persistence and Runtime Infrastructure
The API runs on Node.js with TypeScript and uses Prisma as its persistence boundary. The schema, migrations, and seed script define and initialize the relational data model; Prisma client configuration is centralized for services.

- Data model/migrations: `api/prisma/schema.prisma`, `api/prisma/migrations`
- Database client and initialization data: `api/src/config/prisma.ts`, `api/prisma/seed.ts`
- API operational services: Swagger setup and logging in `api/src/config/swagger.ts`, `api/src/config/logger.ts`

The frontend runs through Vite, configured at `app/vite.config.js`; the backend runtime and dependency contract are in `api/package.json`.

Main entry points: [`api/src/config/prisma.ts`](https://github.com/edwinballestero/proyectofinalisw/blob/main/api/src/config/prisma.ts) (Prisma Client), [`api/src/controllers/event.controller.ts`](https://github.com/edwinballestero/proyectofinalisw/blob/main/api/src/controllers/event.controller.ts) (Event Catalog Domain), [`app/src/App.jsx`](https://github.com/edwinballestero/proyectofinalisw/blob/main/app/src/App.jsx) (App Shell & Routing), [`app/src/pages/EventsPage.jsx`](https://github.com/edwinballestero/proyectofinalisw/blob/main/app/src/pages/EventsPage.jsx) (Event Screens)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["React Client"]
  node_client_bootstrap["Client Bootstrap<br/>React/Vite entry<br/>[main.jsx]"]
  node_app_shell["App Shell &amp; Routing<br/>React composition<br/>[App.jsx]"]
  node_event_pages["Event Screens<br/>page workflows<br/>[EventsPage.jsx]"]
  node_registration_pages["Registration Screens<br/>page workflows"]
  node_event_form["Event Form Validation<br/>form and schema<br/>[EventForm.jsx]"]
  node_client_services["Client Data Services<br/>API/storage boundary<br/>[eventsService.js]"]
end

subgraph group_api["Node.js API"]
  node_api_server["API Server<br/>Express bootstrap<br/>[server.ts]"]
  node_route_registry["Route Registry<br/>Express routing<br/>[routes.ts]"]
  node_resource_routes["Resource Routes<br/>Express route modules<br/>[event.routes.ts]"]
  node_middleware["Request Middleware<br/>cross-cutting pipeline<br/>[auth.middleware.ts]"]
  node_event_domain["Event Catalog Domain<br/>controller and service"]
  node_registration_domain["Registration Domain<br/>controller and service"]
  node_identity_domain["Identity &amp; Ownership<br/>domain services<br/>[user.service.ts]"]
  node_media_domain["Image Media Domain<br/>controller and service"]
  node_api_operations["API Operations<br/>Swagger and logging<br/>[swagger.ts]"]
end

subgraph group_data["Persistence"]
  node_prisma_client["Prisma Client<br/>persistence adapter<br/>[prisma.ts]"]
  node_relational_model[("Relational Data Model<br/>Prisma schema<br/>[schema.prisma]")]
  node_seed_data["Seed Data<br/>database initialization<br/>[seed.ts]"]
end

node_client_bootstrap -->|"mounts"| node_app_shell
node_app_shell -->|"routes to"| node_event_pages
node_app_shell -->|"routes to"| node_registration_pages
node_event_pages -->|"uses"| node_event_form
node_event_pages -->|"loads and saves"| node_client_services
node_registration_pages -->|"uses registrations"| node_client_services
node_client_services -->|"REST requests"| node_api_server
node_api_server -->|"registers"| node_route_registry
node_route_registry -->|"aggregates"| node_resource_routes
node_resource_routes -->|"passes through"| node_middleware
node_middleware -->|"event requests"| node_event_domain
node_middleware -->|"registration requests"| node_registration_domain
node_event_domain -->|"uses organizers"| node_identity_domain
node_event_domain -->|"manages images"| node_media_domain
node_registration_domain -->|"relates users"| node_identity_domain
node_event_domain -->|"persists through"| node_prisma_client
node_registration_domain -->|"persists through"| node_prisma_client
node_identity_domain -->|"persists through"| node_prisma_client
node_media_domain -->|"persists through"| node_prisma_client
node_prisma_client -->|"implements"| node_relational_model
node_seed_data -->|"initializes"| node_relational_model
node_api_server -.->|"uses"| node_api_operations

click node_client_bootstrap "https://github.com/edwinballestero/proyectofinalisw/blob/main/app/src/main.jsx"
click node_app_shell "https://github.com/edwinballestero/proyectofinalisw/blob/main/app/src/App.jsx"
click node_event_pages "https://github.com/edwinballestero/proyectofinalisw/blob/main/app/src/pages/EventsPage.jsx"
click node_registration_pages "https://github.com/edwinballestero/proyectofinalisw/blob/main/app/src/pages/Registration/RegistrationPage.jsx"
click node_event_form "https://github.com/edwinballestero/proyectofinalisw/blob/main/app/src/components/EventForm.jsx"
click node_client_services "https://github.com/edwinballestero/proyectofinalisw/blob/main/app/src/services/eventsService.js"
click node_api_server "https://github.com/edwinballestero/proyectofinalisw/blob/main/api/src/server.ts"
click node_route_registry "https://github.com/edwinballestero/proyectofinalisw/blob/main/api/src/routes/routes.ts"
click node_resource_routes "https://github.com/edwinballestero/proyectofinalisw/blob/main/api/src/routes/event.routes.ts"
click node_middleware "https://github.com/edwinballestero/proyectofinalisw/blob/main/api/src/middlewares/auth.middleware.ts"
click node_event_domain "https://github.com/edwinballestero/proyectofinalisw/blob/main/api/src/controllers/event.controller.ts"
click node_registration_domain "https://github.com/edwinballestero/proyectofinalisw/blob/main/api/src/controllers/registration.controller.ts"
click node_identity_domain "https://github.com/edwinballestero/proyectofinalisw/blob/main/api/src/services/user.service.ts"
click node_media_domain "https://github.com/edwinballestero/proyectofinalisw/blob/main/api/src/controllers/image.controller.ts"
click node_prisma_client "https://github.com/edwinballestero/proyectofinalisw/blob/main/api/src/config/prisma.ts"
click node_relational_model "https://github.com/edwinballestero/proyectofinalisw/blob/main/api/prisma/schema.prisma"
click node_seed_data "https://github.com/edwinballestero/proyectofinalisw/blob/main/api/prisma/seed.ts"
click node_api_operations "https://github.com/edwinballestero/proyectofinalisw/blob/main/api/src/config/swagger.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_client_bootstrap,node_app_shell,node_event_pages,node_registration_pages,node_event_form,node_client_services toneBlue
class node_api_server,node_route_registry,node_resource_routes,node_middleware,node_event_domain,node_registration_domain,node_identity_domain,node_media_domain,node_api_operations toneAmber
class node_prisma_client,node_relational_model,node_seed_data toneMint
```

## Components

### React Client

- [Client Bootstrap](https://github.com/edwinballestero/proyectofinalisw/blob/main/app/src/main.jsx): React/Vite entry · `app/src/main.jsx`
- [App Shell & Routing](https://github.com/edwinballestero/proyectofinalisw/blob/main/app/src/App.jsx): React composition · `app/src/App.jsx`
- [Event Screens](https://github.com/edwinballestero/proyectofinalisw/blob/main/app/src/pages/EventsPage.jsx): page workflows · Browse, detail, and create event views. · `app/src/pages/EventsPage.jsx`
- [Registration Screens](https://github.com/edwinballestero/proyectofinalisw/blob/main/app/src/pages/Registration/RegistrationPage.jsx): page workflows · Registration listing and creation flow. · `app/src/pages/Registration/RegistrationPage.jsx`
- [Event Form Validation](https://github.com/edwinballestero/proyectofinalisw/blob/main/app/src/components/EventForm.jsx): form and schema · `app/src/components/EventForm.jsx`
- [Client Data Services](https://github.com/edwinballestero/proyectofinalisw/blob/main/app/src/services/eventsService.js): API/storage boundary · Event, reference-data, registration, and browser-storage access. · `app/src/services/eventsService.js`

### Node.js API

- [API Server](https://github.com/edwinballestero/proyectofinalisw/blob/main/api/src/server.ts): Express bootstrap · `api/src/server.ts`
- [Route Registry](https://github.com/edwinballestero/proyectofinalisw/blob/main/api/src/routes/routes.ts): Express routing · `api/src/routes/routes.ts`
- [Resource Routes](https://github.com/edwinballestero/proyectofinalisw/blob/main/api/src/routes/event.routes.ts): Express route modules · Event and registration endpoints represent the primary flows. · `api/src/routes/event.routes.ts`
- [Request Middleware](https://github.com/edwinballestero/proyectofinalisw/blob/main/api/src/middlewares/auth.middleware.ts): cross-cutting pipeline · Authentication, request validation, and error handling. · `api/src/middlewares/auth.middleware.ts`
- [Event Catalog Domain](https://github.com/edwinballestero/proyectofinalisw/blob/main/api/src/controllers/event.controller.ts): controller and service · Owns events and their category, tag, organizer, and image relationships. · `api/src/controllers/event.controller.ts`
- [Registration Domain](https://github.com/edwinballestero/proyectofinalisw/blob/main/api/src/controllers/registration.controller.ts): controller and service · Manages registrations and registration statuses. · `api/src/controllers/registration.controller.ts`
- [Identity & Ownership](https://github.com/edwinballestero/proyectofinalisw/blob/main/api/src/services/user.service.ts): domain services · Users, roles, and organizers support authorization and event ownership. · `api/src/services/user.service.ts`
- [Image Media Domain](https://github.com/edwinballestero/proyectofinalisw/blob/main/api/src/controllers/image.controller.ts): controller and service · Handles event images and cleanup. · `api/src/controllers/image.controller.ts`
- [API Operations](https://github.com/edwinballestero/proyectofinalisw/blob/main/api/src/config/swagger.ts): Swagger and logging · `api/src/config/swagger.ts`

### Persistence

- [Prisma Client](https://github.com/edwinballestero/proyectofinalisw/blob/main/api/src/config/prisma.ts): persistence adapter · `api/src/config/prisma.ts`
- [Relational Data Model](https://github.com/edwinballestero/proyectofinalisw/blob/main/api/prisma/schema.prisma): Prisma schema · Defines event, identity, classification, registration, and media data. · `api/prisma/schema.prisma`
- [Seed Data](https://github.com/edwinballestero/proyectofinalisw/blob/main/api/prisma/seed.ts): database initialization · `api/prisma/seed.ts`

## Connections

- Client Bootstrap → App Shell & Routing: mounts
- App Shell & Routing → Event Screens: routes to
- App Shell & Routing → Registration Screens: routes to
- Event Screens → Event Form Validation: uses
- Event Screens → Client Data Services: loads and saves
- Registration Screens → Client Data Services: uses registrations
- Client Data Services → API Server: REST requests
- API Server → Route Registry: registers
- Route Registry → Resource Routes: aggregates
- Resource Routes → Request Middleware: passes through
- Request Middleware → Event Catalog Domain: event requests
- Request Middleware → Registration Domain: registration requests
- Event Catalog Domain → Identity & Ownership: uses organizers
- Event Catalog Domain → Image Media Domain: manages images
- Registration Domain → Identity & Ownership: relates users
- Event Catalog Domain → Prisma Client: persists through
- Registration Domain → Prisma Client: persists through
- Identity & Ownership → Prisma Client: persists through
- Image Media Domain → Prisma Client: persists through
- Prisma Client → Relational Data Model: implements
- Seed Data → Relational Data Model: initializes
- API Server → API Operations: uses
