# benelliot4631317/web-project architecture

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

- Interactive diagram: https://gitdiagram.com/benelliot4631317/web-project
- Repository: https://github.com/benelliot4631317/web-project

## Overview

This is a Next.js web application branded as a university internship information system. The visible user workflow centers on account registration and login, then reaching the home, browse, and profile areas; admin and password-reset routes are also present. Authentication is the only sampled end-to-end backend flow: API handlers validate credentials, use Prisma for user records, and issue or verify a cookie-backed JWT. The README is a generic Next.js template, and sampled browse/home pages are largely placeholders, so internship-domain behavior and wiring for unsampled routes cannot be confirmed.

Main entry points: [`app/api/auth/register/route.ts`](https://github.com/benelliot4631317/web-project/blob/main/app/api/auth/register/route.ts) (Registration Handler), [`app/api/auth/login/route.ts`](https://github.com/benelliot4631317/web-project/blob/main/app/api/auth/login/route.ts) (Login Handler), [`lib/prisma.ts`](https://github.com/benelliot4631317/web-project/blob/main/lib/prisma.ts) (Prisma Client), [`lib/auth.ts`](https://github.com/benelliot4631317/web-project/blob/main/lib/auth.ts) (JWT Sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Accounts &amp; Sessions"]
  node_register_ui["Registration Form<br/>[page.tsx]"]
  node_login_ui["Login Form<br/>[page.tsx]"]
  node_auth_api["Auth Endpoints"]
  node_register_route["Registration Handler<br/>[route.ts]"]
  node_login_route["Login Handler<br/>[route.ts]"]
  node_session_route["Session Endpoint<br/>[route.ts]"]
  node_logout_route["Logout Handler<br/>[route.ts]"]
  node_token_service["JWT Sessions<br/>[auth.ts]"]
  node_reset["Password Reset<br/>[page.tsx]"]
end

subgraph group_experience["User Experience"]
  node_navbar["Navigation Bar<br/>[navbar.tsx]"]
  node_home["Home Page<br/>[page.tsx]"]
  node_firstpage["Landing Page<br/>[page.tsx]"]
end

subgraph group_internships["Internship Areas"]
  node_browse["Browse Page<br/>[page.tsx]"]
  node_profile["Profile Page<br/>[page.tsx]"]
  node_admin["Admin Area"]
end

subgraph group_storage["Persistence"]
  node_user_store[("User Records<br/>[schema.prisma]")]
  node_prisma_client["Prisma Client<br/>[prisma.ts]"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_register_ui
node_visitor -->|"opens"| node_login_ui
node_register_ui -->|"POSTs registration"| node_register_route
node_login_ui -->|"POSTs credentials"| node_login_route
node_navbar -->|"fetches session"| node_session_route
node_navbar -->|"POSTs logout"| node_logout_route
node_register_route -->|"queries and creates"| node_prisma_client
node_login_route -->|"looks up user"| node_prisma_client
node_prisma_client -->|"reads and writes"| node_user_store
node_register_route -->|"stores password hash"| node_user_store
node_login_route -->|"creates token"| node_token_service
node_session_route -->|"reads session"| node_token_service
node_logout_route -->|"uses cookie name"| node_token_service
node_visitor -->|"opens"| node_home
node_visitor -->|"opens"| node_firstpage
node_visitor -->|"opens"| node_browse
node_visitor -->|"opens"| node_profile
node_visitor -->|"opens"| node_admin
node_visitor -->|"opens"| node_reset

click node_register_ui "https://github.com/benelliot4631317/web-project/blob/main/app/register/page.tsx"
click node_login_ui "https://github.com/benelliot4631317/web-project/blob/main/app/login/page.tsx"
click node_auth_api "https://github.com/benelliot4631317/web-project/tree/main/app/api/auth"
click node_register_route "https://github.com/benelliot4631317/web-project/blob/main/app/api/auth/register/route.ts"
click node_login_route "https://github.com/benelliot4631317/web-project/blob/main/app/api/auth/login/route.ts"
click node_session_route "https://github.com/benelliot4631317/web-project/blob/main/app/api/auth/me/route.ts"
click node_logout_route "https://github.com/benelliot4631317/web-project/blob/main/app/api/auth/logout/route.ts"
click node_token_service "https://github.com/benelliot4631317/web-project/blob/main/lib/auth.ts"
click node_navbar "https://github.com/benelliot4631317/web-project/blob/main/components/navbar.tsx"
click node_home "https://github.com/benelliot4631317/web-project/blob/main/app/page.tsx"
click node_firstpage "https://github.com/benelliot4631317/web-project/blob/main/app/firstpage/page.tsx"
click node_browse "https://github.com/benelliot4631317/web-project/blob/main/app/browse/page.tsx"
click node_profile "https://github.com/benelliot4631317/web-project/blob/main/app/profile/page.tsx"
click node_admin "https://github.com/benelliot4631317/web-project/tree/main/app/admin"
click node_reset "https://github.com/benelliot4631317/web-project/blob/main/app/reset-password/page.tsx"
click node_user_store "https://github.com/benelliot4631317/web-project/blob/main/prisma/schema.prisma"
click node_prisma_client "https://github.com/benelliot4631317/web-project/blob/main/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_register_ui,node_login_ui,node_auth_api,node_register_route,node_login_route,node_session_route,node_logout_route,node_token_service,node_reset toneBlue
class node_navbar,node_home,node_firstpage toneAmber
class node_browse,node_profile,node_admin toneMint
class node_user_store,node_prisma_client toneRose
class node_visitor toneIndigo
```

## Components

### Accounts & Sessions

- [Registration Form](https://github.com/benelliot4631317/web-project/blob/main/app/register/page.tsx): `app/register/page.tsx`
- [Login Form](https://github.com/benelliot4631317/web-project/blob/main/app/login/page.tsx): `app/login/page.tsx`
- [Auth Endpoints](https://github.com/benelliot4631317/web-project/tree/main/app/api/auth): `app/api/auth`
- [Registration Handler](https://github.com/benelliot4631317/web-project/blob/main/app/api/auth/register/route.ts): `app/api/auth/register/route.ts`
- [Login Handler](https://github.com/benelliot4631317/web-project/blob/main/app/api/auth/login/route.ts): `app/api/auth/login/route.ts`
- [Session Endpoint](https://github.com/benelliot4631317/web-project/blob/main/app/api/auth/me/route.ts): `app/api/auth/me/route.ts`
- [Logout Handler](https://github.com/benelliot4631317/web-project/blob/main/app/api/auth/logout/route.ts): `app/api/auth/logout/route.ts`
- [JWT Sessions](https://github.com/benelliot4631317/web-project/blob/main/lib/auth.ts): `lib/auth.ts`
- [Password Reset](https://github.com/benelliot4631317/web-project/blob/main/app/reset-password/page.tsx): `app/reset-password/page.tsx`

### User Experience

- [Navigation Bar](https://github.com/benelliot4631317/web-project/blob/main/components/navbar.tsx): `components/navbar.tsx`
- [Home Page](https://github.com/benelliot4631317/web-project/blob/main/app/page.tsx): `app/page.tsx`
- [Landing Page](https://github.com/benelliot4631317/web-project/blob/main/app/firstpage/page.tsx): `app/firstpage/page.tsx`

### Internship Areas

- [Browse Page](https://github.com/benelliot4631317/web-project/blob/main/app/browse/page.tsx): `app/browse/page.tsx`
- [Profile Page](https://github.com/benelliot4631317/web-project/blob/main/app/profile/page.tsx): `app/profile/page.tsx`
- [Admin Area](https://github.com/benelliot4631317/web-project/tree/main/app/admin): `app/admin`

### Persistence

- [User Records](https://github.com/benelliot4631317/web-project/blob/main/prisma/schema.prisma): `prisma/schema.prisma`
- [Prisma Client](https://github.com/benelliot4631317/web-project/blob/main/lib/prisma.ts): `lib/prisma.ts`

### Other components

- **Visitor**

## Connections

- Visitor → Registration Form: opens
- Visitor → Login Form: opens
- Registration Form → Registration Handler: POSTs registration
- Login Form → Login Handler: POSTs credentials
- Navigation Bar → Session Endpoint: fetches session
- Navigation Bar → Logout Handler: POSTs logout
- Registration Handler → Prisma Client: queries and creates
- Login Handler → Prisma Client: looks up user
- Prisma Client → User Records: reads and writes
- Registration Handler → User Records: stores password hash
- Login Handler → JWT Sessions: creates token
- Session Endpoint → JWT Sessions: reads session
- Logout Handler → JWT Sessions: uses cookie name
- Visitor → Home Page: opens
- Visitor → Landing Page: opens
- Visitor → Browse Page: opens
- Visitor → Profile Page: opens
- Visitor → Admin Area: opens
- Visitor → Password Reset: opens
