# flormaldonado-ki/ecoruta_is architecture

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

- Interactive diagram: https://gitdiagram.com/flormaldonado-ki/ecoruta_is
- Repository: https://github.com/flormaldonado-ki/ecoruta_is

## Overview

EcoRuta Escolar is a university carpooling app: users register and authenticate, then use trip, vehicle, reservation, notification, and community-impact features through a React Native app and Express API. The README confirms the app-to-API-to-PostgreSQL deployment and documents email and file-storage integrations. The sampled code shows app routing, authentication orchestration, and selected API routes; some feature internals were not sampled, so those links are marked unverified rather than asserted as observed calls.

Main entry points: [`backend/src/app.js`](https://github.com/flormaldonado-ki/ecoruta_is/blob/main/backend/src/app.js) (Express API), [`backend/src/config/db.js`](https://github.com/flormaldonado-ki/ecoruta_is/blob/main/backend/src/config/db.js) (Database pool), [`backend/src/modules/auth/auth.service.js`](https://github.com/flormaldonado-ki/ecoruta_is/blob/main/backend/src/modules/auth/auth.service.js) (Authentication service), [`frontend/App.tsx`](https://github.com/flormaldonado-ki/ecoruta_is/blob/main/frontend/App.tsx) (App navigation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile app"]
  node_app["App navigation<br/>[App.tsx]"]
  node_auth_ui["Login and registration<br/>[RegisterScreen.tsx]"]
  node_home["Authenticated home"]
  node_trip_ui["Trip discovery and management"]
  node_driver_ui["Driver trip setup"]
  node_notify_ui["Notification experience"]
  node_api_client["API client<br/>[apiClient.ts]"]
  node_local_trip[("Local driver state<br/>[tripStorage.ts]")]
end

subgraph group_api["API and identity"]
  node_api_app["Express API<br/>[app.js]"]
  node_auth_routes["Auth and profile routes<br/>[auth.routes.js]"]
  node_auth_service["Authentication service<br/>[auth.service.js]"]
  node_auth_repo["Account repository<br/>[auth.repository.js]"]
  node_catalogs["Catalogs"]
end

subgraph group_mobility["Carpool features"]
  node_vehicles["Vehicle management"]
  node_trips["Trips and routes<br/>[viajes.routes.js]"]
  node_reservations["Reservations<br/>[reservas.routes.js]"]
  node_notifications["Notifications"]
  node_impact["Community impact<br/>[impacto.routes.js]"]
end

subgraph group_shared["Shared services"]
  node_db_config["Database pool<br/>[db.js]"]
  node_mailer["Email delivery<br/>[index.js]"]
  node_storage["Document storage<br/>[index.js]"]
end

node_rider(("App user"))
node_neon[("Neon PostgreSQL")]
node_smtp["SMTP email"]
node_cloudinary["Cloudinary files"]

node_rider -->|"uses"| node_app
node_app -->|"renders"| node_auth_ui
node_app -->|"renders"| node_home
node_app -->|"provides"| node_notify_ui
node_auth_ui -.->|"requests via"| node_api_client
node_home -.->|"offers"| node_trip_ui
node_trip_ui -.->|"requests via"| node_api_client
node_driver_ui -->|"reads and updates"| node_local_trip
node_api_client -->|"HTTPS JSON"| node_api_app
node_api_app -->|"mounts"| node_auth_routes
node_api_app -->|"mounts"| node_vehicles
node_api_app -->|"mounts"| node_trips
node_api_app -->|"mounts"| node_reservations
node_api_app -->|"mounts"| node_notifications
node_api_app -->|"mounts"| node_impact
node_auth_routes -->|"dispatches"| node_auth_service
node_auth_service -->|"calls"| node_auth_repo
node_auth_service -->|"loads registration context"| node_catalogs
node_auth_service -->|"sends account email"| node_mailer
node_auth_service -->|"stores documents"| node_storage
node_catalogs -->|"queries"| node_db_config
node_db_config -->|"connects"| node_neon
node_mailer -->|"delivers through"| node_smtp
node_storage -->|"stores files"| node_cloudinary
node_vehicles -.->|"persists through"| node_db_config
node_trips -.->|"persists through"| node_db_config
node_reservations -.->|"persists through"| node_db_config
node_notifications -.->|"persists through"| node_db_config
node_impact -->|"queries"| node_db_config

click node_app "https://github.com/flormaldonado-ki/ecoruta_is/blob/main/frontend/App.tsx"
click node_auth_ui "https://github.com/flormaldonado-ki/ecoruta_is/blob/main/frontend/src/screens/RegisterScreen.tsx"
click node_home "https://github.com/flormaldonado-ki/ecoruta_is/blob/main/frontend/src/screens/AuthenticatedHomeScreen.tsx"
click node_trip_ui "https://github.com/flormaldonado-ki/ecoruta_is/blob/main/frontend/src/screens/PassengerSearchScreen.tsx"
click node_driver_ui "https://github.com/flormaldonado-ki/ecoruta_is/blob/main/frontend/src/screens/DriverRouteSetupScreen.tsx"
click node_notify_ui "https://github.com/flormaldonado-ki/ecoruta_is/blob/main/frontend/src/hooks/useNotifications.tsx"
click node_api_client "https://github.com/flormaldonado-ki/ecoruta_is/blob/main/frontend/src/services/apiClient.ts"
click node_local_trip "https://github.com/flormaldonado-ki/ecoruta_is/blob/main/frontend/src/services/tripStorage.ts"
click node_api_app "https://github.com/flormaldonado-ki/ecoruta_is/blob/main/backend/src/app.js"
click node_auth_routes "https://github.com/flormaldonado-ki/ecoruta_is/blob/main/backend/src/modules/auth/auth.routes.js"
click node_auth_service "https://github.com/flormaldonado-ki/ecoruta_is/blob/main/backend/src/modules/auth/auth.service.js"
click node_auth_repo "https://github.com/flormaldonado-ki/ecoruta_is/blob/main/backend/src/modules/auth/auth.repository.js"
click node_catalogs "https://github.com/flormaldonado-ki/ecoruta_is/blob/main/backend/src/modules/catalogos/catalogos.service.js"
click node_vehicles "https://github.com/flormaldonado-ki/ecoruta_is/blob/main/backend/src/modules/vehiculos/vehiculos.routes.js"
click node_trips "https://github.com/flormaldonado-ki/ecoruta_is/blob/main/backend/src/modules/viajes/viajes.routes.js"
click node_reservations "https://github.com/flormaldonado-ki/ecoruta_is/blob/main/backend/src/modules/reservas/reservas.routes.js"
click node_notifications "https://github.com/flormaldonado-ki/ecoruta_is/blob/main/backend/src/modules/notificaciones/notificaciones.routes.js"
click node_impact "https://github.com/flormaldonado-ki/ecoruta_is/blob/main/backend/src/modules/impacto/impacto.routes.js"
click node_db_config "https://github.com/flormaldonado-ki/ecoruta_is/blob/main/backend/src/config/db.js"
click node_mailer "https://github.com/flormaldonado-ki/ecoruta_is/blob/main/backend/src/shared/mailer/index.js"
click node_storage "https://github.com/flormaldonado-ki/ecoruta_is/blob/main/backend/src/shared/storage/index.js"

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_app,node_auth_ui,node_home,node_trip_ui,node_driver_ui,node_notify_ui,node_api_client,node_local_trip,node_rider toneBlue
class node_api_app,node_auth_routes,node_auth_service,node_auth_repo,node_catalogs,node_neon toneAmber
class node_vehicles,node_trips,node_reservations,node_notifications,node_impact toneMint
class node_db_config,node_mailer,node_storage toneRose
class node_smtp,node_cloudinary toneIndigo
```

## Components

### Mobile app

- [App navigation](https://github.com/flormaldonado-ki/ecoruta_is/blob/main/frontend/App.tsx): `frontend/App.tsx`
- [Login and registration](https://github.com/flormaldonado-ki/ecoruta_is/blob/main/frontend/src/screens/RegisterScreen.tsx): `frontend/src/screens/RegisterScreen.tsx`
- [Authenticated home](https://github.com/flormaldonado-ki/ecoruta_is/blob/main/frontend/src/screens/AuthenticatedHomeScreen.tsx): `frontend/src/screens/AuthenticatedHomeScreen.tsx`
- [Trip discovery and management](https://github.com/flormaldonado-ki/ecoruta_is/blob/main/frontend/src/screens/PassengerSearchScreen.tsx): `frontend/src/screens/PassengerSearchScreen.tsx`
- [Driver trip setup](https://github.com/flormaldonado-ki/ecoruta_is/blob/main/frontend/src/screens/DriverRouteSetupScreen.tsx): `frontend/src/screens/DriverRouteSetupScreen.tsx`
- [Notification experience](https://github.com/flormaldonado-ki/ecoruta_is/blob/main/frontend/src/hooks/useNotifications.tsx): `frontend/src/hooks/useNotifications.tsx`
- [API client](https://github.com/flormaldonado-ki/ecoruta_is/blob/main/frontend/src/services/apiClient.ts): `frontend/src/services/apiClient.ts`
- [Local driver state](https://github.com/flormaldonado-ki/ecoruta_is/blob/main/frontend/src/services/tripStorage.ts): `frontend/src/services/tripStorage.ts`

### API and identity

- [Express API](https://github.com/flormaldonado-ki/ecoruta_is/blob/main/backend/src/app.js): `backend/src/app.js`
- [Auth and profile routes](https://github.com/flormaldonado-ki/ecoruta_is/blob/main/backend/src/modules/auth/auth.routes.js): `backend/src/modules/auth/auth.routes.js`
- [Authentication service](https://github.com/flormaldonado-ki/ecoruta_is/blob/main/backend/src/modules/auth/auth.service.js): `backend/src/modules/auth/auth.service.js`
- [Account repository](https://github.com/flormaldonado-ki/ecoruta_is/blob/main/backend/src/modules/auth/auth.repository.js): `backend/src/modules/auth/auth.repository.js`
- [Catalogs](https://github.com/flormaldonado-ki/ecoruta_is/blob/main/backend/src/modules/catalogos/catalogos.service.js): `backend/src/modules/catalogos/catalogos.service.js`

### Carpool features

- [Vehicle management](https://github.com/flormaldonado-ki/ecoruta_is/blob/main/backend/src/modules/vehiculos/vehiculos.routes.js): `backend/src/modules/vehiculos/vehiculos.routes.js`
- [Trips and routes](https://github.com/flormaldonado-ki/ecoruta_is/blob/main/backend/src/modules/viajes/viajes.routes.js): `backend/src/modules/viajes/viajes.routes.js`
- [Reservations](https://github.com/flormaldonado-ki/ecoruta_is/blob/main/backend/src/modules/reservas/reservas.routes.js): `backend/src/modules/reservas/reservas.routes.js`
- [Notifications](https://github.com/flormaldonado-ki/ecoruta_is/blob/main/backend/src/modules/notificaciones/notificaciones.routes.js): `backend/src/modules/notificaciones/notificaciones.routes.js`
- [Community impact](https://github.com/flormaldonado-ki/ecoruta_is/blob/main/backend/src/modules/impacto/impacto.routes.js): `backend/src/modules/impacto/impacto.routes.js`

### Shared services

- [Database pool](https://github.com/flormaldonado-ki/ecoruta_is/blob/main/backend/src/config/db.js): `backend/src/config/db.js`
- [Email delivery](https://github.com/flormaldonado-ki/ecoruta_is/blob/main/backend/src/shared/mailer/index.js): `backend/src/shared/mailer/index.js`
- [Document storage](https://github.com/flormaldonado-ki/ecoruta_is/blob/main/backend/src/shared/storage/index.js): `backend/src/shared/storage/index.js`

### Other components

- **App user**
- **Neon PostgreSQL**
- **SMTP email**
- **Cloudinary files**

## Connections

- App user → App navigation: uses (evidence: `README.md`)
- App navigation → Login and registration: renders (evidence: `frontend/App.tsx`)
- App navigation → Authenticated home: renders (evidence: `frontend/App.tsx`)
- App navigation → Notification experience: provides (evidence: `frontend/App.tsx`)
- Login and registration → API client: requests via
- Authenticated home → Trip discovery and management: offers
- Trip discovery and management → API client: requests via
- Driver trip setup → Local driver state: reads and updates (evidence: `frontend/src/screens/DriverRouteSetupScreen.tsx`)
- API client → Express API: HTTPS JSON (evidence: `README.md`)
- Express API → Auth and profile routes: mounts (evidence: `backend/src/app.js`)
- Express API → Vehicle management: mounts (evidence: `backend/src/app.js`)
- Express API → Trips and routes: mounts (evidence: `backend/src/app.js`)
- Express API → Reservations: mounts (evidence: `backend/src/app.js`)
- Express API → Notifications: mounts (evidence: `backend/src/app.js`)
- Express API → Community impact: mounts (evidence: `backend/src/app.js`)
- Auth and profile routes → Authentication service: dispatches (evidence: `backend/src/modules/auth/auth.routes.js`)
- Authentication service → Account repository: calls (evidence: `backend/src/modules/auth/auth.service.js`)
- Authentication service → Catalogs: loads registration context (evidence: `backend/src/modules/auth/auth.service.js`)
- Authentication service → Email delivery: sends account email (evidence: `backend/src/modules/auth/auth.service.js`)
- Authentication service → Document storage: stores documents (evidence: `backend/src/modules/auth/auth.service.js`)
- Catalogs → Database pool: queries (evidence: `backend/src/modules/catalogos/catalogos.service.js`)
- Database pool → Neon PostgreSQL: connects (evidence: `README.md`)
- Email delivery → SMTP email: delivers through (evidence: `README.md`)
- Document storage → Cloudinary files: stores files (evidence: `README.md`)
- Vehicle management → Database pool: persists through
- Trips and routes → Database pool: persists through
- Reservations → Database pool: persists through
- Notifications → Database pool: persists through
- Community impact → Database pool: queries (evidence: `backend/src/modules/impacto/impacto.routes.js`)
