# shaafshahzad/portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/shaafshahzad/portfolio
- Repository: https://github.com/shaafshahzad/portfolio

## Overview

This repository is a small, content-driven Next.js portfolio site built with the App Router. It is primarily a front-end application with no obvious custom backend, API layer, or database. Most of the “application data” lives in TypeScript modules checked into the repo, which makes the site effectively a statically defined personal website.

Main architectural layers:

1. Route and page layer
- The `app/` directory defines the site’s routes.
- `app/page.tsx` is the home page.
- `app/projects/page.tsx` is the projects listing page.
- `app/resume/page.tsx` is the resume page.
- `app/layout.tsx` provides the shared top-level shell for all routes.

This means navigation is organized by route segments rather than a separate router configuration file.

2. Shared UI component layer
- `components/Navbar.tsx` is the global navigation.
- `components/Footer.tsx` is the site-wide footer.
- `components/Sidebar.tsx` suggests a secondary navigation or layout helper, likely used on some pages or for responsive layout.
- `components/Project.tsx` is the reusable project card/detail component.

These components are the main presentation building blocks reused across pages.

3. Content/data layer
- `lib/completedProjects.ts`
- `lib/ongoingProjects.ts`

These files likely export arrays or structured objects describing portfolio projects. The project pages probably consume this data and render it through `Project.tsx`. This is a key architectural boundary: project content is separated from UI rendering, but it still lives in the codebase rather than an external CMS.

4. Cross-cutting concerns
- `app/_analytics/provider.tsx` indicates an analytics integration wrapped into the app shell, likely initialized near the root layout so page views can be tracked across routes.
- `app/globals.css` contains global styles.
- `tailwind.config.ts` and `postcss.config.js` indicate Tailwind CSS is the primary styling system, with PostCSS in the build pipeline.
- `next.config.js`, `tsconfig.json`, and `.eslintrc.json` define build/runtime, TypeScript, and linting behavior.

5. Static asset layer
- `public/ShaafShahzadResume2024.pdf` is a directly served static file used by the resume page or linked from navigation.
- The `public/` directory is the normal Next.js static asset boundary.

Important data flow:
- A request enters one of the route pages under `app/`.
- `app/layout.tsx` wraps the route with shared structure such as navigation, footer, and any analytics/provider setup.
- Pages import reusable UI from `components/`.
- Project pages pull structured content from `lib/` and pass it into `components/Project.tsx`.
- The resume page likely links to or embeds the PDF from `public/`.
- Styling is applied through Tailwind classes and global CSS.

Technologies that materially shape the architecture:
- Next.js App Router for route-based composition and shared layouts.
- React components for UI reuse.
- TypeScript for typed content and component contracts.
- Tailwind CSS for utility-first styling.
- Vercel is the intended deployment target according to the README, which fits a mostly static, file-based portfolio site.

In diagram terms, this repo is best represented as:
- A root layout/shell
- Three primary content routes
- A shared component library
- Static typed content modules for projects
- A static assets area for the resume PDF
- A lightweight analytics cross-cutting layer

