# itslevanx/hackathon-utp-el-comercio architecture

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

- Interactive diagram: https://gitdiagram.com/itslevanx/hackathon-utp-el-comercio
- Repository: https://github.com/itslevanx/hackathon-utp-el-comercio

## Overview

Conecta2 is a Flutter neighborhood-community app. Residents browse nearby services and posts, request or offer help, and coordinate in private chats or district emergency groups; the app also supports offline drafts and simulated emergencies. The README documents maps, accessibility, and push notifications. Most Dart application sources are absent from the supplied tree, so those feature nodes have no supported source path; documented relationships are cited to the README. The private-message push function is present in the tree, but its implementation details are not expanded here.

Main entry points: [`supabase/functions/private-message-push/index.ts`](https://github.com/itslevanx/hackathon-utp-el-comercio/blob/main/supabase/functions/private-message-push/index.ts) (Push worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_community["Community features"]
  node_directory["Service directory"]
  node_publications["Community posts"]
  node_maps["Map exploration"]
  node_location["Location search"]
end

subgraph group_coordination["Chat and emergencies"]
  node_privatechat["Private chats"]
  node_emergency["Emergency groups"]
  node_drills["Emergency drills"]
  node_push["Push notifications"]
end

subgraph group_platform["App and offline support"]
  node_app["Conecta2 app"]
  node_auth["Account access"]
  node_offline["Offline drafts"]
  node_sqlite[("Local SQLite")]
  node_accessibility["Accessible controls"]
end

subgraph group_services["Remote services"]
  node_pushfn["Push worker<br/>[index.ts]"]
  node_supabase[("Supabase services")]
  node_realtime["Supabase Realtime"]
  node_carto["CARTO maps"]
  node_osm["OpenStreetMap"]
  node_fcm["Firebase messaging"]
end

node_resident(("Resident"))

node_resident -->|"uses"| node_app
node_app -->|"provides access"| node_auth
node_app -->|"offers browsing"| node_directory
node_app -->|"offers posting"| node_publications
node_app -->|"offers exploration"| node_maps
node_maps -->|"searches nearby"| node_location
node_maps -->|"requests basemap"| node_carto
node_maps -->|"uses map data"| node_osm
node_app -->|"offers chats"| node_privatechat
node_app -->|"opens groups"| node_emergency
node_app -->|"offers simulations"| node_drills
node_app -->|"queues offline work"| node_offline
node_offline -->|"stores drafts"| node_sqlite
node_app -->|"provides controls"| node_accessibility
node_directory -->|"queries services"| node_supabase
node_publications -->|"stores posts"| node_supabase
node_privatechat -->|"receives updates"| node_realtime
node_push -.->|"registers devices"| node_fcm
node_supabase -->|"dispatches queued work"| node_pushfn
node_pushfn -->|"sends notifications"| node_fcm

click node_pushfn "https://github.com/itslevanx/hackathon-utp-el-comercio/blob/main/supabase/functions/private-message-push/index.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_directory,node_publications,node_maps,node_location toneBlue
class node_privatechat,node_emergency,node_drills,node_push toneAmber
class node_app,node_auth,node_offline,node_sqlite,node_accessibility toneMint
class node_pushfn,node_supabase,node_realtime,node_carto,node_osm,node_fcm toneRose
class node_resident toneIndigo
```

## Components

### Community features

- **Service directory**
- **Community posts**
- **Map exploration**
- **Location search**

### Chat and emergencies

- **Private chats**
- **Emergency groups**
- **Emergency drills**
- **Push notifications**

### App and offline support

- **Conecta2 app**
- **Account access**
- **Offline drafts**
- **Local SQLite**
- **Accessible controls**

### Remote services

- [Push worker](https://github.com/itslevanx/hackathon-utp-el-comercio/blob/main/supabase/functions/private-message-push/index.ts): `supabase/functions/private-message-push/index.ts`
- **Supabase services**
- **Supabase Realtime**
- **CARTO maps**
- **OpenStreetMap**
- **Firebase messaging**

### Other components

- **Resident**

## Connections

- Resident → Conecta2 app: uses
- Conecta2 app → Account access: provides access
- Conecta2 app → Service directory: offers browsing
- Conecta2 app → Community posts: offers posting
- Conecta2 app → Map exploration: offers exploration
- Map exploration → Location search: searches nearby
- Map exploration → CARTO maps: requests basemap
- Map exploration → OpenStreetMap: uses map data
- Conecta2 app → Private chats: offers chats
- Conecta2 app → Emergency groups: opens groups
- Conecta2 app → Emergency drills: offers simulations
- Conecta2 app → Offline drafts: queues offline work
- Offline drafts → Local SQLite: stores drafts
- Conecta2 app → Accessible controls: provides controls
- Service directory → Supabase services: queries services
- Community posts → Supabase services: stores posts
- Private chats → Supabase Realtime: receives updates
- Push notifications → Firebase messaging: registers devices
- Supabase services → Push worker: dispatches queued work
- Push worker → Firebase messaging: sends notifications
