How belema7/my-portfolio works
1. High-level shape
- This is a Next.js App Router personal portfolio with mostly static, content-driven pages.
- The architecture is split into three main layers: route/page composition in app/, reusable presentation components in components/ and sections/, and content/data utilities in content/, data/, and lib/.
2. Routing and page boundaries
- The app/ directory defines the public site routes: home, about, projects, blog, library, contact, plus a custom not-found page.
- Dynamic routes exist for blog posts (app/blog/[slug]) and project detail pages (app/projects/[slug]), indicating the site renders individual content items from a slug-based content source.
3. Layout and global shell
- app/layout.tsx is the root composition layer, likely wiring in global styles, theme provider, metadata, and the site shell.
- components/layout/ contains the persistent frame of the site: Navbar, Footer, and SiteShell, which are shared across routes.
- This boundary separates persistent chrome from route-specific content.
4. Section-based page composition
- The main pages are assembled from sections/ rather than being written as large page files.
- Each section folder maps to a domain area: home, about, contact, and library.
- This makes the pages composition-first: route files stay thin, while sections/* define the actual page experiences.
5. Content domains
- The site has four major content domains:
- Home: hero, selected projects, latest writing, skills, personal snapshot.
- About: story, timeline, skills, current goals.
- Projects: project grid and individual project pages.
- Writing/Library: blog posts, books, movies, quotes.
- These domains are reflected both in route structure and in the content organization under content/.
6. MDX-driven publishing layer
- Blog and library content are stored as MDX files under content/blog/... and content/library/....
- lib/blog/* provides the content-loading pipeline for posts: fetching all posts, fetching by slug, related/adjacent posts, and category filtering.
- lib/library/get-library-content.ts plays the same role for library items.
- components/mdx/MDXComponents.tsx defines the render mapping for MDX content, acting as the presentation boundary between authored content and the UI system.
7. Data model for profile content
- Static profile information is kept in data/: personal details, projects, skills, timeline, and helper utilities.
- This layer supports the about page, home sections, and project listings without requiring a backend.
- types/content.ts and lib/blog/types.ts, lib/library/types.ts define the content contracts that tie the MDX/data layer to the UI.
8. Project and writing presentation
- components/cards/ contains reusable card views for blog posts, books, movies, projects, and timeline entries.
- app/projects/ProjectsGrid.tsx and the blog/library views in sections/library/ use these cards to render collection pages.
- This keeps list rendering consistent across content types while allowing each domain to remain separate.
9. Contact flow
- The contact page is driven by sections/contact/ContactForm.tsx and ContactInfo.tsx.
- lib/email-service.ts indicates the form submits through EmailJS, meaning the site can send messages without a custom backend API.
- This is the main external interaction path on the site; everything else is mostly static rendering.
10. UI and theming
- components/ui/ contains the design-system primitives, including button, input, textarea, badge, dropdown menu, and layout helpers.
- components/theme-provider.tsx and components/layout/ThemeToggle.tsx support light/dark mode via next-themes.
- app/globals.css provides the global styling foundation, including the custom color palette mentioned in the README.
11. Reusable cross-cutting building blocks
- components/SkillTag.tsx, SocialLink.tsx, AppButton.tsx, Container.tsx, and SectionHeader.tsx are shared primitives used across many sections.
- These components act as the design vocabulary of the site and reduce duplication across route-specific sections.
12. Static assets and public files
- public/resume.pdf and public/projects/ are static assets exposed directly by the app.
- This suggests the portfolio uses a mix of code-rendered content and asset-based content delivery for downloads and imagery.
13. Architectural takeaway
- The repository is best understood as a content-managed portfolio front end: Next.js routes compose domain sections, sections read from static data and MDX content, and shared UI components keep presentation consistent.
- The only notable dynamic integration is the EmailJS contact flow; otherwise the app is largely static, SEO-friendly, and file-system driven.
Main entry points: SiteShell.tsx Site shell · AppButton.tsx UI kit · ProjectCard.tsx Cards · get-all-posts.ts Blog loader
Components 25
App Router
Routes, layout, and page composition
- Root layout · Global shell and providers
app/layout.tsx - Home · Landing page composition
app/page.tsx - About · About route
app/about/page.tsx - Projects · Projects listing route
app/projects/page.tsx - Project detail · Slug-based project page
app/projects/[slug]/page.tsx - Blog post · Slug-based post page
app/blog/[slug]/page.tsx - Library · Library collection route
app/library/page.tsx - Contact · Contact route
app/contact/page.tsx - Not found · Custom 404 page
app/not-found.tsx
Sections
Page-building sections for domain experiences
- Home sections · Hero, projects, writing, and profile blocks
- About sections · Story, skills, timeline, and goals
- Library views · Blog and library listing views
sections/library/BlogView.tsx - Contact flow · Contact form and info blocks
sections/contact/ContactForm.tsx
Components
Reusable UI, layout, cards, and MDX rendering
- Site shell · Persistent navigation and footer
components/layout/SiteShell.tsx - Navbar · Top-level site navigation
components/layout/Navbar.tsx - Footer · Bottom site chrome
components/layout/Footer.tsx - MDX renderer · Component mapping for authored content
components/mdx/MDXComponents.tsx - UI kit · Buttons, inputs, badges, containers, and headers
components/ui/AppButton.tsx - Cards · Reusable card views for content lists
components/cards/ProjectCard.tsx
Content
MDX-authored blog and library content
- MDX content · Blog and library source files
Data & Lib
Static data, content loaders, and services
- Profile data · Personal, project, skill, and timeline datasets
data/personal.ts - Blog loader · Fetch, filter, and relate posts
lib/blog/get-all-posts.ts - Library loader · Load library entries from MDX
lib/library/get-library-content.ts - Email service · EmailJS-backed submission path
lib/email-service.ts
Connections 23
- Root layout → Site shell: wraps · Root layout composes the persistent frame
- Site shell → Navbar: includes · Shell renders primary navigation
- Site shell → Footer: includes · Shell renders footer chrome
- Home → Home sections: assembles · Home route is built from sections
- About → About sections: assembles · About route is built from sections
- Projects → Cards: lists · Projects index uses project cards
- Project detail → Profile data: reads · Project detail pages use static project data
- Blog post → Blog loader: loads · Blog detail pages resolve posts by slug
- Blog post → MDX renderer: renders · Blog posts are rendered through MDX components
- Library → Library views: assembles · Library route uses collection views
- Contact → Contact flow: assembles · Contact route uses form and info sections
- MDX content → Blog loader: feeds · Blog MDX is indexed and queried through loaders
- MDX content → Library loader: feeds · Library MDX is loaded through content helpers
- Blog loader → MDX renderer: hydrates · Post content is prepared for rendering
- Library loader → MDX renderer: hydrates · Library entries are prepared for rendering
- Home sections → Profile data: consumes · Home sections read profile and project data
- About sections → Profile data: consumes · About sections read skills and timeline data
- Library views → Cards: uses · Listing views rely on reusable cards
- Contact flow → Email service: submits · Form submission is handled by EmailJS service
- UI kit → Site shell: supports · Core primitives underpin layout and sections
- UI kit → Home sections: supports · Shared primitives are used across page sections
- Cards → UI kit: built on · Cards compose the shared UI primitives
- Public assets → Projects: serves · Static project assets back portfolio pages