# mczagany/arka-goals-revamp-mono architecture

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

- Interactive diagram: https://gitdiagram.com/mczagany/arka-goals-revamp-mono
- Repository: https://github.com/mczagany/arka-goals-revamp-mono

## Overview

Arka Goals is a squad weekly-goal tracking application. Members sign in through passwordless email links, then create and review goals and submit weekly check-ins; admins additionally invite and manage members. The frontend routes users to these workflows and calls the NestJS backend, whose domain services use Prisma and PostgreSQL. Mail delivery supports sign-in and invite links. The graph preserves documented product areas, but some frontend-to-domain API calls and unsampled modules are represented only where the available evidence supports them.

Main entry points: [`front-end/src/router.tsx`](https://github.com/mczagany/arka-goals-revamp-mono/blob/main/front-end/src/router.tsx) (Route guards), [`front-end/src/routes/HomeRoute.tsx`](https://github.com/mczagany/arka-goals-revamp-mono/blob/main/front-end/src/routes/HomeRoute.tsx) (Squad home), [`back-end/src/auth/auth.service.ts`](https://github.com/mczagany/arka-goals-revamp-mono/blob/main/back-end/src/auth/auth.service.ts) (Magic-link service), [`front-end/src/lib/api.ts`](https://github.com/mczagany/arka-goals-revamp-mono/blob/main/front-end/src/lib/api.ts) (HTTP client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_main["App bootstrap<br/>[main.tsx]"]
  node_router["Route guards<br/>[router.tsx]"]
  node_authcontext["Session context<br/>[AuthContext.tsx]"]
  node_login["Magic-link login<br/>[LoginRoute.tsx]"]
  node_callback["Link callback"]
  node_home["Squad home<br/>[HomeRoute.tsx]"]
  node_weeklyform["Weekly check-in form<br/>[WeeklyCheckIn.tsx]"]
  node_checkintable["Check-in history<br/>[CheckInsTable.tsx]"]
  node_goalsetup["Goal setup<br/>[GoalSetup.tsx]"]
  node_goalstable["Goals table<br/>[GoalsTable.tsx]"]
  node_invitepage["Invite management"]
  node_api["HTTP client<br/>[api.ts]"]
end

subgraph group_identity["Identity and membership"]
  node_authapi["Auth endpoints<br/>[auth.controller.ts]"]
  node_authservice["Magic-link service<br/>[auth.service.ts]"]
  node_invites["Invite management<br/>[invites.service.ts]"]
  node_users["User lookup<br/>[users.service.ts]"]
  node_mail["Email delivery<br/>[mail.service.ts]"]
end

subgraph group_tracking["Goal tracking"]
  node_checkins["Check-in service"]
  node_goals["Goals service<br/>[goals.service.ts]"]
end

subgraph group_platform["Backend platform"]
  node_app["Nest application<br/>[app.module.ts]"]
  node_prisma["Prisma client<br/>[prisma.service.ts]"]
  node_postgres[("PostgreSQL")]
end

node_member(("Squad member"))
node_admin(("Squad admin"))

node_member -->|"requests access"| node_login
node_admin -->|"manages roster"| node_invitepage
node_main -->|"mounts routes"| node_router
node_main -->|"provides session"| node_authcontext
node_router -->|"routes to"| node_login
node_router -->|"routes to"| node_callback
node_router -->|"guards route"| node_home
node_router -->|"guards route"| node_invitepage
node_authcontext -->|"requests session"| node_api
node_login -.->|"submits login"| node_api
node_callback -->|"verifies link"| node_api
node_home -->|"renders"| node_weeklyform
node_home -->|"renders"| node_checkintable
node_home -->|"renders"| node_goalsetup
node_home -->|"renders"| node_goalstable
node_invitepage -->|"manages invites"| node_api
node_api -->|"sends requests"| node_app
node_app -->|"registers feature"| node_authapi
node_authapi -->|"delegates auth"| node_authservice
node_authservice -->|"reads and writes"| node_prisma
node_authservice -->|"sends links"| node_mail
node_mail -.-> node_postgres
node_authservice -.-> node_invites
node_invites -->|"sends invite link"| node_authservice
node_invites -->|"looks up users"| node_users
node_invites -->|"reads and writes"| node_prisma
node_app -->|"registers feature"| node_checkins
node_app -->|"registers feature"| node_goals
node_checkins -->|"reads and writes"| node_prisma
node_goals -->|"reads and writes"| node_prisma
node_prisma -->|"connects to"| node_postgres

click node_main "https://github.com/mczagany/arka-goals-revamp-mono/blob/main/front-end/src/main.tsx"
click node_router "https://github.com/mczagany/arka-goals-revamp-mono/blob/main/front-end/src/router.tsx"
click node_authcontext "https://github.com/mczagany/arka-goals-revamp-mono/blob/main/front-end/src/auth/AuthContext.tsx"
click node_login "https://github.com/mczagany/arka-goals-revamp-mono/blob/main/front-end/src/routes/LoginRoute.tsx"
click node_callback "https://github.com/mczagany/arka-goals-revamp-mono/blob/main/front-end/src/routes/AuthCallbackRoute.tsx"
click node_home "https://github.com/mczagany/arka-goals-revamp-mono/blob/main/front-end/src/routes/HomeRoute.tsx"
click node_weeklyform "https://github.com/mczagany/arka-goals-revamp-mono/blob/main/front-end/src/WeeklyCheckIn.tsx"
click node_checkintable "https://github.com/mczagany/arka-goals-revamp-mono/blob/main/front-end/src/CheckInsTable.tsx"
click node_goalsetup "https://github.com/mczagany/arka-goals-revamp-mono/blob/main/front-end/src/GoalSetup.tsx"
click node_goalstable "https://github.com/mczagany/arka-goals-revamp-mono/blob/main/front-end/src/GoalsTable.tsx"
click node_invitepage "https://github.com/mczagany/arka-goals-revamp-mono/blob/main/front-end/src/routes/AdminInvitesRoute.tsx"
click node_api "https://github.com/mczagany/arka-goals-revamp-mono/blob/main/front-end/src/lib/api.ts"
click node_authapi "https://github.com/mczagany/arka-goals-revamp-mono/blob/main/back-end/src/auth/auth.controller.ts"
click node_authservice "https://github.com/mczagany/arka-goals-revamp-mono/blob/main/back-end/src/auth/auth.service.ts"
click node_invites "https://github.com/mczagany/arka-goals-revamp-mono/blob/main/back-end/src/invites/invites.service.ts"
click node_users "https://github.com/mczagany/arka-goals-revamp-mono/blob/main/back-end/src/users/users.service.ts"
click node_mail "https://github.com/mczagany/arka-goals-revamp-mono/blob/main/back-end/src/mail/mail.service.ts"
click node_checkins "https://github.com/mczagany/arka-goals-revamp-mono/blob/main/back-end/src/checkins/checkins.service.ts"
click node_goals "https://github.com/mczagany/arka-goals-revamp-mono/blob/main/back-end/src/goals/goals.service.ts"
click node_app "https://github.com/mczagany/arka-goals-revamp-mono/blob/main/back-end/src/app.module.ts"
click node_prisma "https://github.com/mczagany/arka-goals-revamp-mono/blob/main/back-end/src/prisma/prisma.service.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_main,node_router,node_authcontext,node_login,node_callback,node_home,node_weeklyform,node_checkintable,node_goalsetup,node_goalstable,node_invitepage,node_api toneBlue
class node_authapi,node_authservice,node_invites,node_users,node_mail toneAmber
class node_checkins,node_goals toneMint
class node_app,node_prisma,node_postgres toneRose
class node_member,node_admin toneIndigo
```

## Components

### Web application

- [App bootstrap](https://github.com/mczagany/arka-goals-revamp-mono/blob/main/front-end/src/main.tsx): `front-end/src/main.tsx`
- [Route guards](https://github.com/mczagany/arka-goals-revamp-mono/blob/main/front-end/src/router.tsx): `front-end/src/router.tsx`
- [Session context](https://github.com/mczagany/arka-goals-revamp-mono/blob/main/front-end/src/auth/AuthContext.tsx): `front-end/src/auth/AuthContext.tsx`
- [Magic-link login](https://github.com/mczagany/arka-goals-revamp-mono/blob/main/front-end/src/routes/LoginRoute.tsx): `front-end/src/routes/LoginRoute.tsx`
- [Link callback](https://github.com/mczagany/arka-goals-revamp-mono/blob/main/front-end/src/routes/AuthCallbackRoute.tsx): `front-end/src/routes/AuthCallbackRoute.tsx`
- [Squad home](https://github.com/mczagany/arka-goals-revamp-mono/blob/main/front-end/src/routes/HomeRoute.tsx): `front-end/src/routes/HomeRoute.tsx`
- [Weekly check-in form](https://github.com/mczagany/arka-goals-revamp-mono/blob/main/front-end/src/WeeklyCheckIn.tsx): `front-end/src/WeeklyCheckIn.tsx`
- [Check-in history](https://github.com/mczagany/arka-goals-revamp-mono/blob/main/front-end/src/CheckInsTable.tsx): `front-end/src/CheckInsTable.tsx`
- [Goal setup](https://github.com/mczagany/arka-goals-revamp-mono/blob/main/front-end/src/GoalSetup.tsx): `front-end/src/GoalSetup.tsx`
- [Goals table](https://github.com/mczagany/arka-goals-revamp-mono/blob/main/front-end/src/GoalsTable.tsx): `front-end/src/GoalsTable.tsx`
- [Invite management](https://github.com/mczagany/arka-goals-revamp-mono/blob/main/front-end/src/routes/AdminInvitesRoute.tsx): `front-end/src/routes/AdminInvitesRoute.tsx`
- [HTTP client](https://github.com/mczagany/arka-goals-revamp-mono/blob/main/front-end/src/lib/api.ts): `front-end/src/lib/api.ts`

### Identity and membership

- [Auth endpoints](https://github.com/mczagany/arka-goals-revamp-mono/blob/main/back-end/src/auth/auth.controller.ts): `back-end/src/auth/auth.controller.ts`
- [Magic-link service](https://github.com/mczagany/arka-goals-revamp-mono/blob/main/back-end/src/auth/auth.service.ts): `back-end/src/auth/auth.service.ts`
- [Invite management](https://github.com/mczagany/arka-goals-revamp-mono/blob/main/back-end/src/invites/invites.service.ts): `back-end/src/invites/invites.service.ts`
- [User lookup](https://github.com/mczagany/arka-goals-revamp-mono/blob/main/back-end/src/users/users.service.ts): `back-end/src/users/users.service.ts`
- [Email delivery](https://github.com/mczagany/arka-goals-revamp-mono/blob/main/back-end/src/mail/mail.service.ts): `back-end/src/mail/mail.service.ts`

### Goal tracking

- [Check-in service](https://github.com/mczagany/arka-goals-revamp-mono/blob/main/back-end/src/checkins/checkins.service.ts): `back-end/src/checkins/checkins.service.ts`
- [Goals service](https://github.com/mczagany/arka-goals-revamp-mono/blob/main/back-end/src/goals/goals.service.ts): `back-end/src/goals/goals.service.ts`

### Backend platform

- [Nest application](https://github.com/mczagany/arka-goals-revamp-mono/blob/main/back-end/src/app.module.ts): `back-end/src/app.module.ts`
- [Prisma client](https://github.com/mczagany/arka-goals-revamp-mono/blob/main/back-end/src/prisma/prisma.service.ts): `back-end/src/prisma/prisma.service.ts`
- **PostgreSQL**

### Other components

- **Squad member**
- **Squad admin**

## Connections

- Squad member → Magic-link login: requests access (evidence: `README.md`)
- Squad admin → Invite management: manages roster (evidence: `README.md`)
- App bootstrap → Route guards: mounts routes (evidence: `front-end/src/main.tsx`)
- App bootstrap → Session context: provides session (evidence: `front-end/src/main.tsx`)
- Route guards → Magic-link login: routes to (evidence: `front-end/src/router.tsx`)
- Route guards → Link callback: routes to (evidence: `front-end/src/router.tsx`)
- Route guards → Squad home: guards route (evidence: `front-end/src/router.tsx`)
- Route guards → Invite management: guards route (evidence: `front-end/src/router.tsx`)
- Session context → HTTP client: requests session (evidence: `front-end/src/auth/AuthContext.tsx`)
- Magic-link login → HTTP client: submits login (evidence: `front-end/src/routes/LoginRoute.tsx`)
- Link callback → HTTP client: verifies link (evidence: `front-end/src/routes/AuthCallbackRoute.tsx`)
- Squad home → Weekly check-in form: renders (evidence: `front-end/src/routes/HomeRoute.tsx`)
- Squad home → Check-in history: renders (evidence: `front-end/src/routes/HomeRoute.tsx`)
- Squad home → Goal setup: renders (evidence: `front-end/src/routes/HomeRoute.tsx`)
- Squad home → Goals table: renders (evidence: `front-end/src/routes/HomeRoute.tsx`)
- Invite management → HTTP client: manages invites (evidence: `front-end/src/routes/AdminInvitesRoute.tsx`)
- HTTP client → Nest application: sends requests (evidence: `front-end/src/lib/api.ts`)
- Nest application → Auth endpoints: registers feature (evidence: `back-end/src/app.module.ts`)
- Auth endpoints → Magic-link service: delegates auth (evidence: `back-end/src/auth/auth.controller.ts`)
- Magic-link service → Prisma client: reads and writes (evidence: `back-end/src/auth/auth.service.ts`)
- Magic-link service → Email delivery: sends links (evidence: `back-end/src/auth/auth.service.ts`)
- Email delivery → PostgreSQL
- Magic-link service → Invite management (evidence: `back-end/src/invites/invites.service.ts`)
- Invite management → Magic-link service: sends invite link (evidence: `back-end/src/invites/invites.service.ts`)
- Invite management → User lookup: looks up users (evidence: `back-end/src/invites/invites.service.ts`)
- Invite management → Prisma client: reads and writes (evidence: `back-end/src/invites/invites.service.ts`)
- Nest application → Check-in service: registers feature (evidence: `back-end/src/app.module.ts`)
- Nest application → Goals service: registers feature (evidence: `back-end/src/app.module.ts`)
- Check-in service → Prisma client: reads and writes (evidence: `back-end/src/checkins/checkins.service.ts`)
- Goals service → Prisma client: reads and writes (evidence: `back-end/src/goals/goals.service.ts`)
- Prisma client → PostgreSQL: connects to (evidence: `back-end/src/prisma/prisma.service.ts`)
