All academies
All projects

Developer Portfolio

easy

Build a personal portfolio site with a projects gallery, skills grid, and contact form, all driven by typed content data. You will practice using const assertions and satisfies to keep content data both strictly checked and precisely inferred, plus typing reusable layout components with generics.

Next.jsTypeScriptTailwind CSSFramer Motion

Architecture

  • UI layer: section components (Hero, ProjectsGallery, SkillsGrid, ContactForm) composed on a single page
  • Content layer: typed data modules for projects, skills, and social links checked with the satisfies operator
  • Domain layer: small helpers for sorting and filtering projects by tag, written as generic functions
  • API layer: a route handler that validates the contact form payload server-side before sending mail
  • Type layer: shared content types so the data files and the components that render them can never drift apart

Folder structure

src/
  app/
    page.tsx
    layout.tsx
    api/
      contact/
        route.ts
  components/
    Hero.tsx
    ProjectsGallery.tsx
    ProjectCard.tsx
    SkillsGrid.tsx
    ContactForm.tsx
  content/
    projects.ts
    skills.ts
    socials.ts
  types/
    content.ts

Domain type definitions

Start every project by defining its types — they become the contract for every component, service, and API call that follows.

export type SkillLevel = "learning" | "comfortable" | "expert";

export interface Skill {
  name: string;
  level: SkillLevel;
  icon: string;
}

export interface PortfolioProject {
  slug: string;
  name: string;
  tagline: string;
  tags: string[];
  repoUrl: string;
  liveUrl?: string;
  featured: boolean;
}

export interface SocialLink {
  label: string;
  href: string;
}

export interface ContactPayload {
  name: string;
  email: string;
  message: string;
}

Build steps

  1. 1Define the content types — Skill, PortfolioProject, SocialLink, and ContactPayload.
  2. 2Author the content modules using the satisfies operator so typos in fields fail to compile without widening the data.
  3. 3Build the Hero section with typed props for name, headline, and social links.
  4. 4Build ProjectCard and ProjectsGallery, adding a generic sortBy helper that accepts any key of PortfolioProject.
  5. 5Build SkillsGrid, grouping skills by SkillLevel into a Record and rendering one column per level.
  6. 6Build ContactForm with typed controlled inputs and client-side validation of ContactPayload.
  7. 7Implement the contact API route, re-validating the payload server-side and returning typed success or error JSON.
  8. 8Add Framer Motion entrance animations and verify everything still compiles under strict mode.