# sabinevela/competenciasdk architecture

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

- Interactive diagram: https://gitdiagram.com/sabinevela/competenciasdk
- Repository: https://github.com/sabinevela/competenciasdk

## Overview

CompetenciaSDK is an Ecuador-focused climate and hazard-monitoring mobile app backed by an Express API. The user journey runs from welcome and Supabase authentication into the signed-in dashboard, which provides access to weather, AI risk prediction, community reports, volcano monitoring, and preparedness resources. The backend proxies weather and AI requests and runs scheduled prediction and alert tasks. The README documents major capabilities not fully visible in sampled code; edges to backend integrations follow those documented API flows.

Main entry points: [`navegacion/Navigation.tsx`](https://github.com/sabinevela/competenciasdk/blob/main/navegacion/Navigation.tsx) (Navigation and auth gate), [`server/index.js`](https://github.com/sabinevela/competenciasdk/blob/main/server/index.js) (Express API), [`security/supabase.ts`](https://github.com/sabinevela/competenciasdk/blob/main/security/supabase.ts) (Supabase client), [`src/config.ts`](https://github.com/sabinevela/competenciasdk/blob/main/src/config.ts) (Backend URL config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile app"]
  node_navigation["Navigation and auth gate<br/>[Navigation.tsx]"]
  node_welcome["Welcome screen<br/>[HomeScreen.tsx]"]
  node_auth["Login and registration<br/>[LoginScreen.tsx]"]
  node_supabase_client["Supabase client<br/>[supabase.ts]"]
  node_dashboard["Climate dashboard<br/>[FirstPage.tsx]"]
  node_prediction["AI prediction<br/>[PredictScreen.tsx]"]
  node_community["Community feed<br/>[FeedScreen.tsx]"]
  node_volcanoes["Volcano monitor"]
  node_risk_map["Risk map<br/>[MapaScreen.tsx]"]
  node_preparedness["Emergency plan"]
  node_education["Climate education"]
  node_sustainability["Sustainable actions<br/>[AccionesScreen.tsx]"]
  node_climtok["Climate video feed<br/>[TiktokScreen.tsx]"]
  node_profile["User profile<br/>[ProfileScreen.tsx]"]
  node_client_config["Backend URL config<br/>[config.ts]"]
end

subgraph group_api["Backend API"]
  node_backend["Express API<br/>[index.js]"]
  node_feed_store[("In-memory feed<br/>[index.js]")]
end

subgraph group_jobs["Scheduled monitoring"]
  node_scheduler["Prediction and alert jobs<br/>[scheduler.js]"]
  node_alerts[("In-memory alerts<br/>[scheduler.js]")]
end

subgraph group_services["External services"]
  node_weather_service["OpenWeatherMap"]
  node_openai["OpenAI"]
  node_volcano_source["IGEPN data source"]
  node_supabase["Supabase service"]
end

node_user(("App user"))

node_user -->|"opens app"| node_navigation
node_navigation -->|"routes to"| node_welcome
node_navigation -->|"routes to"| node_auth
node_navigation -->|"routes to"| node_dashboard
node_navigation -->|"routes to"| node_prediction
node_navigation -->|"routes to"| node_community
node_navigation -->|"routes to"| node_volcanoes
node_navigation -->|"routes to"| node_risk_map
node_navigation -->|"routes to"| node_preparedness
node_navigation -->|"routes to"| node_education
node_navigation -->|"routes to"| node_sustainability
node_navigation -->|"routes to"| node_climtok
node_navigation -->|"routes to"| node_profile
node_navigation -->|"checks auth"| node_supabase_client
node_auth -->|"authenticates with"| node_supabase_client
node_auth -->|"registers with"| node_supabase_client
node_supabase_client -->|"connects to"| node_supabase
node_profile -->|"uses"| node_supabase_client
node_dashboard -->|"uses URL"| node_client_config
node_prediction -->|"uses URL"| node_client_config
node_community -->|"uses URL"| node_client_config
node_volcanoes -->|"uses URL"| node_client_config
node_client_config -->|"targets API"| node_backend
node_dashboard -->|"requests weather"| node_backend
node_prediction -->|"requests prediction"| node_backend
node_community -->|"reads and posts reports"| node_backend
node_volcanoes -->|"requests volcanoes"| node_backend
node_backend -->|"fetches weather"| node_weather_service
node_backend -->|"generates predictions"| node_openai
node_backend -->|"reads and writes"| node_feed_store
node_backend -->|"starts jobs"| node_scheduler
node_scheduler -->|"requests forecasts"| node_openai
node_scheduler -->|"stores high-risk alerts"| node_alerts
node_backend -->|"serves alerts"| node_alerts
node_scheduler -.->|"checks hourly"| node_volcano_source

click node_navigation "https://github.com/sabinevela/competenciasdk/blob/main/navegacion/Navigation.tsx"
click node_welcome "https://github.com/sabinevela/competenciasdk/blob/main/screens/HomeScreen.tsx"
click node_auth "https://github.com/sabinevela/competenciasdk/blob/main/screens/LoginScreen.tsx"
click node_supabase_client "https://github.com/sabinevela/competenciasdk/blob/main/security/supabase.ts"
click node_dashboard "https://github.com/sabinevela/competenciasdk/blob/main/screens/FirstPage.tsx"
click node_prediction "https://github.com/sabinevela/competenciasdk/blob/main/screens/PredictScreen.tsx"
click node_community "https://github.com/sabinevela/competenciasdk/blob/main/screens/FeedScreen.tsx"
click node_volcanoes "https://github.com/sabinevela/competenciasdk/blob/main/screens/VolcanoesScreen.tsx"
click node_risk_map "https://github.com/sabinevela/competenciasdk/blob/main/screens/MapaScreen.tsx"
click node_preparedness "https://github.com/sabinevela/competenciasdk/blob/main/screens/EmergenciaScreen.tsx"
click node_education "https://github.com/sabinevela/competenciasdk/blob/main/screens/EducacionScreen.tsx"
click node_sustainability "https://github.com/sabinevela/competenciasdk/blob/main/screens/AccionesScreen.tsx"
click node_climtok "https://github.com/sabinevela/competenciasdk/blob/main/screens/TiktokScreen.tsx"
click node_profile "https://github.com/sabinevela/competenciasdk/blob/main/screens/ProfileScreen.tsx"
click node_client_config "https://github.com/sabinevela/competenciasdk/blob/main/src/config.ts"
click node_backend "https://github.com/sabinevela/competenciasdk/blob/main/server/index.js"
click node_feed_store "https://github.com/sabinevela/competenciasdk/blob/main/server/index.js"
click node_scheduler "https://github.com/sabinevela/competenciasdk/blob/main/server/scheduler.js"
click node_alerts "https://github.com/sabinevela/competenciasdk/blob/main/server/scheduler.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_navigation,node_welcome,node_auth,node_supabase_client,node_dashboard,node_prediction,node_community,node_volcanoes,node_risk_map,node_preparedness,node_education,node_sustainability,node_climtok,node_profile,node_client_config,node_user toneBlue
class node_backend,node_feed_store toneAmber
class node_scheduler,node_alerts toneMint
class node_weather_service,node_openai,node_volcano_source,node_supabase toneRose
```

## Components

### Mobile app

- [Navigation and auth gate](https://github.com/sabinevela/competenciasdk/blob/main/navegacion/Navigation.tsx): `navegacion/Navigation.tsx`
- [Welcome screen](https://github.com/sabinevela/competenciasdk/blob/main/screens/HomeScreen.tsx): `screens/HomeScreen.tsx`
- [Login and registration](https://github.com/sabinevela/competenciasdk/blob/main/screens/LoginScreen.tsx): `screens/LoginScreen.tsx`
- [Supabase client](https://github.com/sabinevela/competenciasdk/blob/main/security/supabase.ts): `security/supabase.ts`
- [Climate dashboard](https://github.com/sabinevela/competenciasdk/blob/main/screens/FirstPage.tsx): `screens/FirstPage.tsx`
- [AI prediction](https://github.com/sabinevela/competenciasdk/blob/main/screens/PredictScreen.tsx): `screens/PredictScreen.tsx`
- [Community feed](https://github.com/sabinevela/competenciasdk/blob/main/screens/FeedScreen.tsx): `screens/FeedScreen.tsx`
- [Volcano monitor](https://github.com/sabinevela/competenciasdk/blob/main/screens/VolcanoesScreen.tsx): `screens/VolcanoesScreen.tsx`
- [Risk map](https://github.com/sabinevela/competenciasdk/blob/main/screens/MapaScreen.tsx): `screens/MapaScreen.tsx`
- [Emergency plan](https://github.com/sabinevela/competenciasdk/blob/main/screens/EmergenciaScreen.tsx): `screens/EmergenciaScreen.tsx`
- [Climate education](https://github.com/sabinevela/competenciasdk/blob/main/screens/EducacionScreen.tsx): `screens/EducacionScreen.tsx`
- [Sustainable actions](https://github.com/sabinevela/competenciasdk/blob/main/screens/AccionesScreen.tsx): `screens/AccionesScreen.tsx`
- [Climate video feed](https://github.com/sabinevela/competenciasdk/blob/main/screens/TiktokScreen.tsx): `screens/TiktokScreen.tsx`
- [User profile](https://github.com/sabinevela/competenciasdk/blob/main/screens/ProfileScreen.tsx): `screens/ProfileScreen.tsx`
- [Backend URL config](https://github.com/sabinevela/competenciasdk/blob/main/src/config.ts): `src/config.ts`

### Backend API

- [Express API](https://github.com/sabinevela/competenciasdk/blob/main/server/index.js): `server/index.js`
- [In-memory feed](https://github.com/sabinevela/competenciasdk/blob/main/server/index.js): `server/index.js`

### Scheduled monitoring

- [Prediction and alert jobs](https://github.com/sabinevela/competenciasdk/blob/main/server/scheduler.js): `server/scheduler.js`
- [In-memory alerts](https://github.com/sabinevela/competenciasdk/blob/main/server/scheduler.js): `server/scheduler.js`

### External services

- **OpenWeatherMap**
- **OpenAI**
- **IGEPN data source**
- **Supabase service**

### Other components

- **App user**

## Connections

- App user → Navigation and auth gate: opens app (evidence: `README.md`)
- Navigation and auth gate → Welcome screen: routes to (evidence: `navegacion/Navigation.tsx`)
- Navigation and auth gate → Login and registration: routes to (evidence: `navegacion/Navigation.tsx`)
- Navigation and auth gate → Climate dashboard: routes to (evidence: `navegacion/Navigation.tsx`)
- Navigation and auth gate → AI prediction: routes to (evidence: `navegacion/Navigation.tsx`)
- Navigation and auth gate → Community feed: routes to (evidence: `navegacion/Navigation.tsx`)
- Navigation and auth gate → Volcano monitor: routes to (evidence: `navegacion/Navigation.tsx`)
- Navigation and auth gate → Risk map: routes to (evidence: `navegacion/Navigation.tsx`)
- Navigation and auth gate → Emergency plan: routes to (evidence: `navegacion/Navigation.tsx`)
- Navigation and auth gate → Climate education: routes to (evidence: `navegacion/Navigation.tsx`)
- Navigation and auth gate → Sustainable actions: routes to (evidence: `navegacion/Navigation.tsx`)
- Navigation and auth gate → Climate video feed: routes to (evidence: `navegacion/Navigation.tsx`)
- Navigation and auth gate → User profile: routes to (evidence: `navegacion/Navigation.tsx`)
- Navigation and auth gate → Supabase client: checks auth (evidence: `navegacion/Navigation.tsx`)
- Login and registration → Supabase client: authenticates with (evidence: `screens/LoginScreen.tsx`)
- Login and registration → Supabase client: registers with (evidence: `screens/LoginScreen.tsx`)
- Supabase client → Supabase service: connects to (evidence: `security/supabase.ts`)
- User profile → Supabase client: uses (evidence: `screens/ProfileScreen.tsx`)
- Climate dashboard → Backend URL config: uses URL (evidence: `screens/FirstPage.tsx`)
- AI prediction → Backend URL config: uses URL (evidence: `screens/PredictScreen.tsx`)
- Community feed → Backend URL config: uses URL (evidence: `screens/FeedScreen.tsx`)
- Volcano monitor → Backend URL config: uses URL (evidence: `screens/VolcanoesScreen.tsx`)
- Backend URL config → Express API: targets API (evidence: `README.md`)
- Climate dashboard → Express API: requests weather (evidence: `README.md`)
- AI prediction → Express API: requests prediction (evidence: `README.md`)
- Community feed → Express API: reads and posts reports (evidence: `README.md`)
- Volcano monitor → Express API: requests volcanoes (evidence: `README.md`)
- Express API → OpenWeatherMap: fetches weather (evidence: `README.md`)
- Express API → OpenAI: generates predictions (evidence: `server/index.js`)
- Express API → In-memory feed: reads and writes (evidence: `server/index.js`)
- Express API → Prediction and alert jobs: starts jobs (evidence: `server/index.js`)
- Prediction and alert jobs → OpenAI: requests forecasts (evidence: `server/scheduler.js`)
- Prediction and alert jobs → In-memory alerts: stores high-risk alerts (evidence: `server/scheduler.js`)
- Express API → In-memory alerts: serves alerts (evidence: `README.md`)
- Prediction and alert jobs → IGEPN data source: checks hourly (evidence: `server/scheduler.js`)
