# zhihui0715/mmu-studymate architecture

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

- Interactive diagram: https://gitdiagram.com/zhihui0715/mmu-studymate
- Repository: https://github.com/zhihui0715/mmu-studymate

## Overview

StudyMate is a Flask web app whose evidenced workflow is account signup and login: browser requests reach registered account routes, which validate form data, query or update user records, set the session, and return pages or redirects. On each request the app loads the session’s user for use by routes and templates. The source also shows logout and a landing page. The tree contains profile and other UI assets, but their behavior is not established by the excerpts; the chart script excerpt is empty, so those capabilities are not inferred.

Main entry points: [`routes/account.py`](https://github.com/zhihui0715/mmu-studymate/blob/main/routes/account.py) (Account routes), [`app.py`](https://github.com/zhihui0715/mmu-studymate/blob/main/app.py) (Flask app), [`database.py`](https://github.com/zhihui0715/mmu-studymate/blob/main/database.py) (User operations), [`routes/__init__.py`](https://github.com/zhihui0715/mmu-studymate/blob/main/routes/__init__.py) (Blueprint registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_flask_app["Flask app<br/>[app.py]"]
  node_route_registry["Blueprint registry<br/>[__init__.py]"]
  node_landing_template["Landing page<br/>[landing.html]"]
  node_login_template["Login page<br/>[login.html]"]
  node_signup_template["Signup page<br/>[signup.html]"]
end

subgraph group_accounts["Account workflows"]
  node_account_routes["Account routes<br/>[account.py]"]
  node_form_helpers["Form helpers<br/>[helpers.py]"]
end

subgraph group_data["User data"]
  node_user_data["User operations<br/>[database.py]"]
  node_sqlite[("SQLite database")]
end

node_visitor(("Browser user"))

node_visitor -->|"sends requests"| node_flask_app
node_flask_app -->|"registers routes"| node_route_registry
node_route_registry -->|"includes blueprint"| node_account_routes
node_flask_app -->|"loads session user"| node_user_data
node_account_routes -->|"validates input"| node_form_helpers
node_account_routes -->|"reads and writes"| node_user_data
node_user_data -->|"queries and updates"| node_sqlite
node_account_routes -->|"renders"| node_landing_template
node_account_routes -->|"renders"| node_login_template
node_account_routes -->|"renders"| node_signup_template
node_flask_app -->|"returns responses"| node_visitor

click node_flask_app "https://github.com/zhihui0715/mmu-studymate/blob/main/app.py"
click node_account_routes "https://github.com/zhihui0715/mmu-studymate/blob/main/routes/account.py"
click node_route_registry "https://github.com/zhihui0715/mmu-studymate/blob/main/routes/__init__.py"
click node_form_helpers "https://github.com/zhihui0715/mmu-studymate/blob/main/helpers.py"
click node_user_data "https://github.com/zhihui0715/mmu-studymate/blob/main/database.py"
click node_landing_template "https://github.com/zhihui0715/mmu-studymate/blob/main/templates/landing.html"
click node_login_template "https://github.com/zhihui0715/mmu-studymate/blob/main/templates/login.html"
click node_signup_template "https://github.com/zhihui0715/mmu-studymate/blob/main/templates/signup.html"

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_flask_app,node_route_registry,node_landing_template,node_login_template,node_signup_template,node_visitor toneBlue
class node_account_routes,node_form_helpers toneAmber
class node_user_data,node_sqlite toneMint
```

## Components

### Web application

- [Flask app](https://github.com/zhihui0715/mmu-studymate/blob/main/app.py): `app.py`
- [Blueprint registry](https://github.com/zhihui0715/mmu-studymate/blob/main/routes/__init__.py): `routes/__init__.py`
- [Landing page](https://github.com/zhihui0715/mmu-studymate/blob/main/templates/landing.html): `templates/landing.html`
- [Login page](https://github.com/zhihui0715/mmu-studymate/blob/main/templates/login.html): `templates/login.html`
- [Signup page](https://github.com/zhihui0715/mmu-studymate/blob/main/templates/signup.html): `templates/signup.html`

### Account workflows

- [Account routes](https://github.com/zhihui0715/mmu-studymate/blob/main/routes/account.py): `routes/account.py`
- [Form helpers](https://github.com/zhihui0715/mmu-studymate/blob/main/helpers.py): `helpers.py`

### User data

- [User operations](https://github.com/zhihui0715/mmu-studymate/blob/main/database.py): `database.py`
- **SQLite database**

### Other components

- **Browser user**

## Connections

- Browser user → Flask app: sends requests (evidence: `app.py`)
- Flask app → Blueprint registry: registers routes (evidence: `app.py`)
- Blueprint registry → Account routes: includes blueprint (evidence: `routes/__init__.py`)
- Flask app → User operations: loads session user (evidence: `app.py`)
- Account routes → Form helpers: validates input (evidence: `routes/account.py`)
- Account routes → User operations: reads and writes (evidence: `routes/account.py`)
- User operations → SQLite database: queries and updates (evidence: `database.py`)
- Account routes → Landing page: renders (evidence: `routes/account.py`)
- Account routes → Login page: renders (evidence: `routes/account.py`)
- Account routes → Signup page: renders (evidence: `routes/account.py`)
- Flask app → Browser user: returns responses (evidence: `app.py`)
