# luqmancypher001/sentinel architecture

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

- Interactive diagram: https://gitdiagram.com/luqmancypher001/sentinel
- Repository: https://github.com/luqmancypher001/sentinel

## Overview

Sentinel is a secure-authentication dashboard. Its main workflow takes sign-in credentials through rate and lockout checks, device/location context and risk scoring, then allows, blocks, or requires MFA before issuing a revocable session. Authenticated users can review activity, devices, alerts and security settings, and export audit data. The graph also includes registration, recovery, and dashboard capabilities documented in the README. Some route and UI connections are documented rather than visible in excerpts; unsampled implementation details are not inferred.

Main entry points: [`app/page.tsx`](https://github.com/luqmancypher001/sentinel/blob/main/app/page.tsx) (Dashboard shell), [`app/api/auth/login/route.ts`](https://github.com/luqmancypher001/sentinel/blob/main/app/api/auth/login/route.ts) (Login decision), [`app/api/auth/register/route.ts`](https://github.com/luqmancypher001/sentinel/blob/main/app/api/auth/register/route.ts) (Registration), [`lib/db.ts`](https://github.com/luqmancypher001/sentinel/blob/main/lib/db.ts) (Prisma database client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_web["Dashboard shell<br/>[page.tsx]"]
  node_authscreen["Sign-in and MFA<br/>[AuthScreen.tsx]"]
  node_overview["Overview<br/>[Overview.tsx]"]
  node_activity["Login activity<br/>[ActivityPage.tsx]"]
  node_alertsui["Security alerts<br/>[AlertsPage.tsx]"]
  node_devicesui["Trusted devices<br/>[DevicesPage.tsx]"]
  node_securityui["Security settings"]
  node_accountui["Account settings"]
end

subgraph group_auth["Authentication workflows"]
  node_authroutes["Auth API routes"]
  node_login["Login decision<br/>[route.ts]"]
  node_verify["MFA verification<br/>[route.ts]"]
  node_register["Registration<br/>[route.ts]"]
  node_recovery["Password recovery"]
  node_sessionauth["Credential and session services<br/>[auth.ts]"]
  node_email["Security email<br/>[email.ts]"]
end

subgraph group_risk["Risk and protection"]
  node_ratelimit["Rate limits and lockout<br/>[rate-limiter.ts]"]
  node_device["Device fingerprinting<br/>[fingerprint.ts]"]
  node_location["Location resolution<br/>[geoip.ts]"]
  node_riskengine["Anomaly scoring<br/>[anomaly.ts]"]
  node_travel["Impossible travel<br/>[travel.ts]"]
end

subgraph group_data["Persistence and audit"]
  node_dashboardapi["Dashboard API routes"]
  node_dbclient["Prisma database client<br/>[db.ts]"]
  node_schema[("SQLite data model<br/>[schema.prisma]")]
end

node_user(("User"))

node_user -->|"uses"| node_web
node_web -->|"renders"| node_authscreen
node_web -->|"renders"| node_overview
node_web -->|"renders"| node_activity
node_web -->|"renders"| node_alertsui
node_web -->|"renders"| node_devicesui
node_web -->|"renders"| node_securityui
node_web -->|"renders"| node_accountui
node_user -->|"submits credentials"| node_authscreen
node_authscreen -.->|"uses auth flows"| node_authroutes
node_authroutes -->|"routes login"| node_login
node_authroutes -->|"routes MFA"| node_verify
node_authroutes -->|"routes registration"| node_register
node_authroutes -->|"routes recovery"| node_recovery
node_login -->|"checks limits"| node_ratelimit
node_login -->|"parses device"| node_device
node_login -->|"resolves location"| node_location
node_login -->|"scores login"| node_riskengine
node_riskengine -->|"checks travel"| node_travel
node_login -->|"creates session token"| node_sessionauth
node_login -->|"sends alerts"| node_email
node_login -->|"reads and writes"| node_dbclient
node_verify -->|"verifies MFA and issues session"| node_sessionauth
node_verify -->|"clears failures"| node_ratelimit
node_verify -->|"updates recovery and session"| node_dbclient
node_register -->|"checks limits"| node_ratelimit
node_register -->|"hashes and issues session"| node_sessionauth
node_register -->|"parses device"| node_device
node_register -->|"resolves location"| node_location
node_register -->|"creates account"| node_dbclient
node_dashboardapi -->|"reads dashboard data"| node_dbclient
node_dashboardapi -->|"authenticates requests"| node_sessionauth
node_activity -.->|"requests audit data"| node_dashboardapi
node_alertsui -.->|"requests alerts"| node_dashboardapi
node_devicesui -.->|"requests devices"| node_dashboardapi
node_dbclient -->|"persists model data"| node_schema
node_ratelimit -->|"persists buckets"| node_dbclient

click node_web "https://github.com/luqmancypher001/sentinel/blob/main/app/page.tsx"
click node_authscreen "https://github.com/luqmancypher001/sentinel/blob/main/components/auth/AuthScreen.tsx"
click node_overview "https://github.com/luqmancypher001/sentinel/blob/main/components/dashboard/Overview.tsx"
click node_activity "https://github.com/luqmancypher001/sentinel/blob/main/components/dashboard/ActivityPage.tsx"
click node_alertsui "https://github.com/luqmancypher001/sentinel/blob/main/components/dashboard/AlertsPage.tsx"
click node_devicesui "https://github.com/luqmancypher001/sentinel/blob/main/components/dashboard/DevicesPage.tsx"
click node_securityui "https://github.com/luqmancypher001/sentinel/blob/main/components/dashboard/SecuritySettings.tsx"
click node_accountui "https://github.com/luqmancypher001/sentinel/blob/main/components/dashboard/AccountSettings.tsx"
click node_authroutes "https://github.com/luqmancypher001/sentinel/tree/main/app/api/auth"
click node_login "https://github.com/luqmancypher001/sentinel/blob/main/app/api/auth/login/route.ts"
click node_verify "https://github.com/luqmancypher001/sentinel/blob/main/app/api/auth/verify-mfa/route.ts"
click node_register "https://github.com/luqmancypher001/sentinel/blob/main/app/api/auth/register/route.ts"
click node_recovery "https://github.com/luqmancypher001/sentinel/tree/main/app/api/auth"
click node_sessionauth "https://github.com/luqmancypher001/sentinel/blob/main/lib/auth.ts"
click node_ratelimit "https://github.com/luqmancypher001/sentinel/blob/main/lib/rate-limiter.ts"
click node_device "https://github.com/luqmancypher001/sentinel/blob/main/lib/fingerprint.ts"
click node_location "https://github.com/luqmancypher001/sentinel/blob/main/lib/geoip.ts"
click node_riskengine "https://github.com/luqmancypher001/sentinel/blob/main/lib/anomaly.ts"
click node_travel "https://github.com/luqmancypher001/sentinel/blob/main/lib/travel.ts"
click node_email "https://github.com/luqmancypher001/sentinel/blob/main/lib/email.ts"
click node_dashboardapi "https://github.com/luqmancypher001/sentinel/tree/main/app/api/dashboard"
click node_dbclient "https://github.com/luqmancypher001/sentinel/blob/main/lib/db.ts"
click node_schema "https://github.com/luqmancypher001/sentinel/blob/main/prisma/schema.prisma"

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_web,node_authscreen,node_overview,node_activity,node_alertsui,node_devicesui,node_securityui,node_accountui,node_user toneBlue
class node_authroutes,node_login,node_verify,node_register,node_recovery,node_sessionauth,node_email toneAmber
class node_ratelimit,node_device,node_location,node_riskengine,node_travel toneMint
class node_dashboardapi,node_dbclient,node_schema toneRose
```

## Components

### Web experience

- [Dashboard shell](https://github.com/luqmancypher001/sentinel/blob/main/app/page.tsx): `app/page.tsx`
- [Sign-in and MFA](https://github.com/luqmancypher001/sentinel/blob/main/components/auth/AuthScreen.tsx): `components/auth/AuthScreen.tsx`
- [Overview](https://github.com/luqmancypher001/sentinel/blob/main/components/dashboard/Overview.tsx): `components/dashboard/Overview.tsx`
- [Login activity](https://github.com/luqmancypher001/sentinel/blob/main/components/dashboard/ActivityPage.tsx): `components/dashboard/ActivityPage.tsx`
- [Security alerts](https://github.com/luqmancypher001/sentinel/blob/main/components/dashboard/AlertsPage.tsx): `components/dashboard/AlertsPage.tsx`
- [Trusted devices](https://github.com/luqmancypher001/sentinel/blob/main/components/dashboard/DevicesPage.tsx): `components/dashboard/DevicesPage.tsx`
- [Security settings](https://github.com/luqmancypher001/sentinel/blob/main/components/dashboard/SecuritySettings.tsx): `components/dashboard/SecuritySettings.tsx`
- [Account settings](https://github.com/luqmancypher001/sentinel/blob/main/components/dashboard/AccountSettings.tsx): `components/dashboard/AccountSettings.tsx`

### Authentication workflows

- [Auth API routes](https://github.com/luqmancypher001/sentinel/tree/main/app/api/auth): `app/api/auth`
- [Login decision](https://github.com/luqmancypher001/sentinel/blob/main/app/api/auth/login/route.ts): `app/api/auth/login/route.ts`
- [MFA verification](https://github.com/luqmancypher001/sentinel/blob/main/app/api/auth/verify-mfa/route.ts): `app/api/auth/verify-mfa/route.ts`
- [Registration](https://github.com/luqmancypher001/sentinel/blob/main/app/api/auth/register/route.ts): `app/api/auth/register/route.ts`
- [Password recovery](https://github.com/luqmancypher001/sentinel/tree/main/app/api/auth): `app/api/auth`
- [Credential and session services](https://github.com/luqmancypher001/sentinel/blob/main/lib/auth.ts): `lib/auth.ts`
- [Security email](https://github.com/luqmancypher001/sentinel/blob/main/lib/email.ts): `lib/email.ts`

### Risk and protection

- [Rate limits and lockout](https://github.com/luqmancypher001/sentinel/blob/main/lib/rate-limiter.ts): `lib/rate-limiter.ts`
- [Device fingerprinting](https://github.com/luqmancypher001/sentinel/blob/main/lib/fingerprint.ts): `lib/fingerprint.ts`
- [Location resolution](https://github.com/luqmancypher001/sentinel/blob/main/lib/geoip.ts): `lib/geoip.ts`
- [Anomaly scoring](https://github.com/luqmancypher001/sentinel/blob/main/lib/anomaly.ts): `lib/anomaly.ts`
- [Impossible travel](https://github.com/luqmancypher001/sentinel/blob/main/lib/travel.ts): `lib/travel.ts`

### Persistence and audit

- [Dashboard API routes](https://github.com/luqmancypher001/sentinel/tree/main/app/api/dashboard): `app/api/dashboard`
- [Prisma database client](https://github.com/luqmancypher001/sentinel/blob/main/lib/db.ts): `lib/db.ts`
- [SQLite data model](https://github.com/luqmancypher001/sentinel/blob/main/prisma/schema.prisma): `prisma/schema.prisma`

### Other components

- **User**

## Connections

- User → Dashboard shell: uses (evidence: `README.md`)
- Dashboard shell → Sign-in and MFA: renders (evidence: `app/page.tsx`)
- Dashboard shell → Overview: renders (evidence: `app/page.tsx`)
- Dashboard shell → Login activity: renders (evidence: `app/page.tsx`)
- Dashboard shell → Security alerts: renders (evidence: `app/page.tsx`)
- Dashboard shell → Trusted devices: renders (evidence: `app/page.tsx`)
- Dashboard shell → Security settings: renders (evidence: `app/page.tsx`)
- Dashboard shell → Account settings: renders (evidence: `app/page.tsx`)
- User → Sign-in and MFA: submits credentials (evidence: `README.md`)
- Sign-in and MFA → Auth API routes: uses auth flows
- Auth API routes → Login decision: routes login (evidence: `README.md`)
- Auth API routes → MFA verification: routes MFA (evidence: `README.md`)
- Auth API routes → Registration: routes registration (evidence: `README.md`)
- Auth API routes → Password recovery: routes recovery (evidence: `README.md`)
- Login decision → Rate limits and lockout: checks limits (evidence: `app/api/auth/login/route.ts`)
- Login decision → Device fingerprinting: parses device (evidence: `app/api/auth/login/route.ts`)
- Login decision → Location resolution: resolves location (evidence: `app/api/auth/login/route.ts`)
- Login decision → Anomaly scoring: scores login (evidence: `app/api/auth/login/route.ts`)
- Anomaly scoring → Impossible travel: checks travel (evidence: `lib/anomaly.ts`)
- Login decision → Credential and session services: creates session token (evidence: `app/api/auth/login/route.ts`)
- Login decision → Security email: sends alerts (evidence: `app/api/auth/login/route.ts`)
- Login decision → Prisma database client: reads and writes (evidence: `app/api/auth/login/route.ts`)
- MFA verification → Credential and session services: verifies MFA and issues session (evidence: `app/api/auth/verify-mfa/route.ts`)
- MFA verification → Rate limits and lockout: clears failures (evidence: `app/api/auth/verify-mfa/route.ts`)
- MFA verification → Prisma database client: updates recovery and session (evidence: `app/api/auth/verify-mfa/route.ts`)
- Registration → Rate limits and lockout: checks limits (evidence: `app/api/auth/register/route.ts`)
- Registration → Credential and session services: hashes and issues session (evidence: `app/api/auth/register/route.ts`)
- Registration → Device fingerprinting: parses device (evidence: `app/api/auth/register/route.ts`)
- Registration → Location resolution: resolves location (evidence: `app/api/auth/register/route.ts`)
- Registration → Prisma database client: creates account (evidence: `app/api/auth/register/route.ts`)
- Dashboard API routes → Prisma database client: reads dashboard data (evidence: `app/api/dashboard/stats/route.ts`)
- Dashboard API routes → Credential and session services: authenticates requests (evidence: `app/api/dashboard/stats/route.ts`)
- Login activity → Dashboard API routes: requests audit data
- Security alerts → Dashboard API routes: requests alerts
- Trusted devices → Dashboard API routes: requests devices
- Prisma database client → SQLite data model: persists model data (evidence: `README.md`)
- Rate limits and lockout → Prisma database client: persists buckets (evidence: `lib/rate-limiter.ts`)
