# hiteshponnappa17/repwise architecture

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

- Interactive diagram: https://gitdiagram.com/hiteshponnappa17/repwise
- Repository: https://github.com/hiteshponnappa17/repwise

## Overview

Repwise is a gym-management application for owners and staff. The main workflow is staff use the dashboard to manage members, memberships, attendance and payments; API routes authenticate and scope requests, domain handlers perform operational work, and records persist in PostgreSQL. Separate branches cover leads, reporting and exports, backups, and member self-service. The README documents these capabilities; the sampled routes show selected route-to-domain calls. Other connections are omitted where implementation wiring was not shown.

Main entry points: [`src/app/api`](https://github.com/hiteshponnappa17/repwise/tree/feat/rewise-rebrand-export-backup/src/app/api) (HTTP API routes), [`src/app/dashboard/members/page.tsx`](https://github.com/hiteshponnappa17/repwise/blob/feat/rewise-rebrand-export-backup/src/app/dashboard/members/page.tsx) (Member workspace), [`src/app/dashboard/page.tsx`](https://github.com/hiteshponnappa17/repwise/blob/feat/rewise-rebrand-export-backup/src/app/dashboard/page.tsx) (Operations dashboard), [`src/app/dashboard/payments/page.tsx`](https://github.com/hiteshponnappa17/repwise/blob/feat/rewise-rebrand-export-backup/src/app/dashboard/payments/page.tsx) (Payments and bills)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User experience"]
  node_dashboard["Operations dashboard<br/>[page.tsx]"]
  node_members_ui["Member workspace<br/>[page.tsx]"]
  node_finance_ui["Payments and bills<br/>[page.tsx]"]
  node_leads_ui["Lead workspace<br/>[page.tsx]"]
  node_member_portal["Member portal<br/>[page.tsx]"]
end

subgraph group_api["API and access"]
  node_api_routes["HTTP API routes"]
  node_access["Authentication and permissions<br/>[auth.ts]"]
  node_api_common["API handling<br/>[api-handler.ts]"]
end

subgraph group_operations["Gym operations"]
  node_member_ops["Member management"]
  node_membership_ops["Plans and renewals"]
  node_attendance_ops["Attendance tracking"]
  node_payment_ops["Payment processing"]
  node_leads_ops["Lead follow-up<br/>[service.ts]"]
end

subgraph group_insights["Reporting and records"]
  node_analytics["Business analytics"]
  node_export["Data export<br/>[member-export.ts]"]
end

subgraph group_platform["Platform services"]
  node_backup["Backup management<br/>[route.ts]"]
  node_settings["Gym settings<br/>[service.ts]"]
  node_database[("Operational records<br/>[prisma.ts]")]
end

node_staff(("Gym staff"))
node_postgres[("PostgreSQL")]

node_staff -->|"uses"| node_dashboard
node_staff -->|"manages members"| node_members_ui
node_staff -->|"records payments"| node_finance_ui
node_staff -->|"tracks leads"| node_leads_ui
node_members_ui -.->|"supports self-service"| node_member_portal
node_dashboard -.->|"requests data"| node_api_routes
node_members_ui -.->|"requests member data"| node_api_routes
node_finance_ui -.->|"requests finance data"| node_api_routes
node_api_routes -->|"authenticates"| node_access
node_api_routes -->|"uses helpers"| node_api_common
node_api_routes -->|"handles member requests"| node_member_ops
node_api_routes -->|"lists plans"| node_membership_ops
node_api_routes -->|"handles check-ins"| node_attendance_ops
node_api_routes -->|"handles lead requests"| node_leads_ops
node_staff -->|"records attendance"| node_attendance_ops
node_staff -->|"manages renewals"| node_membership_ops
node_staff -->|"reviews performance"| node_analytics
node_analytics -->|"reads records"| node_database
node_staff -->|"exports reports"| node_export
node_staff -->|"runs backups"| node_backup
node_staff -->|"configures gym"| node_settings
node_database -->|"persists data"| node_postgres

click node_dashboard "https://github.com/hiteshponnappa17/repwise/blob/feat/rewise-rebrand-export-backup/src/app/dashboard/page.tsx"
click node_members_ui "https://github.com/hiteshponnappa17/repwise/blob/feat/rewise-rebrand-export-backup/src/app/dashboard/members/page.tsx"
click node_finance_ui "https://github.com/hiteshponnappa17/repwise/blob/feat/rewise-rebrand-export-backup/src/app/dashboard/payments/page.tsx"
click node_leads_ui "https://github.com/hiteshponnappa17/repwise/blob/feat/rewise-rebrand-export-backup/src/app/dashboard/leads/page.tsx"
click node_member_portal "https://github.com/hiteshponnappa17/repwise/blob/feat/rewise-rebrand-export-backup/src/app/member/page.tsx"
click node_api_routes "https://github.com/hiteshponnappa17/repwise/tree/feat/rewise-rebrand-export-backup/src/app/api"
click node_access "https://github.com/hiteshponnappa17/repwise/blob/feat/rewise-rebrand-export-backup/src/lib/auth.ts"
click node_api_common "https://github.com/hiteshponnappa17/repwise/blob/feat/rewise-rebrand-export-backup/src/lib/api-handler.ts"
click node_member_ops "https://github.com/hiteshponnappa17/repwise/tree/feat/rewise-rebrand-export-backup/src/domains/members/handlers"
click node_membership_ops "https://github.com/hiteshponnappa17/repwise/tree/feat/rewise-rebrand-export-backup/src/domains/memberships/handlers"
click node_attendance_ops "https://github.com/hiteshponnappa17/repwise/tree/feat/rewise-rebrand-export-backup/src/domains/attendance/handlers"
click node_payment_ops "https://github.com/hiteshponnappa17/repwise/tree/feat/rewise-rebrand-export-backup/src/domains/payments/handlers"
click node_leads_ops "https://github.com/hiteshponnappa17/repwise/blob/feat/rewise-rebrand-export-backup/src/domains/leads/service.ts"
click node_analytics "https://github.com/hiteshponnappa17/repwise/tree/feat/rewise-rebrand-export-backup/src/domains/analytics"
click node_export "https://github.com/hiteshponnappa17/repwise/blob/feat/rewise-rebrand-export-backup/src/domains/members/export/member-export.ts"
click node_backup "https://github.com/hiteshponnappa17/repwise/blob/feat/rewise-rebrand-export-backup/src/app/api/admin/backups/route.ts"
click node_settings "https://github.com/hiteshponnappa17/repwise/blob/feat/rewise-rebrand-export-backup/src/domains/platform/settings/service.ts"
click node_database "https://github.com/hiteshponnappa17/repwise/blob/feat/rewise-rebrand-export-backup/src/lib/prisma.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_dashboard,node_members_ui,node_finance_ui,node_leads_ui,node_member_portal toneBlue
class node_api_routes,node_access,node_api_common,node_postgres toneAmber
class node_member_ops,node_membership_ops,node_attendance_ops,node_payment_ops,node_leads_ops toneMint
class node_analytics,node_export toneRose
class node_backup,node_settings,node_database,node_staff toneIndigo
```

## Components

### User experience

- [Operations dashboard](https://github.com/hiteshponnappa17/repwise/blob/feat/rewise-rebrand-export-backup/src/app/dashboard/page.tsx): `src/app/dashboard/page.tsx`
- [Member workspace](https://github.com/hiteshponnappa17/repwise/blob/feat/rewise-rebrand-export-backup/src/app/dashboard/members/page.tsx): `src/app/dashboard/members/page.tsx`
- [Payments and bills](https://github.com/hiteshponnappa17/repwise/blob/feat/rewise-rebrand-export-backup/src/app/dashboard/payments/page.tsx): `src/app/dashboard/payments/page.tsx`
- [Lead workspace](https://github.com/hiteshponnappa17/repwise/blob/feat/rewise-rebrand-export-backup/src/app/dashboard/leads/page.tsx): `src/app/dashboard/leads/page.tsx`
- [Member portal](https://github.com/hiteshponnappa17/repwise/blob/feat/rewise-rebrand-export-backup/src/app/member/page.tsx): `src/app/member/page.tsx`

### API and access

- [HTTP API routes](https://github.com/hiteshponnappa17/repwise/tree/feat/rewise-rebrand-export-backup/src/app/api): `src/app/api`
- [Authentication and permissions](https://github.com/hiteshponnappa17/repwise/blob/feat/rewise-rebrand-export-backup/src/lib/auth.ts): `src/lib/auth.ts`
- [API handling](https://github.com/hiteshponnappa17/repwise/blob/feat/rewise-rebrand-export-backup/src/lib/api-handler.ts): `src/lib/api-handler.ts`

### Gym operations

- [Member management](https://github.com/hiteshponnappa17/repwise/tree/feat/rewise-rebrand-export-backup/src/domains/members/handlers): `src/domains/members/handlers`
- [Plans and renewals](https://github.com/hiteshponnappa17/repwise/tree/feat/rewise-rebrand-export-backup/src/domains/memberships/handlers): `src/domains/memberships/handlers`
- [Attendance tracking](https://github.com/hiteshponnappa17/repwise/tree/feat/rewise-rebrand-export-backup/src/domains/attendance/handlers): `src/domains/attendance/handlers`
- [Payment processing](https://github.com/hiteshponnappa17/repwise/tree/feat/rewise-rebrand-export-backup/src/domains/payments/handlers): `src/domains/payments/handlers`
- [Lead follow-up](https://github.com/hiteshponnappa17/repwise/blob/feat/rewise-rebrand-export-backup/src/domains/leads/service.ts): `src/domains/leads/service.ts`

### Reporting and records

- [Business analytics](https://github.com/hiteshponnappa17/repwise/tree/feat/rewise-rebrand-export-backup/src/domains/analytics): `src/domains/analytics`
- [Data export](https://github.com/hiteshponnappa17/repwise/blob/feat/rewise-rebrand-export-backup/src/domains/members/export/member-export.ts): `src/domains/members/export/member-export.ts`

### Platform services

- [Backup management](https://github.com/hiteshponnappa17/repwise/blob/feat/rewise-rebrand-export-backup/src/app/api/admin/backups/route.ts): `src/app/api/admin/backups/route.ts`
- [Gym settings](https://github.com/hiteshponnappa17/repwise/blob/feat/rewise-rebrand-export-backup/src/domains/platform/settings/service.ts): `src/domains/platform/settings/service.ts`
- [Operational records](https://github.com/hiteshponnappa17/repwise/blob/feat/rewise-rebrand-export-backup/src/lib/prisma.ts): `src/lib/prisma.ts`

### Other components

- **Gym staff**
- **PostgreSQL**

## Connections

- Gym staff → Operations dashboard: uses (evidence: `README.md`)
- Gym staff → Member workspace: manages members (evidence: `README.md`)
- Gym staff → Payments and bills: records payments (evidence: `README.md`)
- Gym staff → Lead workspace: tracks leads (evidence: `README.md`)
- Member workspace → Member portal: supports self-service
- Operations dashboard → HTTP API routes: requests data
- Member workspace → HTTP API routes: requests member data
- Payments and bills → HTTP API routes: requests finance data
- HTTP API routes → Authentication and permissions: authenticates (evidence: `src/app/api/members/route.ts`)
- HTTP API routes → API handling: uses helpers (evidence: `src/app/api/leads/route.ts`)
- HTTP API routes → Member management: handles member requests (evidence: `src/app/api/members/route.ts`)
- HTTP API routes → Plans and renewals: lists plans (evidence: `src/app/api/plans/route.ts`)
- HTTP API routes → Attendance tracking: handles check-ins (evidence: `src/app/api/attendance/route.ts`)
- HTTP API routes → Lead follow-up: handles lead requests (evidence: `src/app/api/leads/route.ts`)
- Gym staff → Attendance tracking: records attendance (evidence: `README.md`)
- Gym staff → Plans and renewals: manages renewals (evidence: `README.md`)
- Gym staff → Business analytics: reviews performance (evidence: `README.md`)
- Business analytics → Operational records: reads records (evidence: `src/domains/analytics/daily-stats.service.ts`)
- Gym staff → Data export: exports reports (evidence: `README.md`)
- Gym staff → Backup management: runs backups (evidence: `README.md`)
- Gym staff → Gym settings: configures gym (evidence: `README.md`)
- Operational records → PostgreSQL: persists data (evidence: `README.md`)