Main entry points: [`app/layout.tsx`](https://github.com/shaafshahzad/portfolio/blob/HEAD/app/layout.tsx) (Root shell), [`app/projects/page.tsx`](https://github.com/shaafshahzad/portfolio/blob/HEAD/app/projects/page.tsx) (Projects), [`components/Navbar.tsx`](https://github.com/shaafshahzad/portfolio/blob/HEAD/components/Navbar.tsx) (Navbar), [`components/Project.tsx`](https://github.com/shaafshahzad/portfolio/blob/HEAD/components/Project.tsx) (Project)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph "Routes"
  app_layout["Root shell<br/>layout<br/>[layout.tsx]"]
  app_home["Home<br/>page<br/>[page.tsx]"]
  app_projects["Projects<br/>page<br/>[page.tsx]"]
  app_resume["Resume<br/>page<br/>[page.tsx]"]
end

subgraph "UI"
  navbar["Navbar<br/>[Navbar.tsx]"]
  footer["Footer<br/>[Footer.tsx]"]
  sidebar["Sidebar<br/>side-nav<br/>[Sidebar.tsx]"]
  project_card["Project<br/>card<br/>[Project.tsx]"]
end

subgraph "Content"
  completed_projects["Completed<br/>content list"]
  ongoing_projects["Ongoing<br/>content list<br/>[ongoingProjects.ts]"]
end

subgraph "Cross-cutting"
  analytics_provider["Analytics<br/>provider<br/>[provider.tsx]"]
  globals_css["Global CSS<br/>styles<br/>[globals.css]"]
end

subgraph "Assets"
  resume_pdf["Resume PDF<br/>static asset"]
end

subgraph "Config"
  next_config{{"Next config<br/>build config<br/>[next.config.js]"}}
  tailwind_config{{"Tailwind<br/>style config<br/>[tailwind.config.ts]"}}
  postcss_config{{"PostCSS<br/>build config<br/>[postcss.config.js]"}}
  tsconfig{{"TS config<br/>tooling config<br/>[tsconfig.json]"}}
  eslint_config{{"ESLint<br/>tooling config<br/>[.eslintrc.json]"}}
end

app_layout -->|"includes"| navbar
app_layout -->|"includes"| footer
app_layout -->|"wraps"| analytics_provider
app_layout -->|"imports"| globals_css
app_layout -->|"hosts"| app_home
app_layout -->|"hosts"| app_projects
app_layout -->|"hosts"| app_resume
app_home -->|"may reuse"| project_card
app_projects -->|"reads"| completed_projects
app_projects -->|"reads"| ongoing_projects
app_projects -->|"renders"| project_card
app_resume -->|"links"| resume_pdf
navbar -->|"navigates"| app_home
navbar -->|"navigates"| app_projects
navbar -->|"navigates"| app_resume
sidebar -->|"supports"| app_projects
sidebar -->|"supports"| app_resume
completed_projects -->|"feeds"| project_card
ongoing_projects -->|"feeds"| project_card
tailwind_config -->|"drives"| globals_css
postcss_config -->|"enables"| tailwind_config
next_config -->|"configures"| app_layout
tsconfig -->|"types"| app_layout
eslint_config -->|"governs"| app_layout
eslint_config -->|"governs"| navbar
eslint_config -->|"governs"| project_card

click app_layout "https://github.com/shaafshahzad/portfolio/blob/main/app/layout.tsx"
click app_home "https://github.com/shaafshahzad/portfolio/blob/main/app/page.tsx"
click app_projects "https://github.com/shaafshahzad/portfolio/blob/main/app/projects/page.tsx"
click app_resume "https://github.com/shaafshahzad/portfolio/blob/main/app/resume/page.tsx"
click navbar "https://github.com/shaafshahzad/portfolio/blob/main/components/Navbar.tsx"
click footer "https://github.com/shaafshahzad/portfolio/blob/main/components/Footer.tsx"
click sidebar "https://github.com/shaafshahzad/portfolio/blob/main/components/Sidebar.tsx"
click project_card "https://github.com/shaafshahzad/portfolio/blob/main/components/Project.tsx"
click completed_projects "https://github.com/shaafshahzad/portfolio/blob/main/lib/completedProjects.ts"
click ongoing_projects "https://github.com/shaafshahzad/portfolio/blob/main/lib/ongoingProjects.ts"
click analytics_provider "https://github.com/shaafshahzad/portfolio/blob/main/app/_analytics/provider.tsx"
click globals_css "https://github.com/shaafshahzad/portfolio/blob/main/app/globals.css"
click resume_pdf "https://github.com/shaafshahzad/portfolio/blob/main/public/ShaafShahzadResume2024.pdf"
click next_config "https://github.com/shaafshahzad/portfolio/blob/main/next.config.js"
click tailwind_config "https://github.com/shaafshahzad/portfolio/blob/main/tailwind.config.ts"
click postcss_config "https://github.com/shaafshahzad/portfolio/blob/main/postcss.config.js"
click tsconfig "https://github.com/shaafshahzad/portfolio/blob/main/tsconfig.json"
click eslint_config "https://github.com/shaafshahzad/portfolio/blob/main/.eslintrc.json"

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 app_layout,app_home,app_projects,app_resume toneBlue
class navbar,footer,sidebar,project_card toneAmber
class completed_projects,ongoing_projects toneMint
class analytics_provider,globals_css toneRose
class resume_pdf toneIndigo
class next_config,tailwind_config,postcss_config,tsconfig,eslint_config toneTeal
```

## Components

### Routes

App Router pages and shared shell

- [Root shell](https://github.com/shaafshahzad/portfolio/blob/HEAD/app/layout.tsx): layout · Shared application wrapper for all routes · `app/layout.tsx`
- [Home](https://github.com/shaafshahzad/portfolio/blob/HEAD/app/page.tsx): page · Landing page · `app/page.tsx`
- [Projects](https://github.com/shaafshahzad/portfolio/blob/HEAD/app/projects/page.tsx): page · Projects listing page · `app/projects/page.tsx`
- [Resume](https://github.com/shaafshahzad/portfolio/blob/HEAD/app/resume/page.tsx): page · Resume page · `app/resume/page.tsx`

### UI

Reusable presentation components

- [Navbar](https://github.com/shaafshahzad/portfolio/blob/HEAD/components/Navbar.tsx): nav · Global navigation · `components/Navbar.tsx`
- [Footer](https://github.com/shaafshahzad/portfolio/blob/HEAD/components/Footer.tsx): footer · Site footer · `components/Footer.tsx`
- [Sidebar](https://github.com/shaafshahzad/portfolio/blob/HEAD/components/Sidebar.tsx): side-nav · Secondary navigation or layout aid · `components/Sidebar.tsx`
- [Project](https://github.com/shaafshahzad/portfolio/blob/HEAD/components/Project.tsx): card · Reusable project display component · `components/Project.tsx`

### Content

Typed portfolio data modules

- [Completed](https://github.com/shaafshahzad/portfolio/blob/HEAD/lib/completedProjects.ts): content list · Completed project data · `lib/completedProjects.ts`
- [Ongoing](https://github.com/shaafshahzad/portfolio/blob/HEAD/lib/ongoingProjects.ts): content list · Ongoing project data · `lib/ongoingProjects.ts`

### Cross-cutting

Analytics and global styling

- [Analytics](https://github.com/shaafshahzad/portfolio/blob/HEAD/app/_analytics/provider.tsx): provider · Analytics wrapper · `app/_analytics/provider.tsx`
- [Global CSS](https://github.com/shaafshahzad/portfolio/blob/HEAD/app/globals.css): styles · Application-wide styles · `app/globals.css`

### Assets

Static public files

- [Resume PDF](https://github.com/shaafshahzad/portfolio/blob/HEAD/public/ShaafShahzadResume2024.pdf): static asset · Directly served resume file · `public/ShaafShahzadResume2024.pdf`

### Config

Build and toolchain settings

- [Next config](https://github.com/shaafshahzad/portfolio/blob/HEAD/next.config.js): build config · Next.js runtime/build settings · `next.config.js`
- [Tailwind](https://github.com/shaafshahzad/portfolio/blob/HEAD/tailwind.config.ts): style config · Tailwind CSS configuration · `tailwind.config.ts`
- [PostCSS](https://github.com/shaafshahzad/portfolio/blob/HEAD/postcss.config.js): build config · PostCSS pipeline configuration · `postcss.config.js`
- [TS config](https://github.com/shaafshahzad/portfolio/blob/HEAD/tsconfig.json): tooling config · TypeScript compiler settings · `tsconfig.json`
- [ESLint](https://github.com/shaafshahzad/portfolio/blob/HEAD/.eslintrc.json): tooling config · Linting rules · `.eslintrc.json`

## Connections

- Root shell → Navbar: includes · Shared shell renders site navigation
- Root shell → Footer: includes · Shared shell renders site footer
- Root shell → Analytics: wraps · Analytics is initialized at the root
- Root shell → Global CSS: imports · Root layout applies global styles
- Root shell → Home: hosts · Layout wraps the home route
- Root shell → Projects: hosts · Layout wraps the projects route
- Root shell → Resume: hosts · Layout wraps the resume route
- Home → Project: may reuse · Home page can reuse shared project rendering
- Projects → Completed: reads · Projects page consumes completed project content
- Projects → Ongoing: reads · Projects page consumes ongoing project content
- Projects → Project: renders · Projects are displayed through the reusable card
- Resume → Resume PDF: links · Resume page references the static PDF
- Navbar → Home: navigates · Global navigation links to home
- Navbar → Projects: navigates · Global navigation links to projects
- Navbar → Resume: navigates · Global navigation links to resume
- Sidebar → Projects: supports · Secondary navigation may surface project routes
- Sidebar → Resume: supports · Secondary navigation may surface resume route
- Completed → Project: feeds · Project data is passed into the card component
- Ongoing → Project: feeds · Project data is passed into the card component
- Tailwind → Global CSS: drives · Tailwind utilities are composed with global CSS
- PostCSS → Tailwind: enables · PostCSS pipeline supports Tailwind processing
- Next config → Root shell: configures · Next.js config shapes the app runtime
- TS config → Root shell: types · TypeScript settings apply across the app
- ESLint → Root shell: governs · Linting applies to application source
- ESLint → Navbar: governs · Linting applies to UI components
- ESLint → Project: governs · Linting applies to UI components
