# anuradha-harshana/stagen architecture

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

- Interactive diagram: https://gitdiagram.com/anuradha-harshana/stagen
- Repository: https://github.com/anuradha-harshana/stagen

## Overview

STAGEN is a Next.js frontend for a construction platform connecting builders and customers. The visible user workflow is account registration or sign-in, followed by role-oriented company, customer, trade, and web-admin areas. Registration currently validates form data and logs it locally; the sampled code shows no authentication service, persistence, or protected-area behavior. The README is a generic Next.js starter, and the protected areas are represented only by layouts in the available tree.

Main entry points: [`components/ui/RegisterForm.tsx`](https://github.com/anuradha-harshana/stagen/blob/main/components/ui/RegisterForm.tsx) (Registration form), [`app/login/page.tsx`](https://github.com/anuradha-harshana/stagen/blob/main/app/login/page.tsx) (Login page), [`app/(auth)/register/page.tsx`](https://github.com/anuradha-harshana/stagen/blob/main/app/(auth)/register/page.tsx) (Registration page), [`components/ui/LoginForm.tsx`](https://github.com/anuradha-harshana/stagen/blob/main/components/ui/LoginForm.tsx) (Login form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_auth["Account access"]
  node_login_page["Login page<br/>[page.tsx]"]
  node_login_form["Login form<br/>[LoginForm.tsx]"]
  node_register_page["Registration page<br/>[page.tsx]"]
  node_register_form["Registration form<br/>[RegisterForm.tsx]"]
  node_register_validation["Registration validation<br/>[validation.ts]"]
end

subgraph group_workspaces["Role workspaces"]
  node_company_admin["Company admin<br/>[layout.tsx]"]
  node_company_management["Company management<br/>[layout.tsx]"]
  node_customer_area["Customer area<br/>[layout.tsx]"]
  node_trades_area["Trades area<br/>[layout.tsx]"]
  node_web_admin["Web admin<br/>[layout.tsx]"]
end

subgraph group_app_shell["Application shell"]
  node_home["Home route<br/>[page.tsx]"]
  node_root_layout["Root layout<br/>[layout.tsx]"]
  node_user_types["User role types<br/>[types.ts]"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_home
node_visitor -->|"opens"| node_login_page
node_visitor -->|"opens"| node_register_page
node_login_page -->|"renders"| node_login_form
node_register_page -->|"renders"| node_register_form
node_register_form -->|"validates with"| node_register_validation
node_register_form -->|"links to"| node_login_page
node_login_form -->|"links to"| node_register_page

click node_home "https://github.com/anuradha-harshana/stagen/blob/main/app/page.tsx"
click node_login_page "https://github.com/anuradha-harshana/stagen/blob/main/app/login/page.tsx"
click node_login_form "https://github.com/anuradha-harshana/stagen/blob/main/components/ui/LoginForm.tsx"
click node_register_page "https://github.com/anuradha-harshana/stagen/blob/main/app/(auth)/register/page.tsx"
click node_register_form "https://github.com/anuradha-harshana/stagen/blob/main/components/ui/RegisterForm.tsx"
click node_register_validation "https://github.com/anuradha-harshana/stagen/blob/main/lib/validation.ts"
click node_company_admin "https://github.com/anuradha-harshana/stagen/blob/main/app/(protected)/company-admin/layout.tsx"
click node_company_management "https://github.com/anuradha-harshana/stagen/blob/main/app/(protected)/company-management/layout.tsx"
click node_customer_area "https://github.com/anuradha-harshana/stagen/blob/main/app/(protected)/customer/layout.tsx"
click node_trades_area "https://github.com/anuradha-harshana/stagen/blob/main/app/(protected)/trades/layout.tsx"
click node_web_admin "https://github.com/anuradha-harshana/stagen/blob/main/app/(protected)/web-admin/layout.tsx"
click node_root_layout "https://github.com/anuradha-harshana/stagen/blob/main/app/layout.tsx"
click node_user_types "https://github.com/anuradha-harshana/stagen/blob/main/lib/types/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_login_page,node_login_form,node_register_page,node_register_form,node_register_validation toneBlue
class node_company_admin,node_company_management,node_customer_area,node_trades_area,node_web_admin toneAmber
class node_home,node_root_layout,node_user_types toneMint
class node_visitor toneIndigo
```

## Components

### Account access

- [Login page](https://github.com/anuradha-harshana/stagen/blob/main/app/login/page.tsx): `app/login/page.tsx`
- [Login form](https://github.com/anuradha-harshana/stagen/blob/main/components/ui/LoginForm.tsx): `components/ui/LoginForm.tsx`
- [Registration page](https://github.com/anuradha-harshana/stagen/blob/main/app/(auth)/register/page.tsx): `app/(auth)/register/page.tsx`
- [Registration form](https://github.com/anuradha-harshana/stagen/blob/main/components/ui/RegisterForm.tsx): `components/ui/RegisterForm.tsx`
- [Registration validation](https://github.com/anuradha-harshana/stagen/blob/main/lib/validation.ts): `lib/validation.ts`

### Role workspaces

- [Company admin](https://github.com/anuradha-harshana/stagen/blob/main/app/(protected)/company-admin/layout.tsx): `app/(protected)/company-admin/layout.tsx`
- [Company management](https://github.com/anuradha-harshana/stagen/blob/main/app/(protected)/company-management/layout.tsx): `app/(protected)/company-management/layout.tsx`
- [Customer area](https://github.com/anuradha-harshana/stagen/blob/main/app/(protected)/customer/layout.tsx): `app/(protected)/customer/layout.tsx`
- [Trades area](https://github.com/anuradha-harshana/stagen/blob/main/app/(protected)/trades/layout.tsx): `app/(protected)/trades/layout.tsx`
- [Web admin](https://github.com/anuradha-harshana/stagen/blob/main/app/(protected)/web-admin/layout.tsx): `app/(protected)/web-admin/layout.tsx`

### Application shell

- [Home route](https://github.com/anuradha-harshana/stagen/blob/main/app/page.tsx): `app/page.tsx`
- [Root layout](https://github.com/anuradha-harshana/stagen/blob/main/app/layout.tsx): `app/layout.tsx`
- [User role types](https://github.com/anuradha-harshana/stagen/blob/main/lib/types/types.ts): `lib/types/types.ts`

### Other components

- **Visitor**

## Connections

- Visitor → Home route: opens
- Visitor → Login page: opens
- Visitor → Registration page: opens
- Login page → Login form: renders
- Registration page → Registration form: renders
- Registration form → Registration validation: validates with
- Registration form → Login page: links to
- Login form → Registration page: links to
