# hetianhejin/teachat architecture

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

- Interactive diagram: https://gitdiagram.com/hetianhejin/teachat
- Repository: https://github.com/hetianhejin/teachat

## Overview

Teachat is a task-oriented team social application for coordinating small service work. A participant enters through the web app, forms an objective, responds with a project, discusses it in threads and records positions; work can then be captured through structured action records, with skills and outcomes contributing to evaluation. Teams are the activity actors, while user and family features provide relationship context. The README also describes group management, service offerings, messaging, notifications, search and fairness mechanisms. The available source excerpts show routing, authentication and DAO/database behavior; links within unsampled product areas are based on documented capabilities and route registration.

Main entry points: [`main.go`](https://github.com/hetianhejin/teachat/blob/main/main.go) (HTTP application), [`DAO/thread.go`](https://github.com/hetianhejin/teachat/blob/main/DAO/thread.go) (Discussion records), [`Route/route_search.go`](https://github.com/hetianhejin/teachat/blob/main/Route/route_search.go) (Search), [`DAO/user.go`](https://github.com/hetianhejin/teachat/blob/main/DAO/user.go) (User records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry"]
  node_webapp["HTTP application<br/>[main.go]"]
end

subgraph group_identity["Identity and teams"]
  node_auth["Authentication"]
  node_sessions[("Session records<br/>[session.go]")]
  node_users[("User records<br/>[user.go]")]
  node_families[("Family relations<br/>[family.go]")]
  node_teamroutes["Team membership"]
  node_teamdata[("Teams and groups<br/>[team.go]")]
  node_groupdata[("Group records<br/>[group.go]")]
end

subgraph group_collaboration["Task collaboration"]
  node_objectives["Objectives"]
  node_projects["Projects"]
  node_threads["Discussion threads"]
  node_talkdata[("Discussion records<br/>[thread.go]")]
end

subgraph group_work["Work and evaluation"]
  node_actionroutes["Work actions"]
  node_skilldata[("Skills and records<br/>[skill.go]")]
  node_evaluation[("Scoring and reviews<br/>[order_score.go]")]
  node_offerings[("Service offerings")]
  node_offerroutes["Offering workflow<br/>[route_team.go]"]
end

subgraph group_shared["Shared services"]
  node_search["Search<br/>[route_search.go]"]
  node_messages["Messages and notices"]
  node_messagedata[("Message records<br/>[message.go]")]
  node_notifications["Notifications"]
end

node_participant(("Participant"))
node_database[("PostgreSQL")]

node_participant -->|"uses"| node_webapp
node_webapp -->|"dispatches"| node_auth
node_webapp -->|"dispatches"| node_teamroutes
node_webapp -->|"dispatches"| node_objectives
node_webapp -->|"dispatches"| node_projects
node_webapp -->|"dispatches"| node_threads
node_webapp -->|"dispatches"| node_actionroutes
node_webapp -->|"dispatches"| node_offerroutes
node_webapp -->|"dispatches"| node_search
node_webapp -->|"dispatches"| node_messages
node_webapp -->|"dispatches"| node_notifications
node_auth -->|"reads and creates"| node_users
node_auth -->|"creates and checks"| node_sessions
node_teamroutes -->|"reads and updates"| node_teamdata
node_teamroutes -->|"reads"| node_users
node_objectives -->|"records"| node_talkdata
node_projects -->|"records"| node_talkdata
node_threads -->|"records"| node_talkdata
node_actionroutes -->|"records work"| node_skilldata
node_evaluation -->|"reads and writes"| node_database
node_offerroutes -->|"manages lifecycle"| node_offerings
node_search -->|"searches"| node_users
node_search -->|"searches"| node_teamdata
node_search -->|"searches"| node_talkdata
node_messages -->|"reads and writes"| node_messagedata
node_notifications -->|"accesses records"| node_database
node_sessions -->|"reads and writes"| node_database
node_users -->|"reads and writes"| node_database
node_families -->|"reads and writes"| node_database
node_teamdata -->|"reads and writes"| node_database
node_groupdata -->|"reads and writes"| node_database
node_talkdata -->|"reads and writes"| node_database
node_skilldata -->|"reads and writes"| node_database
node_offerings -->|"reads and writes"| node_database
node_messagedata -->|"reads and writes"| node_database

click node_webapp "https://github.com/hetianhejin/teachat/blob/main/main.go"
click node_auth "https://github.com/hetianhejin/teachat/blob/main/Route/route_authenticate.go"
click node_sessions "https://github.com/hetianhejin/teachat/blob/main/DAO/session.go"
click node_users "https://github.com/hetianhejin/teachat/blob/main/DAO/user.go"
click node_families "https://github.com/hetianhejin/teachat/blob/main/DAO/family.go"
click node_teamroutes "https://github.com/hetianhejin/teachat/blob/main/Route/route_team_member.go"
click node_teamdata "https://github.com/hetianhejin/teachat/blob/main/DAO/team.go"
click node_groupdata "https://github.com/hetianhejin/teachat/blob/main/DAO/group.go"
click node_objectives "https://github.com/hetianhejin/teachat/blob/main/Route/route_talk_objective.go"
click node_projects "https://github.com/hetianhejin/teachat/blob/main/Route/route_talk_project.go"
click node_threads "https://github.com/hetianhejin/teachat/blob/main/Route/route_talk_thread.go"
click node_talkdata "https://github.com/hetianhejin/teachat/blob/main/DAO/thread.go"
click node_actionroutes "https://github.com/hetianhejin/teachat/tree/main/Route"
click node_skilldata "https://github.com/hetianhejin/teachat/blob/main/DAO/skill.go"
click node_evaluation "https://github.com/hetianhejin/teachat/blob/main/DAO/order_score.go"
click node_offerings "https://github.com/hetianhejin/teachat/blob/main/DAO/team_service_offering.go"
click node_offerroutes "https://github.com/hetianhejin/teachat/blob/main/Route/route_team.go"
click node_search "https://github.com/hetianhejin/teachat/blob/main/Route/route_search.go"
click node_messages "https://github.com/hetianhejin/teachat/blob/main/Route/route_message_box.go"
click node_messagedata "https://github.com/hetianhejin/teachat/blob/main/DAO/message.go"
click node_notifications "https://github.com/hetianhejin/teachat/blob/main/Route/route_notification.go"

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_webapp toneBlue
class node_auth,node_sessions,node_users,node_families,node_teamroutes,node_teamdata,node_groupdata,node_database toneAmber
class node_objectives,node_projects,node_threads,node_talkdata toneMint
class node_actionroutes,node_skilldata,node_evaluation,node_offerings,node_offerroutes toneRose
class node_search,node_messages,node_messagedata,node_notifications,node_participant toneIndigo
```

## Components

### Web entry

- [HTTP application](https://github.com/hetianhejin/teachat/blob/main/main.go): `main.go`

### Identity and teams

- [Authentication](https://github.com/hetianhejin/teachat/blob/main/Route/route_authenticate.go): `Route/route_authenticate.go`
- [Session records](https://github.com/hetianhejin/teachat/blob/main/DAO/session.go): `DAO/session.go`
- [User records](https://github.com/hetianhejin/teachat/blob/main/DAO/user.go): `DAO/user.go`
- [Family relations](https://github.com/hetianhejin/teachat/blob/main/DAO/family.go): `DAO/family.go`
- [Team membership](https://github.com/hetianhejin/teachat/blob/main/Route/route_team_member.go): `Route/route_team_member.go`
- [Teams and groups](https://github.com/hetianhejin/teachat/blob/main/DAO/team.go): `DAO/team.go`
- [Group records](https://github.com/hetianhejin/teachat/blob/main/DAO/group.go): `DAO/group.go`

### Task collaboration

- [Objectives](https://github.com/hetianhejin/teachat/blob/main/Route/route_talk_objective.go): `Route/route_talk_objective.go`
- [Projects](https://github.com/hetianhejin/teachat/blob/main/Route/route_talk_project.go): `Route/route_talk_project.go`
- [Discussion threads](https://github.com/hetianhejin/teachat/blob/main/Route/route_talk_thread.go): `Route/route_talk_thread.go`
- [Discussion records](https://github.com/hetianhejin/teachat/blob/main/DAO/thread.go): `DAO/thread.go`

### Work and evaluation

- [Work actions](https://github.com/hetianhejin/teachat/tree/main/Route): `Route`
- [Skills and records](https://github.com/hetianhejin/teachat/blob/main/DAO/skill.go): `DAO/skill.go`
- [Scoring and reviews](https://github.com/hetianhejin/teachat/blob/main/DAO/order_score.go): `DAO/order_score.go`
- [Service offerings](https://github.com/hetianhejin/teachat/blob/main/DAO/team_service_offering.go): `DAO/team_service_offering.go`
- [Offering workflow](https://github.com/hetianhejin/teachat/blob/main/Route/route_team.go): `Route/route_team.go`

### Shared services

- [Search](https://github.com/hetianhejin/teachat/blob/main/Route/route_search.go): `Route/route_search.go`
- [Messages and notices](https://github.com/hetianhejin/teachat/blob/main/Route/route_message_box.go): `Route/route_message_box.go`
- [Message records](https://github.com/hetianhejin/teachat/blob/main/DAO/message.go): `DAO/message.go`
- [Notifications](https://github.com/hetianhejin/teachat/blob/main/Route/route_notification.go): `Route/route_notification.go`

### Other components

- **Participant**
- **PostgreSQL**

## Connections

- Participant → HTTP application: uses
- HTTP application → Authentication: dispatches
- HTTP application → Team membership: dispatches
- HTTP application → Objectives: dispatches
- HTTP application → Projects: dispatches
- HTTP application → Discussion threads: dispatches
- HTTP application → Work actions: dispatches
- HTTP application → Offering workflow: dispatches
- HTTP application → Search: dispatches
- HTTP application → Messages and notices: dispatches
- HTTP application → Notifications: dispatches
- Authentication → User records: reads and creates
- Authentication → Session records: creates and checks
- Team membership → Teams and groups: reads and updates
- Team membership → User records: reads
- Objectives → Discussion records: records
- Projects → Discussion records: records
- Discussion threads → Discussion records: records
- Work actions → Skills and records: records work
- Scoring and reviews → PostgreSQL: reads and writes
- Offering workflow → Service offerings: manages lifecycle
- Search → User records: searches
- Search → Teams and groups: searches
- Search → Discussion records: searches
- Messages and notices → Message records: reads and writes
- Notifications → PostgreSQL: accesses records
- Session records → PostgreSQL: reads and writes
- User records → PostgreSQL: reads and writes
- Family relations → PostgreSQL: reads and writes
- Teams and groups → PostgreSQL: reads and writes
- Group records → PostgreSQL: reads and writes
- Discussion records → PostgreSQL: reads and writes
- Skills and records → PostgreSQL: reads and writes
- Service offerings → PostgreSQL: reads and writes
- Message records → PostgreSQL: reads and writes
