How baldurlogi/portfolio-website works
Project type and purpose
• This is a full-stack Next.js personal portfolio website with an integrated contact form and email-sending feature.
• The top-level folders (app/, components/, context/, actions/, email/, lib/) + the react-email-starter subfolder indicate both a Next.js “App Router” frontend and some server-side logic (Next.js Server Actions) for sending emails.
File structure
• app/
• Next.js App Router entrypoints (layout.tsx, page.tsx) and global CSS.
• Renders React components from components/ and reads data from lib/data.ts.
• components/
• Reusable UI pieces: header, footer, about, projects, contact form, theme switch, etc.
• context/
• React Context providers for tracking active page section and theme.
• actions/sendEmail.tsx
• A Next.js Server Action that processes the contact form data and dispatches an email.
• email/contact-form-email.tsx
• An email template component that formats the contact form submission.
• lib/
• Shared utilities, type definitions, data sources, custom hooks.
• public/
• react-email-starter/
• A self-contained Next.js app used to develop & preview email templates (full code under .react-email).
• Configuration files
• next.config.js, tailwind.config.js, tsconfig.json, ESLint, PostCSS.
README
• Confirms this was bootstrapped with create-next-app using Next.js App Router and automatic font optimization.
• No mention of databases—email sending is the only backend interaction.
• Deployment target is Vercel.
a. Main Components
1. Client Browser (User)
2. Next.js Frontend (App Router)
– UI Components (components/)
– Context Providers (context/)
– Styling (Tailwind via globals.css & tailwind.config.js)
3. Next.js Server Actions
– Contact Form Endpoint (actions/sendEmail.tsx)
– Email Template Renderer (email/contact-form-email.tsx)
4. Email Template Development App (react-email-starter)
5. External Email Service (SMTP provider, e.g., SendGrid, Nodemailer SMTP)
b. Relationships & Data Flow
• User → Next.js Frontend: loads pages, navigates, interacts with the contact form.
• Next.js Frontend → Server Action: form submission triggers sendEmail server action.
• Server Action → Email Template: populates contact-form-email component with form data.
• Server Action → External Email Service: dispatches the formatted email.
• Developer ↔ react-email-starter: preview/edit email templates in isolation.
c. Architectural Patterns & Design Principles
– App Router pattern in Next.js (colocated routes/components under app/).
– React Context for cross-cutting concerns (active section, theme).
– Server Actions for API logic without separate API routes.
– Component-driven UI (atomic to composite components).
– Monorepo-style subapp (react-email-starter) for email template dev.
d. Key Technologies & Frameworks
– Next.js (App Router, Server Actions)
– React & React Context
– Tailwind CSS + PostCSS
– TypeScript
– React-Email (email templates)
– Vercel (hosting/deployment)