# jordan73737/chirp architecture

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

- Interactive diagram: https://gitdiagram.com/jordan73737/chirp
- Repository: https://github.com/jordan73737/chirp

## Overview

Chirp is a social networking web application. Users register or sign in, then create and interact with posts, manage profiles and friendships, and exchange messages; chat supports live delivery, typing indicators, and read receipts. Flask routes handle HTTP workflows, while Socket.IO handles real-time chat events. Both use SQLAlchemy-backed models for persistent state. The README also documents Google and Microsoft OAuth, though its implementation is not shown in the sampled source. The graph preserves that capability as an unverified optional integration; unsampled routes and templates are represented only at their existing directory paths.

Main entry points: [`app/routes.py`](https://github.com/jordan73737/chirp/blob/main/app/routes.py) (HTTP routes), [`app/models.py`](https://github.com/jordan73737/chirp/blob/main/app/models.py) (Domain models), [`app/__init__.py`](https://github.com/jordan73737/chirp/blob/main/app/__init__.py) (App factory), [`app/socket_events.py`](https://github.com/jordan73737/chirp/blob/main/app/socket_events.py) (Socket event handlers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app_factory["App factory<br/>[__init__.py]"]
  node_routes["HTTP routes<br/>[routes.py]"]
  node_forms["Validated forms<br/>[forms.py]"]
  node_templates["Web pages"]
  node_oauth["OAuth sign-in"]
end

subgraph group_social["Social features"]
  node_social_routes["Profiles and friendships<br/>[routes.py]"]
  node_feed_routes["Posts and feed<br/>[routes.py]"]
  node_notifications["Notifications<br/>[routes.py]"]
end

subgraph group_messaging["Real-time messaging"]
  node_socket_client["Browser socket client<br/>[socket.js]"]
  node_socket_handlers["Socket event handlers<br/>[socket_events.py]"]
end

subgraph group_state["Configuration and state"]
  node_config["App configuration<br/>[config.py]"]
  node_models["Domain models<br/>[models.py]"]
  node_database[("PostgreSQL database")]
  node_mail["Mail service"]
end

node_user(("User"))

node_user -->|"uses HTTP"| node_routes
node_app_factory -->|"loads settings"| node_config
node_app_factory -->|"registers routes"| node_routes
node_app_factory -->|"loads models"| node_models
node_app_factory -->|"loads handlers"| node_socket_handlers
node_routes -->|"uses forms"| node_forms
node_routes -->|"queries and updates"| node_models
node_routes -->|"renders pages"| node_templates
node_routes -.->|"sends email"| node_mail
node_user -->|"manages account"| node_social_routes
node_social_routes -->|"updates profiles"| node_models
node_feed_routes -->|"updates posts"| node_models
node_notifications -->|"reads and updates"| node_models
node_user -->|"chats in browser"| node_socket_client
node_socket_client -->|"emits socket events"| node_socket_handlers
node_socket_handlers -->|"stores messages"| node_models
node_routes -->|"commits route changes"| node_database
node_socket_handlers -->|"commits messages"| node_database
node_user -.->|"signs in"| node_oauth

click node_app_factory "https://github.com/jordan73737/chirp/blob/main/app/__init__.py"
click node_config "https://github.com/jordan73737/chirp/blob/main/config.py"
click node_routes "https://github.com/jordan73737/chirp/blob/main/app/routes.py"
click node_forms "https://github.com/jordan73737/chirp/blob/main/app/forms.py"
click node_templates "https://github.com/jordan73737/chirp/tree/main/app/templates"
click node_oauth "https://github.com/jordan73737/chirp/tree/main/app"
click node_social_routes "https://github.com/jordan73737/chirp/blob/main/app/routes.py"
click node_feed_routes "https://github.com/jordan73737/chirp/blob/main/app/routes.py"
click node_notifications "https://github.com/jordan73737/chirp/blob/main/app/routes.py"
click node_socket_client "https://github.com/jordan73737/chirp/blob/main/app/static/js/socket.js"
click node_socket_handlers "https://github.com/jordan73737/chirp/blob/main/app/socket_events.py"
click node_models "https://github.com/jordan73737/chirp/blob/main/app/models.py"

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_factory,node_routes,node_forms,node_templates,node_oauth,node_user toneBlue
class node_social_routes,node_feed_routes,node_notifications toneAmber
class node_socket_client,node_socket_handlers toneMint
class node_config,node_models,node_database,node_mail toneRose
```

## Components

### Web application

- [App factory](https://github.com/jordan73737/chirp/blob/main/app/__init__.py): `app/__init__.py`
- [HTTP routes](https://github.com/jordan73737/chirp/blob/main/app/routes.py): `app/routes.py`
- [Validated forms](https://github.com/jordan73737/chirp/blob/main/app/forms.py): `app/forms.py`
- [Web pages](https://github.com/jordan73737/chirp/tree/main/app/templates): `app/templates`
- [OAuth sign-in](https://github.com/jordan73737/chirp/tree/main/app): `app`

### Social features

- [Profiles and friendships](https://github.com/jordan73737/chirp/blob/main/app/routes.py): `app/routes.py`
- [Posts and feed](https://github.com/jordan73737/chirp/blob/main/app/routes.py): `app/routes.py`
- [Notifications](https://github.com/jordan73737/chirp/blob/main/app/routes.py): `app/routes.py`

### Real-time messaging

- [Browser socket client](https://github.com/jordan73737/chirp/blob/main/app/static/js/socket.js): `app/static/js/socket.js`
- [Socket event handlers](https://github.com/jordan73737/chirp/blob/main/app/socket_events.py): `app/socket_events.py`

### Configuration and state

- [App configuration](https://github.com/jordan73737/chirp/blob/main/config.py): `config.py`
- [Domain models](https://github.com/jordan73737/chirp/blob/main/app/models.py): `app/models.py`
- **PostgreSQL database**
- **Mail service**

### Other components

- **User**

## Connections

- User → HTTP routes: uses HTTP (evidence: `README.md`)
- App factory → App configuration: loads settings (evidence: `app/__init__.py`)
- App factory → HTTP routes: registers routes (evidence: `app/__init__.py`)
- App factory → Domain models: loads models (evidence: `app/__init__.py`)
- App factory → Socket event handlers: loads handlers (evidence: `app/__init__.py`)
- HTTP routes → Validated forms: uses forms (evidence: `app/routes.py`)
- HTTP routes → Domain models: queries and updates (evidence: `app/routes.py`)
- HTTP routes → Web pages: renders pages (evidence: `app/routes.py`)
- HTTP routes → Mail service: sends email
- User → Profiles and friendships: manages account (evidence: `README.md`)
- Profiles and friendships → Domain models: updates profiles (evidence: `app/routes.py`)
- Posts and feed → Domain models: updates posts (evidence: `app/routes.py`)
- Notifications → Domain models: reads and updates (evidence: `app/routes.py`)
- User → Browser socket client: chats in browser (evidence: `app/static/js/socket.js`)
- Browser socket client → Socket event handlers: emits socket events (evidence: `app/static/js/socket.js`)
- Socket event handlers → Domain models: stores messages (evidence: `app/socket_events.py`)
- HTTP routes → PostgreSQL database: commits route changes (evidence: `app/routes.py`)
- Socket event handlers → PostgreSQL database: commits messages (evidence: `app/socket_events.py`)
- User → OAuth sign-in: signs in (evidence: `README.md`)
