# yash-05082006/rivet architecture

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

- Interactive diagram: https://gitdiagram.com/yash-05082006/rivet
- Repository: https://github.com/yash-05082006/rivet

## Overview

RIVET is an enterprise work-management application for employee activity logs, configurable modules, approvals, campaigns, and role-based administration. The main user workflow is to sign in, create or update work in a module, submit it for review, and receive an approval decision; managers review submissions, while administrators manage access and audit activity. The sampled store and demo data show that application state currently uses in-memory seed data and localStorage rather than a connected backend. The README describes a marketing-site deliverable, but the supplied source tree and excerpts document a substantial internal application; unsampled route behavior is represented only where paths or references support it.

Main entry points: [`src/lib/rivet/store.tsx`](https://github.com/yash-05082006/rivet/blob/main/src/lib/rivet/store.tsx) (Session and state), [`src/routes/app.tsx`](https://github.com/yash-05082006/rivet/blob/main/src/routes/app.tsx) (Application shell), [`src/lib/rivet/permissions.ts`](https://github.com/yash-05082006/rivet/blob/main/src/lib/rivet/permissions.ts) (Role permissions), [`src/routes/app/modules/$moduleKey/index.tsx`](https://github.com/yash-05082006/rivet/blob/main/src/routes/app/modules/%24moduleKey/index.tsx) (Module workspace)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routing["Application routing"]
  node_router["Router setup<br/>[router.tsx]"]
  node_route_tree["Route registry<br/>[routeTree.gen.ts]"]
  node_app_shell["Application shell<br/>[app.tsx]"]
  node_auth_routes["Sign-in and sign-up<br/>[sign-in.tsx]"]
end

subgraph group_work["Work and review"]
  node_work_entries["My work<br/>[work.tsx]"]
  node_modules["Module workspace<br/>[index.tsx]"]
  node_entry_form["Entry form<br/>[EntryForm.tsx]"]
  node_approval_queue["Approval queue<br/>[index.tsx]"]
  node_approval_detail["Approval detail<br/>[$entryId.tsx]"]
  node_campaigns["Campaigns<br/>[index.tsx]"]
end

subgraph group_state["State and access"]
  node_state_store[("Session and state<br/>[store.tsx]")]
  node_demo_data["Demo domain data<br/>[demo-data.ts]"]
  node_permissions["Role permissions<br/>[permissions.ts]"]
  node_navigation["Permission-aware navigation<br/>[nav.ts]"]
  node_domain_types["Domain types<br/>[types.ts]"]
end

subgraph group_operations["Operations and insights"]
  node_dashboard["Role dashboards"]
  node_admin["Administration<br/>[audit.tsx]"]
  node_reports["Reports<br/>[reports.tsx]"]
  node_notifications["Notifications<br/>[notifications.tsx]"]
end

node_user(("Employee or manager"))

node_router -->|"loads routes"| node_route_tree
node_route_tree -->|"registers route"| node_app_shell
node_user -.->|"signs in"| node_auth_routes
node_app_shell -->|"reads session"| node_state_store
node_app_shell -.->|"builds navigation"| node_navigation
node_work_entries -->|"reads work"| node_state_store
node_modules -->|"reads module data"| node_state_store
node_modules -->|"renders form"| node_entry_form
node_entry_form -->|"saves entries"| node_state_store
node_approval_queue -->|"reads submissions"| node_state_store
node_approval_detail -->|"reviews entries"| node_state_store
node_campaigns -->|"reads campaigns"| node_state_store
node_dashboard -->|"reads summaries"| node_state_store
node_admin -->|"reads audit data"| node_state_store
node_notifications -->|"reads notifications"| node_state_store
node_state_store -->|"checks access"| node_permissions
node_permissions -->|"looks up modules"| node_demo_data
node_state_store -->|"loads seed data"| node_demo_data
node_state_store -->|"uses domain shapes"| node_domain_types
node_navigation -->|"filters navigation"| node_permissions

click node_router "https://github.com/yash-05082006/rivet/blob/main/src/router.tsx"
click node_route_tree "https://github.com/yash-05082006/rivet/blob/main/src/routeTree.gen.ts"
click node_app_shell "https://github.com/yash-05082006/rivet/blob/main/src/routes/app.tsx"
click node_auth_routes "https://github.com/yash-05082006/rivet/blob/main/src/routes/sign-in.tsx"
click node_work_entries "https://github.com/yash-05082006/rivet/blob/main/src/routes/app/work.tsx"
click node_modules "https://github.com/yash-05082006/rivet/blob/main/src/routes/app/modules/%24moduleKey/index.tsx"
click node_entry_form "https://github.com/yash-05082006/rivet/blob/main/src/components/work/EntryForm.tsx"
click node_approval_queue "https://github.com/yash-05082006/rivet/blob/main/src/routes/app/approvals/index.tsx"
click node_approval_detail "https://github.com/yash-05082006/rivet/blob/main/src/routes/app/approvals/%24entryId.tsx"
click node_campaigns "https://github.com/yash-05082006/rivet/blob/main/src/routes/app/campaigns/index.tsx"
click node_dashboard "https://github.com/yash-05082006/rivet/blob/main/src/components/dashboard/EmployeeDashboard.tsx"
click node_admin "https://github.com/yash-05082006/rivet/blob/main/src/routes/app/admin/audit.tsx"
click node_reports "https://github.com/yash-05082006/rivet/blob/main/src/routes/app/reports.tsx"
click node_notifications "https://github.com/yash-05082006/rivet/blob/main/src/routes/app/notifications.tsx"
click node_state_store "https://github.com/yash-05082006/rivet/blob/main/src/lib/rivet/store.tsx"
click node_demo_data "https://github.com/yash-05082006/rivet/blob/main/src/lib/rivet/demo-data.ts"
click node_permissions "https://github.com/yash-05082006/rivet/blob/main/src/lib/rivet/permissions.ts"
click node_navigation "https://github.com/yash-05082006/rivet/blob/main/src/lib/rivet/nav.ts"
click node_domain_types "https://github.com/yash-05082006/rivet/blob/main/src/lib/rivet/types.ts"

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_router,node_route_tree,node_app_shell,node_auth_routes toneBlue
class node_work_entries,node_modules,node_entry_form,node_approval_queue,node_approval_detail,node_campaigns toneAmber
class node_state_store,node_demo_data,node_permissions,node_navigation,node_domain_types toneMint
class node_dashboard,node_admin,node_reports,node_notifications toneRose
class node_user toneIndigo
```

## Components

### Application routing

- [Router setup](https://github.com/yash-05082006/rivet/blob/main/src/router.tsx): `src/router.tsx`
- [Route registry](https://github.com/yash-05082006/rivet/blob/main/src/routeTree.gen.ts): `src/routeTree.gen.ts`
- [Application shell](https://github.com/yash-05082006/rivet/blob/main/src/routes/app.tsx): `src/routes/app.tsx`
- [Sign-in and sign-up](https://github.com/yash-05082006/rivet/blob/main/src/routes/sign-in.tsx): `src/routes/sign-in.tsx`

### Work and review

- [My work](https://github.com/yash-05082006/rivet/blob/main/src/routes/app/work.tsx): `src/routes/app/work.tsx`
- [Module workspace](https://github.com/yash-05082006/rivet/blob/main/src/routes/app/modules/%24moduleKey/index.tsx): `src/routes/app/modules/$moduleKey/index.tsx`
- [Entry form](https://github.com/yash-05082006/rivet/blob/main/src/components/work/EntryForm.tsx): `src/components/work/EntryForm.tsx`
- [Approval queue](https://github.com/yash-05082006/rivet/blob/main/src/routes/app/approvals/index.tsx): `src/routes/app/approvals/index.tsx`
- [Approval detail](https://github.com/yash-05082006/rivet/blob/main/src/routes/app/approvals/%24entryId.tsx): `src/routes/app/approvals/$entryId.tsx`
- [Campaigns](https://github.com/yash-05082006/rivet/blob/main/src/routes/app/campaigns/index.tsx): `src/routes/app/campaigns/index.tsx`

### State and access

- [Session and state](https://github.com/yash-05082006/rivet/blob/main/src/lib/rivet/store.tsx): `src/lib/rivet/store.tsx`
- [Demo domain data](https://github.com/yash-05082006/rivet/blob/main/src/lib/rivet/demo-data.ts): `src/lib/rivet/demo-data.ts`
- [Role permissions](https://github.com/yash-05082006/rivet/blob/main/src/lib/rivet/permissions.ts): `src/lib/rivet/permissions.ts`
- [Permission-aware navigation](https://github.com/yash-05082006/rivet/blob/main/src/lib/rivet/nav.ts): `src/lib/rivet/nav.ts`
- [Domain types](https://github.com/yash-05082006/rivet/blob/main/src/lib/rivet/types.ts): `src/lib/rivet/types.ts`

### Operations and insights

- [Role dashboards](https://github.com/yash-05082006/rivet/blob/main/src/components/dashboard/EmployeeDashboard.tsx): `src/components/dashboard/EmployeeDashboard.tsx`
- [Administration](https://github.com/yash-05082006/rivet/blob/main/src/routes/app/admin/audit.tsx): `src/routes/app/admin/audit.tsx`
- [Reports](https://github.com/yash-05082006/rivet/blob/main/src/routes/app/reports.tsx): `src/routes/app/reports.tsx`
- [Notifications](https://github.com/yash-05082006/rivet/blob/main/src/routes/app/notifications.tsx): `src/routes/app/notifications.tsx`

### Other components

- **Employee or manager**

## Connections

- Router setup → Route registry: loads routes (evidence: `src/router.tsx`)
- Route registry → Application shell: registers route (evidence: `src/routeTree.gen.ts`)
- Employee or manager → Sign-in and sign-up: signs in
- Application shell → Session and state: reads session (evidence: `src/routes/app.tsx`)
- Application shell → Permission-aware navigation: builds navigation (evidence: `src/routes/app.tsx`)
- My work → Session and state: reads work (evidence: `src/routes/app/work.tsx`)
- Module workspace → Session and state: reads module data (evidence: `src/routes/app/modules/$moduleKey/index.tsx`)
- Module workspace → Entry form: renders form
- Entry form → Session and state: saves entries (evidence: `src/components/work/EntryForm.tsx`)
- Approval queue → Session and state: reads submissions (evidence: `src/routes/app/approvals/index.tsx`)
- Approval detail → Session and state: reviews entries (evidence: `src/routes/app/approvals/$entryId.tsx`)
- Campaigns → Session and state: reads campaigns (evidence: `src/routes/app/campaigns/index.tsx`)
- Role dashboards → Session and state: reads summaries (evidence: `src/components/dashboard/EmployeeDashboard.tsx`)
- Administration → Session and state: reads audit data (evidence: `src/routes/app/admin/audit.tsx`)
- Notifications → Session and state: reads notifications (evidence: `src/routes/app/notifications.tsx`)
- Session and state → Role permissions: checks access (evidence: `src/lib/rivet/store.tsx`)
- Role permissions → Demo domain data: looks up modules (evidence: `src/lib/rivet/permissions.ts`)
- Session and state → Demo domain data: loads seed data (evidence: `src/lib/rivet/store.tsx`)
- Session and state → Domain types: uses domain shapes (evidence: `src/lib/rivet/store.tsx`)
- Permission-aware navigation → Role permissions: filters navigation (evidence: `src/lib/rivet/nav.ts`)
