# aylinrsl/fswd-team3 architecture

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

- Interactive diagram: https://gitdiagram.com/aylinrsl/fswd-team3
- Repository: https://github.com/aylinrsl/fswd-team3

## Overview

StudyNet is a Flask platform for support and community in student residences. The main workflow is resident registration with university-email and dormitory-code checks, followed by login and posting, browsing, and managing categorized requests or offers, including open/done status. The README also lists private messages, but the sampled chat route only renders a page, so its implementation and data flow are unclear. The graph reflects shown route and database calls; documented but unsampled capabilities are retained without guessed connections.

Main entry points: [`webapp/app.py`](https://github.com/aylinrsl/fswd-team3/blob/main/webapp/app.py) (Flask routes), [`webapp/database.py`](https://github.com/aylinrsl/fswd-team3/blob/main/webapp/database.py) (Database access), [`webapp/posts.py`](https://github.com/aylinrsl/fswd-team3/blob/main/webapp/posts.py) (Post management), [`webapp/auth.py`](https://github.com/aylinrsl/fswd-team3/blob/main/webapp/auth.py) (Session authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_flask_app["Flask routes<br/>[app.py]"]
  node_pages["Site pages"]
  node_profile["Resident profile<br/>[app.py]"]
  node_contact["Contact form<br/>[app.py]"]
end

subgraph group_identity["Identity and validation"]
  node_registration["Registration and login<br/>[app.py]"]
  node_forms["Form validation<br/>[forms.py]"]
  node_session_auth["Session authentication<br/>[auth.py]"]
end

subgraph group_posts["Community posts"]
  node_listing["Request listing<br/>[app.py]"]
  node_post_crud["Post management<br/>[posts.py]"]
  node_chat["Private messages<br/>[chat.html]"]
end

subgraph group_data["Persistence and contact"]
  node_database_api["Database access<br/>[database.py]"]
  node_sqlite[("SQLite database")]
  node_schema["Database schema<br/>[create_tables.sql]"]
end

node_resident(("Resident"))
node_mail["Mail service"]

node_resident -->|"uses"| node_flask_app
node_flask_app -->|"renders"| node_pages
node_flask_app -->|"registers"| node_post_crud
node_flask_app -->|"loads user"| node_session_auth
node_flask_app -->|"routes to"| node_registration
node_registration -->|"validates with"| node_forms
node_registration -->|"queries"| node_database_api
node_session_auth -->|"loads user"| node_database_api
node_flask_app -->|"routes to"| node_listing
node_listing -->|"queries"| node_database_api
node_post_crud -->|"requires login"| node_session_auth
node_post_crud -->|"validates with"| node_forms
node_post_crud -->|"reads and writes"| node_database_api
node_profile -->|"renders"| node_pages
node_contact -->|"validates with"| node_forms
node_contact -->|"sends email"| node_mail
node_database_api -->|"accesses"| node_sqlite
node_database_api -->|"loads schema"| node_schema

click node_flask_app "https://github.com/aylinrsl/fswd-team3/blob/main/webapp/app.py"
click node_pages "https://github.com/aylinrsl/fswd-team3/tree/main/webapp/templates"
click node_registration "https://github.com/aylinrsl/fswd-team3/blob/main/webapp/app.py"
click node_forms "https://github.com/aylinrsl/fswd-team3/blob/main/webapp/forms.py"
click node_session_auth "https://github.com/aylinrsl/fswd-team3/blob/main/webapp/auth.py"
click node_listing "https://github.com/aylinrsl/fswd-team3/blob/main/webapp/app.py"
click node_post_crud "https://github.com/aylinrsl/fswd-team3/blob/main/webapp/posts.py"
click node_chat "https://github.com/aylinrsl/fswd-team3/blob/main/webapp/templates/chat.html"
click node_profile "https://github.com/aylinrsl/fswd-team3/blob/main/webapp/app.py"
click node_contact "https://github.com/aylinrsl/fswd-team3/blob/main/webapp/app.py"
click node_database_api "https://github.com/aylinrsl/fswd-team3/blob/main/webapp/database.py"
click node_schema "https://github.com/aylinrsl/fswd-team3/blob/main/webapp/sql/create_tables.sql"

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_pages,node_profile,node_contact toneBlue
class node_registration,node_forms,node_session_auth toneAmber
class node_listing,node_post_crud,node_chat toneMint
class node_database_api,node_sqlite,node_schema toneRose
class node_resident,node_mail toneIndigo
```

## Components

### Web application

- [Flask routes](https://github.com/aylinrsl/fswd-team3/blob/main/webapp/app.py): `webapp/app.py`
- [Site pages](https://github.com/aylinrsl/fswd-team3/tree/main/webapp/templates): `webapp/templates`
- [Resident profile](https://github.com/aylinrsl/fswd-team3/blob/main/webapp/app.py): `webapp/app.py`
- [Contact form](https://github.com/aylinrsl/fswd-team3/blob/main/webapp/app.py): `webapp/app.py`

### Identity and validation

- [Registration and login](https://github.com/aylinrsl/fswd-team3/blob/main/webapp/app.py): `webapp/app.py`
- [Form validation](https://github.com/aylinrsl/fswd-team3/blob/main/webapp/forms.py): `webapp/forms.py`
- [Session authentication](https://github.com/aylinrsl/fswd-team3/blob/main/webapp/auth.py): `webapp/auth.py`

### Community posts

- [Request listing](https://github.com/aylinrsl/fswd-team3/blob/main/webapp/app.py): `webapp/app.py`
- [Post management](https://github.com/aylinrsl/fswd-team3/blob/main/webapp/posts.py): `webapp/posts.py`
- [Private messages](https://github.com/aylinrsl/fswd-team3/blob/main/webapp/templates/chat.html): `webapp/templates/chat.html`

### Persistence and contact

- [Database access](https://github.com/aylinrsl/fswd-team3/blob/main/webapp/database.py): `webapp/database.py`
- **SQLite database**
- [Database schema](https://github.com/aylinrsl/fswd-team3/blob/main/webapp/sql/create_tables.sql): `webapp/sql/create_tables.sql`

### Other components

- **Resident**
- **Mail service**

## Connections

- Resident → Flask routes: uses (evidence: `README.md`)
- Flask routes → Site pages: renders (evidence: `webapp/app.py`)
- Flask routes → Post management: registers (evidence: `webapp/app.py`)
- Flask routes → Session authentication: loads user (evidence: `webapp/app.py`)
- Flask routes → Registration and login: routes to (evidence: `webapp/app.py`)
- Registration and login → Form validation: validates with (evidence: `webapp/app.py`)
- Registration and login → Database access: queries (evidence: `webapp/app.py`)
- Session authentication → Database access: loads user (evidence: `webapp/auth.py`)
- Flask routes → Request listing: routes to (evidence: `webapp/app.py`)
- Request listing → Database access: queries (evidence: `webapp/app.py`)
- Post management → Session authentication: requires login (evidence: `webapp/posts.py`)
- Post management → Form validation: validates with (evidence: `webapp/posts.py`)
- Post management → Database access: reads and writes (evidence: `webapp/posts.py`)
- Resident profile → Site pages: renders (evidence: `webapp/app.py`)
- Contact form → Form validation: validates with (evidence: `webapp/app.py`)
- Contact form → Mail service: sends email (evidence: `webapp/app.py`)
- Database access → SQLite database: accesses (evidence: `webapp/database.py`)
- Database access → Database schema: loads schema (evidence: `webapp/database.py`)
