# hemank-kumar/ashu-portfolio architecture

> Architecture diagram of the GitHub repository hemank-kumar/ashu-portfolio, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hemank-kumar/ashu-portfolio
- Repository: https://github.com/hemank-kumar/ashu-portfolio

## Overview

#### Purpose and Runtime
This is a Next.js 16 App Router portfolio for Ashutosh Singh, presenting data/ML, engineering skills, projects, and contact information through animated UI and a WebGL background. It runs as a Node/Next server with SSR-capable routes and browser-side React, Framer Motion, Three.js, and React Three Fiber.

Primary public entry points are `app/page.tsx`, `app/projects/page.tsx`, `app/skills/page.tsx`, and `app/contact/page.tsx`. Alternate/profile routes are `app/malik/page.tsx` and `app/pravesh/page.tsx`.

#### Application Shell, Metadata, and Discovery
The root application shell establishes shared layout, global styling, and site-level SEO/structured metadata:
- `app/layout.tsx`
- `app/globals.css`
- `app/template.tsx`

Search-discovery endpoints are generated through App Router metadata routes:
- `app/sitemap.ts`
- `app/robots.ts`

These form a boundary between crawler-facing metadata and the interactive portfolio UI.

#### Homepage Composition
`app/page.tsx` is the main composition point for the portfolio experience. It assembles reusable UI sections for navigation, hero content, credentials, skills, work, and outreach:
- `components/ui/Navigation.tsx`
- `components/ui/HeroSection.tsx`
- `components/ui/ProjectsSection.tsx`

Supporting content stages include timeline/leadership presentation, animated telemetry, and contact/footer rendering:
- `components/ui/JourneyTimeline.tsx`
- `components/ui/LiveMetrics.tsx`
- `components/ui/ContactSection.tsx`

The primary browser-side flow is user scrolling/navigation → section rendering and motion effects → route transitions to dedicated projects, skills, and contact pages.

#### 3D Rendering Boundary
The immersive visual layer is isolated under the canvas components:
- `components/canvas/SceneManager.tsx`
- `components/canvas/DataModel3D.tsx`

`SceneManager` likely owns the React Three Fiber canvas lifecycle and scene composition, while `DataModel3D` represents a model/particle visualization. This boundary keeps WebGL rendering separate from conventional DOM sections, limiting Three.js-specific state and rendering work to the client-side graphics subsystem.

#### Server Actions and Content Mutation
Server-oriented action modules centralize mutations or data operations for portfolio-managed content:
- `actions/cmsActions.ts`
- `actions/contactActions.ts`
- `actions/projectActions.ts`

The expected control flow is UI/admin interaction → server action → persistence layer. Contact submission and project/CMS operations should cross this boundary rather than embedding database access in presentation components.

#### Persistence and Authentication
Prisma provides the database abstraction:
- `prisma/schema.prisma`
- `lib/db.ts`

Authentication is exposed through the NextAuth catch-all API route:
- `app/api/auth/[...nextauth]/route.ts`
- `components/ui/LogoutButton.tsx`

This establishes an authenticated/admin-capable boundary distinct from public portfolio browsing. Actions can use the shared database client and auth context to protect CMS/project operations.

#### Route and Page Segmentation
Dedicated route pages provide focused views rather than a single monolithic landing page:
- `app/projects/page.tsx`
- `app/skills/page.tsx`
- `app/contact/page.tsx`

The `app/malik/layout.tsx` route-local layout indicates that the Malik subtree can apply a distinct shell or presentation policy independently of the root layout. Route segmentation allows content-specific rendering while retaining shared global styling and metadata infrastructure.

