How mark-fender/mark-fender-portfolio works
Project Type and Purpose
• This is a full-stack, server-side rendered (SSR) personal portfolio built with Next.js and TypeScript.
• It serves HTML/CSS/JS to browsers, uses a serverless function to handle contact-form submissions, and is optimized for static and dynamic rendering.
File Structure
• “src/app”: Next.js app directory with the layout, global styles, fonts, and root page (app/layout.tsx, app/page.tsx).
• “src/components”: React UI components (Header, About, Skills, etc.) organized by feature, each with custom hooks for data or behavior.
• “src/actions/sendEmail.ts”: A serverless API route (Next.js API function) to process form submissions.
• “src/context” & “src/hooks”: Context providers and shared hooks for app-wide state (e.g. active section, theme).
• “src/lib” & “src/utils”: Data definitions and pure utility functions (error handling, validation).
• “public/assets”: Static images/fonts served directly.
• Configuration files: next.config.js, tsconfig.json, ESLint, Prettier, postcss.config.js.
README for Additional Insights
• Confirms this is your personal developer portfolio.
Main Components & Their Relationships
a. Client (Browser)
– Renders HTML, CSS, JS shipped by Next.js.
– Interacts with the UI (components in src/components) and triggers API calls.
b. Next.js Server / Hosting Environment (e.g., Vercel)
– Performs SSR/SSG on requests to pages under src/app.
– Serves static files from /public via CDN.
– Exposes API endpoints (src/actions/sendEmail.ts) as serverless functions.
c. Serverless Function: sendEmail
– Receives POST requests from the ContactFormEmail component.
– Validates input (via src/utils/validation) and dispatches email via an external SMTP or Email API.
d. External Email Service
– SMTP provider or API (e.g., SendGrid, Mailgun).
– Receives mail requests from sendEmail function.
e. Data & State Layers
– Context Providers: manage UI state (active section, theme) across the component tree.
– Hooks: encapsulate logic for data fetching (Intro, Experience, Projects) and UI behavior.
– Static Data: src/lib/data.tsx serves as a mock data source for projects/experience.
Architectural Patterns & Design Principles
• Component-based UI (React functional components + hooks).
• Separation of concerns:
– UI vs. state (components vs. context/hooks).
– Front-end vs. business logic (components vs. utils/actions).
– SSR/SSG pages vs. client-only components.
• Serverless microservice for email—keeps form handling decoupled from UI.
Checklist
[ ] Clear labels for: Browser, Next.js Server, API functions, External Services
[ ] Boundaries: Front-end vs. Back-end vs. External
[ ] All major file-tree sections represented:
• src/app (pages/layout)
• src/components (UI modules)
• src/context & src/hooks (state management)
• src/actions (serverless API)
• src/lib/utils (data/logic)
• public/assets (static files)