# janardhans56/s.t.i.p.s architecture

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

- Interactive diagram: https://gitdiagram.com/janardhans56/s.t.i.p.s
- Repository: https://github.com/janardhans56/s.t.i.p.s

## Overview

S.T.I.P.S is a campus community app: students and teachers sign in to a private community, then use its feed, polls, direct messages, and profile; office admins manage accounts and reports. The React pages call a same-origin API, whose Express routes enforce sessions and moderation and use Supabase for persistent data. Optional AI content screening is a separate integration. The graph follows documented capabilities and sampled routing/calls; unsampled route internals are represented without asserting their database behavior.

Main entry points: [`server/app.js`](https://github.com/janardhans56/s.t.i.p.s/blob/main/server/app.js) (Express API), [`src/components/Shell.jsx`](https://github.com/janardhans56/s.t.i.p.s/blob/main/src/components/Shell.jsx) (Community shell), [`server/db.js`](https://github.com/janardhans56/s.t.i.p.s/blob/main/server/db.js) (Database client), [`src/App.jsx`](https://github.com/janardhans56/s.t.i.p.s/blob/main/src/App.jsx) (App router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web experience"]
  node_app["App router<br/>[App.jsx]"]
  node_authui["Sign-in flow<br/>[Auth.jsx]"]
  node_shell["Community shell<br/>[Shell.jsx]"]
  node_feedui["Community feed<br/>[Feed.jsx]"]
  node_pollui["Polls and votes<br/>[Polls.jsx]"]
  node_messageui["Direct messages<br/>[Messages.jsx]"]
  node_createui["Create and admin<br/>[Create.jsx]"]
  node_profileui["Profile<br/>[Profile.jsx]"]
  node_clientapi["Fetch wrapper<br/>[api.js]"]
end

subgraph group_api["API and access"]
  node_express["Express API<br/>[app.js]"]
  node_session["Session guards<br/>[session.js]"]
  node_auth["Authentication routes<br/>[auth.js]"]
end

subgraph group_community["Community features"]
  node_posts["Post routes<br/>[posts.js]"]
  node_polls["Poll routes<br/>[polls.js]"]
  node_messages["Message routes<br/>[messages.js]"]
end

subgraph group_safety["Safety and office"]
  node_admin["Office management<br/>[admin.js]"]
  node_reports["Report routes<br/>[reports.js]"]
  node_moderation["Content screening<br/>[moderation.js]"]
end

subgraph group_storage["Persistent data"]
  node_dbclient["Database client<br/>[db.js]"]
  node_supabase[("Supabase data store")]
end

node_members(("Campus members"))
node_office(("Office admins"))
node_ai["Optional AI provider"]

node_members -->|"uses"| node_app
node_office -->|"uses"| node_app
node_app -->|"routes to"| node_authui
node_app -->|"routes to"| node_shell
node_shell -->|"navigates to"| node_feedui
node_shell -->|"navigates to"| node_pollui
node_shell -->|"navigates to"| node_messageui
node_shell -->|"navigates to"| node_profileui
node_shell -->|"navigates to"| node_createui
node_authui -->|"calls"| node_clientapi
node_messageui -->|"calls"| node_clientapi
node_app -->|"checks session"| node_clientapi
node_clientapi -->|"sends requests"| node_express
node_express -->|"mounts"| node_auth
node_express -->|"mounts"| node_posts
node_express -->|"mounts"| node_polls
node_express -->|"mounts"| node_messages
node_express -->|"mounts"| node_admin
node_express -->|"mounts"| node_reports
node_express -->|"guards routes"| node_session
node_auth -->|"sets sessions"| node_session
node_auth -->|"reads and writes"| node_dbclient
node_polls -->|"reads and writes"| node_dbclient
node_messages -->|"reads and writes"| node_dbclient
node_admin -->|"reads and writes"| node_dbclient
node_auth -->|"screens profile"| node_moderation
node_polls -->|"screens content"| node_moderation
node_messages -->|"screens content"| node_moderation
node_moderation -.->|"optionally checks"| node_ai
node_dbclient -->|"persists data"| node_supabase
node_posts -.->|"screens posts"| node_moderation
node_reports -.->|"manages reports"| node_dbclient

click node_app "https://github.com/janardhans56/s.t.i.p.s/blob/main/src/App.jsx"
click node_authui "https://github.com/janardhans56/s.t.i.p.s/blob/main/src/pages/Auth.jsx"
click node_shell "https://github.com/janardhans56/s.t.i.p.s/blob/main/src/components/Shell.jsx"
click node_feedui "https://github.com/janardhans56/s.t.i.p.s/blob/main/src/pages/Feed.jsx"
click node_pollui "https://github.com/janardhans56/s.t.i.p.s/blob/main/src/pages/Polls.jsx"
click node_messageui "https://github.com/janardhans56/s.t.i.p.s/blob/main/src/pages/Messages.jsx"
click node_createui "https://github.com/janardhans56/s.t.i.p.s/blob/main/src/pages/Create.jsx"
click node_profileui "https://github.com/janardhans56/s.t.i.p.s/blob/main/src/pages/Profile.jsx"
click node_clientapi "https://github.com/janardhans56/s.t.i.p.s/blob/main/src/api.js"
click node_express "https://github.com/janardhans56/s.t.i.p.s/blob/main/server/app.js"
click node_session "https://github.com/janardhans56/s.t.i.p.s/blob/main/server/session.js"
click node_auth "https://github.com/janardhans56/s.t.i.p.s/blob/main/server/routes/auth.js"
click node_posts "https://github.com/janardhans56/s.t.i.p.s/blob/main/server/routes/posts.js"
click node_polls "https://github.com/janardhans56/s.t.i.p.s/blob/main/server/routes/polls.js"
click node_messages "https://github.com/janardhans56/s.t.i.p.s/blob/main/server/routes/messages.js"
click node_admin "https://github.com/janardhans56/s.t.i.p.s/blob/main/server/routes/admin.js"
click node_reports "https://github.com/janardhans56/s.t.i.p.s/blob/main/server/routes/reports.js"
click node_moderation "https://github.com/janardhans56/s.t.i.p.s/blob/main/server/moderation.js"
click node_dbclient "https://github.com/janardhans56/s.t.i.p.s/blob/main/server/db.js"
click node_supabase "https://github.com/janardhans56/s.t.i.p.s/blob/main/supabase/migrations/20261116000001_baseline.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_app,node_authui,node_shell,node_feedui,node_pollui,node_messageui,node_createui,node_profileui,node_clientapi toneBlue
class node_express,node_session,node_auth toneAmber
class node_posts,node_polls,node_messages toneMint
class node_admin,node_reports,node_moderation toneRose
class node_dbclient,node_supabase,node_members,node_office,node_ai toneIndigo
```

## Components

### Web experience

- [App router](https://github.com/janardhans56/s.t.i.p.s/blob/main/src/App.jsx): `src/App.jsx`
- [Sign-in flow](https://github.com/janardhans56/s.t.i.p.s/blob/main/src/pages/Auth.jsx): `src/pages/Auth.jsx`
- [Community shell](https://github.com/janardhans56/s.t.i.p.s/blob/main/src/components/Shell.jsx): `src/components/Shell.jsx`
- [Community feed](https://github.com/janardhans56/s.t.i.p.s/blob/main/src/pages/Feed.jsx): `src/pages/Feed.jsx`
- [Polls and votes](https://github.com/janardhans56/s.t.i.p.s/blob/main/src/pages/Polls.jsx): `src/pages/Polls.jsx`
- [Direct messages](https://github.com/janardhans56/s.t.i.p.s/blob/main/src/pages/Messages.jsx): `src/pages/Messages.jsx`
- [Create and admin](https://github.com/janardhans56/s.t.i.p.s/blob/main/src/pages/Create.jsx): `src/pages/Create.jsx`
- [Profile](https://github.com/janardhans56/s.t.i.p.s/blob/main/src/pages/Profile.jsx): `src/pages/Profile.jsx`
- [Fetch wrapper](https://github.com/janardhans56/s.t.i.p.s/blob/main/src/api.js): `src/api.js`

### API and access

- [Express API](https://github.com/janardhans56/s.t.i.p.s/blob/main/server/app.js): `server/app.js`
- [Session guards](https://github.com/janardhans56/s.t.i.p.s/blob/main/server/session.js): `server/session.js`
- [Authentication routes](https://github.com/janardhans56/s.t.i.p.s/blob/main/server/routes/auth.js): `server/routes/auth.js`

### Community features

- [Post routes](https://github.com/janardhans56/s.t.i.p.s/blob/main/server/routes/posts.js): `server/routes/posts.js`
- [Poll routes](https://github.com/janardhans56/s.t.i.p.s/blob/main/server/routes/polls.js): `server/routes/polls.js`
- [Message routes](https://github.com/janardhans56/s.t.i.p.s/blob/main/server/routes/messages.js): `server/routes/messages.js`

### Safety and office

- [Office management](https://github.com/janardhans56/s.t.i.p.s/blob/main/server/routes/admin.js): `server/routes/admin.js`
- [Report routes](https://github.com/janardhans56/s.t.i.p.s/blob/main/server/routes/reports.js): `server/routes/reports.js`
- [Content screening](https://github.com/janardhans56/s.t.i.p.s/blob/main/server/moderation.js): `server/moderation.js`

### Persistent data

- [Database client](https://github.com/janardhans56/s.t.i.p.s/blob/main/server/db.js): `server/db.js`
- [Supabase data store](https://github.com/janardhans56/s.t.i.p.s/blob/main/supabase/migrations/20261116000001_baseline.sql): `supabase/migrations/20261116000001_baseline.sql`

### Other components

- **Campus members**
- **Office admins**
- **Optional AI provider**

## Connections

- Campus members → App router: uses (evidence: `README.md`)
- Office admins → App router: uses (evidence: `README.md`)
- App router → Sign-in flow: routes to (evidence: `src/App.jsx`)
- App router → Community shell: routes to (evidence: `src/App.jsx`)
- Community shell → Community feed: navigates to (evidence: `src/components/Shell.jsx`)
- Community shell → Polls and votes: navigates to (evidence: `src/components/Shell.jsx`)
- Community shell → Direct messages: navigates to (evidence: `src/components/Shell.jsx`)
- Community shell → Profile: navigates to (evidence: `src/components/Shell.jsx`)
- Community shell → Create and admin: navigates to (evidence: `src/components/Shell.jsx`)
- Sign-in flow → Fetch wrapper: calls (evidence: `src/pages/Auth.jsx`)
- Direct messages → Fetch wrapper: calls (evidence: `src/pages/Messages.jsx`)
- App router → Fetch wrapper: checks session (evidence: `src/App.jsx`)
- Fetch wrapper → Express API: sends requests (evidence: `README.md`)
- Express API → Authentication routes: mounts (evidence: `server/app.js`)
- Express API → Post routes: mounts (evidence: `server/app.js`)
- Express API → Poll routes: mounts (evidence: `server/app.js`)
- Express API → Message routes: mounts (evidence: `server/app.js`)
- Express API → Office management: mounts (evidence: `server/app.js`)
- Express API → Report routes: mounts (evidence: `server/app.js`)
- Express API → Session guards: guards routes (evidence: `server/app.js`)
- Authentication routes → Session guards: sets sessions (evidence: `server/routes/auth.js`)
- Authentication routes → Database client: reads and writes (evidence: `server/routes/auth.js`)
- Poll routes → Database client: reads and writes (evidence: `server/routes/polls.js`)
- Message routes → Database client: reads and writes (evidence: `server/routes/messages.js`)
- Office management → Database client: reads and writes (evidence: `server/routes/admin.js`)
- Authentication routes → Content screening: screens profile (evidence: `server/routes/auth.js`)
- Poll routes → Content screening: screens content (evidence: `server/routes/polls.js`)
- Message routes → Content screening: screens content (evidence: `server/routes/messages.js`)
- Content screening → Optional AI provider: optionally checks (evidence: `server/moderation.js`)
- Database client → Supabase data store: persists data (evidence: `README.md`)
- Post routes → Content screening: screens posts
- Report routes → Database client: manages reports
