# g1anc/area architecture

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

- Interactive diagram: https://gitdiagram.com/g1anc/area
- Repository: https://github.com/g1anc/area

## Overview

AREA is an IFTTT/Zapier-style automation product: users authenticate, connect service accounts, define an action and reaction, then manage and run automations. The mobile app shows the action/reaction authoring stages; the repository also contains a web client, server APIs, service integrations, and a worker. The README documents the overall product and supported services, but many web and server implementations were not sampled, so their internal call relationships are not asserted.

Main entry points: [`mobile/App.tsx`](https://github.com/g1anc/area/blob/main/mobile/App.tsx) (Mobile navigation), [`web/app`](https://github.com/g1anc/area/tree/main/web/app) (Web application), [`mobile/src/settings/page.tsx`](https://github.com/g1anc/area/blob/main/mobile/src/settings/page.tsx) (Account settings), [`web/app/api/auth`](https://github.com/g1anc/area/tree/main/web/app/api/auth) (Authentication API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User clients"]
  node_mobile["Mobile navigation<br/>[App.tsx]"]
  node_mobile_auth["Mobile sign-in<br/>[page.tsx]"]
  node_mobile_create["Action-reaction authoring<br/>[CreateServices.tsx]"]
  node_mobile_menu["Mobile menu<br/>[Menu.tsx]"]
  node_mobile_settings["Account settings<br/>[page.tsx]"]
  node_mobile_storage["Token storage<br/>[LocalStorage.tsx]"]
  node_web["Web application"]
  node_web_dashboard["Automation dashboard"]
end

subgraph group_server["Server and identity"]
  node_auth_api["Authentication API"]
  node_oauth_api["OAuth API<br/>[route.ts]"]
  node_service_api["Service API"]
  node_user_api["User API"]
  node_session_store[("Session repository")]
  node_oauth_providers["OAuth providers"]
end

subgraph group_automation["Automation runtime"]
  node_service_catalog["Action and reaction catalog"]
  node_webhook_api["Webhook endpoint<br/>[route.ts]"]
  node_worker["Worker<br/>[index.ts]"]
end

subgraph group_integrations["Service integrations"]
  node_service_adapters["Service adapters"]
end

node_user(("User"))
node_external_services{{"Connected services"}}

node_user -->|"uses"| node_mobile
node_user -->|"uses"| node_web
node_mobile -->|"routes to"| node_mobile_auth
node_mobile -->|"routes to"| node_mobile_menu
node_mobile -->|"routes to"| node_mobile_settings
node_mobile_menu -->|"opens"| node_mobile_create
node_mobile_create -.->|"selects actions"| node_service_catalog
node_mobile_auth -->|"stores API URL"| node_mobile_storage
node_mobile_settings -->|"clears token"| node_mobile_storage
node_web -->|"provides"| node_web_dashboard
node_web -.->|"accesses server features"| node_auth_api
node_web -.->|"accesses server features"| node_service_api
node_mobile -.->|"accesses server features"| node_auth_api
node_mobile_settings -->|"manages connections"| node_oauth_api
node_auth_api -.->|"creates sessions"| node_session_store
node_oauth_api -.->|"uses providers"| node_oauth_providers
node_webhook_api -.->|"dispatches automation"| node_service_catalog
node_worker -.->|"runs automation"| node_service_catalog
node_service_adapters -.->|"integrates with"| node_external_services

click node_mobile "https://github.com/g1anc/area/blob/main/mobile/App.tsx"
click node_mobile_auth "https://github.com/g1anc/area/blob/main/mobile/src/connection/page.tsx"
click node_mobile_create "https://github.com/g1anc/area/blob/main/mobile/src/services/CreateServices.tsx"
click node_mobile_menu "https://github.com/g1anc/area/blob/main/mobile/src/components/Menu.tsx"
click node_mobile_settings "https://github.com/g1anc/area/blob/main/mobile/src/settings/page.tsx"
click node_mobile_storage "https://github.com/g1anc/area/blob/main/mobile/src/LocalStorage.tsx"
click node_web "https://github.com/g1anc/area/tree/main/web/app"
click node_web_dashboard "https://github.com/g1anc/area/tree/main/web/app/(pages)/dashboard"
click node_auth_api "https://github.com/g1anc/area/tree/main/web/app/api/auth"
click node_oauth_api "https://github.com/g1anc/area/blob/main/web/app/api/oauth/route.ts"
click node_service_api "https://github.com/g1anc/area/tree/main/web/app/api/services"
click node_user_api "https://github.com/g1anc/area/tree/main/web/app/api/users"
click node_session_store "https://github.com/g1anc/area/blob/main/shared/database/SessionRepository.ts"
click node_oauth_providers "https://github.com/g1anc/area/tree/main/shared/Oauth"
click node_service_catalog "https://github.com/g1anc/area/tree/main/shared/services"
click node_webhook_api "https://github.com/g1anc/area/blob/main/web/app/api/webhook/%5Bservice%5D/%5Baction%5D/%5Bid%5D/route.ts"
click node_worker "https://github.com/g1anc/area/blob/main/worker/index.ts"
click node_service_adapters "https://github.com/g1anc/area/tree/main/shared/services"

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_mobile,node_mobile_auth,node_mobile_create,node_mobile_menu,node_mobile_settings,node_mobile_storage,node_web,node_web_dashboard,node_user toneBlue
class node_auth_api,node_oauth_api,node_service_api,node_user_api,node_session_store,node_oauth_providers toneAmber
class node_service_catalog,node_webhook_api,node_worker toneMint
class node_service_adapters toneRose
class node_external_services toneIndigo
```

## Components

### User clients

- [Mobile navigation](https://github.com/g1anc/area/blob/main/mobile/App.tsx): `mobile/App.tsx`
- [Mobile sign-in](https://github.com/g1anc/area/blob/main/mobile/src/connection/page.tsx): `mobile/src/connection/page.tsx`
- [Action-reaction authoring](https://github.com/g1anc/area/blob/main/mobile/src/services/CreateServices.tsx): `mobile/src/services/CreateServices.tsx`
- [Mobile menu](https://github.com/g1anc/area/blob/main/mobile/src/components/Menu.tsx): `mobile/src/components/Menu.tsx`
- [Account settings](https://github.com/g1anc/area/blob/main/mobile/src/settings/page.tsx): `mobile/src/settings/page.tsx`
- [Token storage](https://github.com/g1anc/area/blob/main/mobile/src/LocalStorage.tsx): `mobile/src/LocalStorage.tsx`
- [Web application](https://github.com/g1anc/area/tree/main/web/app): `web/app`
- [Automation dashboard](https://github.com/g1anc/area/tree/main/web/app/(pages)/dashboard): `web/app/(pages)/dashboard`

### Server and identity

- [Authentication API](https://github.com/g1anc/area/tree/main/web/app/api/auth): `web/app/api/auth`
- [OAuth API](https://github.com/g1anc/area/blob/main/web/app/api/oauth/route.ts): `web/app/api/oauth/route.ts`
- [Service API](https://github.com/g1anc/area/tree/main/web/app/api/services): `web/app/api/services`
- [User API](https://github.com/g1anc/area/tree/main/web/app/api/users): `web/app/api/users`
- [Session repository](https://github.com/g1anc/area/blob/main/shared/database/SessionRepository.ts): `shared/database/SessionRepository.ts`
- [OAuth providers](https://github.com/g1anc/area/tree/main/shared/Oauth): `shared/Oauth`

### Automation runtime

- [Action and reaction catalog](https://github.com/g1anc/area/tree/main/shared/services): `shared/services`
- [Webhook endpoint](https://github.com/g1anc/area/blob/main/web/app/api/webhook/%5Bservice%5D/%5Baction%5D/%5Bid%5D/route.ts): `web/app/api/webhook/[service]/[action]/[id]/route.ts`
- [Worker](https://github.com/g1anc/area/blob/main/worker/index.ts): `worker/index.ts`

### Service integrations

- [Service adapters](https://github.com/g1anc/area/tree/main/shared/services): `shared/services`

### Other components

- **User**
- **Connected services**

## Connections

- User → Mobile navigation: uses
- User → Web application: uses
- Mobile navigation → Mobile sign-in: routes to (evidence: `mobile/App.tsx`)
- Mobile navigation → Mobile menu: routes to (evidence: `mobile/App.tsx`)
- Mobile navigation → Account settings: routes to (evidence: `mobile/App.tsx`)
- Mobile menu → Action-reaction authoring: opens (evidence: `mobile/src/components/Menu.tsx`)
- Action-reaction authoring → Action and reaction catalog: selects actions
- Mobile sign-in → Token storage: stores API URL (evidence: `mobile/src/connection/page.tsx`)
- Account settings → Token storage: clears token (evidence: `mobile/src/settings/page.tsx`)
- Web application → Automation dashboard: provides
- Web application → Authentication API: accesses server features
- Web application → Service API: accesses server features
- Mobile navigation → Authentication API: accesses server features
- Account settings → OAuth API: manages connections (evidence: `mobile/src/settings/page.tsx`)
- Authentication API → Session repository: creates sessions
- OAuth API → OAuth providers: uses providers
- Webhook endpoint → Action and reaction catalog: dispatches automation
- Worker → Action and reaction catalog: runs automation
- Service adapters → Connected services: integrates with