Main entry points: [`app/layout.tsx`](https://github.com/hemank-kumar/ashu-portfolio/blob/main/app/layout.tsx) (Root layout), [`components/ui/Navigation.tsx`](https://github.com/hemank-kumar/ashu-portfolio/blob/main/components/ui/Navigation.tsx) (Navigation), [`app/page.tsx`](https://github.com/hemank-kumar/ashu-portfolio/blob/main/app/page.tsx) (Home page), [`app/contact/page.tsx`](https://github.com/hemank-kumar/ashu-portfolio/blob/main/app/contact/page.tsx) (Contact page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routes["App Routes"]
  node_root_layout["Root layout<br/>Next layout<br/>[layout.tsx]"]
  node_global_styles["Global styles<br/>CSS<br/>[globals.css]"]
  node_page_template["Page template<br/>Next template<br/>[template.tsx]"]
  node_home_page["Home page<br/>Next page<br/>[page.tsx]"]
  node_projects_page["Projects page<br/>Next page<br/>[page.tsx]"]
  node_skills_page["Skills page<br/>Next page<br/>[page.tsx]"]
  node_contact_page["Contact page<br/>Next page<br/>[page.tsx]"]
  node_profile_routes["Profile routes<br/>Next pages"]
  node_malik_layout["Malik layout<br/>Route layout<br/>[layout.tsx]"]
  node_discovery_routes["Crawler metadata<br/>Metadata routes"]
end

subgraph group_ui["Portfolio UI"]
  node_navigation["Navigation<br/>React component<br/>[Navigation.tsx]"]
  node_portfolio_sections["Portfolio sections<br/>React sections"]
  node_webgl_scene{{"WebGL scene<br/>React Three Fiber<br/>[SceneManager.tsx]"}}
  node_data_model{{"3D data model<br/>Three.js component<br/>[DataModel3D.tsx]"}}
  node_logout_button["Logout control<br/>React component<br/>[LogoutButton.tsx]"]
end

subgraph group_backend["Content Backend"]
  node_content_actions["Content actions<br/>Server actions<br/>[cmsActions.ts]"]
  node_contact_action["Contact action<br/>Server action<br/>[contactActions.ts]"]
  node_auth_api["Auth API<br/>NextAuth route<br/>[route.ts]"]
  node_database_client[("Database client<br/>Prisma client<br/>[db.ts]")]
  node_database_schema[("Database schema<br/>Prisma schema<br/>[schema.prisma]")]
end

node_root_layout -->|"loads"| node_global_styles
node_root_layout -->|"wraps routes with"| node_page_template
node_root_layout -->|"hosts"| node_home_page
node_root_layout -->|"hosts"| node_projects_page
node_root_layout -->|"hosts"| node_skills_page
node_root_layout -->|"hosts"| node_contact_page
node_profile_routes -->|"uses local shell"| node_malik_layout
node_home_page -->|"renders"| node_navigation
node_home_page -->|"composes"| node_portfolio_sections
node_portfolio_sections -->|"embeds"| node_webgl_scene
node_webgl_scene -->|"renders"| node_data_model
node_navigation -->|"navigates to"| node_projects_page
node_navigation -->|"navigates to"| node_skills_page
node_navigation -->|"navigates to"| node_contact_page
node_contact_page -->|"submits through"| node_contact_action
node_content_actions -->|"persists via"| node_database_client
node_contact_action -->|"persists via"| node_database_client
node_database_client -->|"uses"| node_database_schema
node_logout_button -->|"ends session through"| node_auth_api
node_content_actions -.->|"uses auth context"| node_auth_api
node_discovery_routes -.->|"reflects site metadata"| node_root_layout

click node_root_layout "https://github.com/hemank-kumar/ashu-portfolio/blob/main/app/layout.tsx"
click node_global_styles "https://github.com/hemank-kumar/ashu-portfolio/blob/main/app/globals.css"
click node_page_template "https://github.com/hemank-kumar/ashu-portfolio/blob/main/app/template.tsx"
click node_home_page "https://github.com/hemank-kumar/ashu-portfolio/blob/main/app/page.tsx"
click node_projects_page "https://github.com/hemank-kumar/ashu-portfolio/blob/main/app/projects/page.tsx"
click node_skills_page "https://github.com/hemank-kumar/ashu-portfolio/blob/main/app/skills/page.tsx"
click node_contact_page "https://github.com/hemank-kumar/ashu-portfolio/blob/main/app/contact/page.tsx"
click node_malik_layout "https://github.com/hemank-kumar/ashu-portfolio/blob/main/app/malik/layout.tsx"
click node_navigation "https://github.com/hemank-kumar/ashu-portfolio/blob/main/components/ui/Navigation.tsx"
click node_webgl_scene "https://github.com/hemank-kumar/ashu-portfolio/blob/main/components/canvas/SceneManager.tsx"
click node_data_model "https://github.com/hemank-kumar/ashu-portfolio/blob/main/components/canvas/DataModel3D.tsx"
click node_content_actions "https://github.com/hemank-kumar/ashu-portfolio/blob/main/actions/cmsActions.ts"
click node_contact_action "https://github.com/hemank-kumar/ashu-portfolio/blob/main/actions/contactActions.ts"
click node_auth_api "https://github.com/hemank-kumar/ashu-portfolio/blob/main/app/api/auth/%5B...nextauth%5D/route.ts"
click node_logout_button "https://github.com/hemank-kumar/ashu-portfolio/blob/main/components/ui/LogoutButton.tsx"
click node_database_client "https://github.com/hemank-kumar/ashu-portfolio/blob/main/lib/db.ts"
click node_database_schema "https://github.com/hemank-kumar/ashu-portfolio/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_root_layout,node_global_styles,node_page_template,node_home_page,node_projects_page,node_skills_page,node_contact_page,node_profile_routes,node_malik_layout,node_discovery_routes toneBlue
class node_navigation,node_portfolio_sections,node_webgl_scene,node_data_model,node_logout_button toneAmber
class node_content_actions,node_contact_action,node_auth_api,node_database_client,node_database_schema toneMint
```

## Components

### App Routes

App Router pages, layouts, and metadata endpoints.

- [Root layout](https://github.com/hemank-kumar/ashu-portfolio/blob/main/app/layout.tsx): Next layout · Defines the shared application shell and global metadata. · `app/layout.tsx`
- [Global styles](https://github.com/hemank-kumar/ashu-portfolio/blob/main/app/globals.css): CSS · `app/globals.css`
- [Page template](https://github.com/hemank-kumar/ashu-portfolio/blob/main/app/template.tsx): Next template · Applies shared route-transition presentation. · `app/template.tsx`
- [Home page](https://github.com/hemank-kumar/ashu-portfolio/blob/main/app/page.tsx): Next page · Main portfolio composition entry point. · `app/page.tsx`
- [Projects page](https://github.com/hemank-kumar/ashu-portfolio/blob/main/app/projects/page.tsx): Next page · `app/projects/page.tsx`
- [Skills page](https://github.com/hemank-kumar/ashu-portfolio/blob/main/app/skills/page.tsx): Next page · `app/skills/page.tsx`
- [Contact page](https://github.com/hemank-kumar/ashu-portfolio/blob/main/app/contact/page.tsx): Next page · `app/contact/page.tsx`
- **Profile routes**: Next pages · Alternate Malik and Pravesh profile views.
- [Malik layout](https://github.com/hemank-kumar/ashu-portfolio/blob/main/app/malik/layout.tsx): Route layout · Applies a route-local shell to the Malik subtree. · `app/malik/layout.tsx`
- **Crawler metadata**: Metadata routes · Generates sitemap and robots responses.

### Portfolio UI

Reusable browser-rendered sections and graphics.

- [Navigation](https://github.com/hemank-kumar/ashu-portfolio/blob/main/components/ui/Navigation.tsx): React component · Connects portfolio sections and dedicated routes. · `components/ui/Navigation.tsx`
- **Portfolio sections**: React sections · Hero, projects, journey, metrics, and contact presentation.
- [WebGL scene](https://github.com/hemank-kumar/ashu-portfolio/blob/main/components/canvas/SceneManager.tsx): React Three Fiber · Client-side canvas lifecycle and data-model visualization. · `components/canvas/SceneManager.tsx`
- [3D data model](https://github.com/hemank-kumar/ashu-portfolio/blob/main/components/canvas/DataModel3D.tsx): Three.js component · `components/canvas/DataModel3D.tsx`
- [Logout control](https://github.com/hemank-kumar/ashu-portfolio/blob/main/components/ui/LogoutButton.tsx): React component · `components/ui/LogoutButton.tsx`

### Content Backend

Server actions, authentication, and persistence.

- [Content actions](https://github.com/hemank-kumar/ashu-portfolio/blob/main/actions/cmsActions.ts): Server actions · CMS and project content mutations. · `actions/cmsActions.ts`
- [Contact action](https://github.com/hemank-kumar/ashu-portfolio/blob/main/actions/contactActions.ts): Server action · Handles contact submissions. · `actions/contactActions.ts`
- [Auth API](https://github.com/hemank-kumar/ashu-portfolio/blob/main/app/api/auth/%5B...nextauth%5D/route.ts): NextAuth route · Provides authenticated admin context. · `app/api/auth/[...nextauth]/route.ts`
- [Database client](https://github.com/hemank-kumar/ashu-portfolio/blob/main/lib/db.ts): Prisma client · Shared persistence access layer. · `lib/db.ts`
- [Database schema](https://github.com/hemank-kumar/ashu-portfolio/blob/main/prisma/schema.prisma): Prisma schema · `prisma/schema.prisma`

## Connections

- Root layout → Global styles: loads
- Root layout → Page template: wraps routes with
- Root layout → Home page: hosts
- Root layout → Projects page: hosts
- Root layout → Skills page: hosts
- Root layout → Contact page: hosts
- Profile routes → Malik layout: uses local shell
- Home page → Navigation: renders
- Home page → Portfolio sections: composes
- Portfolio sections → WebGL scene: embeds
- WebGL scene → 3D data model: renders
- Navigation → Projects page: navigates to
- Navigation → Skills page: navigates to
- Navigation → Contact page: navigates to
- Contact page → Contact action: submits through
- Content actions → Database client: persists via
- Contact action → Database client: persists via
- Database client → Database schema: uses
- Logout control → Auth API: ends session through
- Content actions → Auth API: uses auth context
- Crawler metadata → Root layout: reflects site metadata
