SwiftAcademy Logo

Navigation

Building a Portfolio Website with Next.js: Step-by-Step Tutorial for Beginners

Published Mar 31 2026Updated Mar 22 2026
Building a Portfolio Website with Next.js: Step-by-Step Tutorial for Beginners

A portfolio website is the single most important asset in any developer's job search toolkit. It showcases your skills, displays your projects, and gives employers a direct window into your capabilities. Building that portfolio with Next.js gives you server-side rendering for SEO, fast performance, and a chance to demonstrate proficiency in one of the most in-demand frontend frameworks. This tutorial walks you through building a complete, production-ready portfolio from scratch using Next.js 14+, TypeScript, and Tailwind CSS, perfect for developers in Nepal looking to stand out in the competitive IT job market.

Why Should You Build Your Portfolio with Next.js Instead of Plain HTML?

Next.js provides server-side rendering for better SEO, automatic code splitting for faster load times, built-in image optimization, and file-based routing that simplifies development. A Next.js portfolio also demonstrates to employers that you can work with modern frameworks, which is far more impressive than a static HTML site.

Plain HTML portfolios work but send a limited signal to employers. They show you know the basics. A Next.js portfolio shows you understand component architecture, modern build tools, deployment pipelines, and production-grade web development. In Nepal's competitive IT market, where companies like Leapfrog, Cotiviti, and numerous startups use React and Next.js daily, this distinction matters.

Additional advantages of using Next.js:

  • SEO optimization: Your portfolio ranks better on Google because Next.js pre-renders pages on the server
  • Performance: Automatic code splitting means visitors only download the JavaScript needed for each page
  • Image handling: The next/image component automatically optimizes images for different screen sizes
  • Easy deployment: One-click deployment to Vercel with free hosting
  • Scalability: You can easily add a blog, project case studies, or contact form later

How Do You Set Up a Next.js Portfolio Project From Scratch?

Run npx create-next-app@latest with TypeScript and Tailwind CSS options to scaffold a production-ready project in under a minute. This gives you a configured development environment with the App Router, TypeScript support, ESLint, and Tailwind CSS ready to use immediately.

Open your terminal and run the following command:

# Create a new Next.js project
npx create-next-app@latest my-portfolio

# When prompted, select these options:
# ✔ Would you like to use TypeScript? Yes
# ✔ Would you like to use ESLint? Yes
# ✔ Would you like to use Tailwind CSS? Yes
# ✔ Would you like to use `src/` directory? Yes
# ✔ Would you like to use App Router? Yes
# ✔ Would you like to customize the default import alias? No

# Navigate into the project
cd my-portfolio

# Start the development server
npm run dev

Your project structure should look like this:

my-portfolio/
├── src/
│   ├── app/
│   │   ├── layout.tsx      # Root layout
│   │   ├── page.tsx         # Homepage
│   │   └── globals.css      # Global styles
│   └── components/          # We'll create this
├── public/                   # Static assets (images, resume)
├── tailwind.config.ts
├── next.config.js
├── tsconfig.json
└── package.json

Now set up the foundational configuration. Update your tailwind.config.ts to include custom colors and fonts that match your personal brand:

// tailwind.config.ts
import type { Config } from "tailwindcss";

const config: Config = {
  content: [
    "./src/pages/**/*.{js,ts,jsx,tsx,mdx}",
    "./src/components/**/*.{js,ts,jsx,tsx,mdx}",
    "./src/app/**/*.{js,ts,jsx,tsx,mdx}",
  ],
  theme: {
    extend: {
      colors: {
        primary: "#2563eb",    // Customize your brand color
        secondary: "#1e40af",
        accent: "#3b82f6",
        dark: "#0f172a",
        light: "#f8fafc",
      },
      fontFamily: {
        sans: ["Inter", "sans-serif"],
        mono: ["Fira Code", "monospace"],
      },
    },
  },
  plugins: [],
};

export default config;

How Do You Build the Hero Section and Navigation Components?

Create a responsive navigation bar with smooth scroll links and a hero section that immediately communicates who you are, what you do, and how to contact you. These two components form the critical first impression that determines whether a visitor stays or leaves.

First, create the navigation component:

// src/components/Navbar.tsx
"use client";

import { useState } from "react";
import Link from "next/link";

const navLinks = [
  { name: "About", href: "#about" },
  { name: "Skills", href: "#skills" },
  { name: "Projects", href: "#projects" },
  { name: "Contact", href: "#contact" },
];

export default function Navbar() {
  const [isOpen, setIsOpen] = useState(false);

  return (
    <nav className="fixed top-0 w-full bg-dark/90 backdrop-blur-sm z-50 border-b border-gray-800">
      <div className="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8">
        <div className="flex justify-between items-center h-16">
          {/* Logo / Name */}
          <Link href="/" className="text-xl font-bold text-white">
            {"<YourName />"}
          </Link>

          {/* Desktop Navigation */}
          <div className="hidden md:flex space-x-8">
            {navLinks.map((link) => (
              <a
                key={link.name}
                href={link.href}
                className="text-gray-300 hover:text-primary transition-colors duration-200"
              >
                {link.name}
              </a>
            ))}
            <a
              href="/resume.pdf"
              target="_blank"
              className="bg-primary text-white px-4 py-2 rounded-lg hover:bg-secondary transition-colors"
            >
              Resume
            </a>
          </div>

          {/* Mobile Menu Button */}
          <button => setIsOpen(!isOpen)}
            className="md:hidden text-gray-300 hover:text-white"
            aria-label="Toggle menu"
          >
            <svg className="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
              {isOpen ? (
                <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 18L18 6M6 6l12 12" />
              ) : (
                <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M4 6h16M4 12h16M4 18h16" />
              )}
            </svg>
          </button>
        </div>

        {/* Mobile Navigation */}
        {isOpen && (
          <div className="md:hidden pb-4">
            {navLinks.map((link) => (
              <a
                key={link.name}
                href={link.href} => setIsOpen(false)}
                className="block py-2 text-gray-300 hover:text-primary"
              >
                {link.name}
              </a>
            ))}
          </div>
        )}
      </div>
    </nav>
  );
}

Now create the hero section:

// src/components/Hero.tsx
import Image from "next/image";

export default function Hero() {
  return (
    <section className="min-h-screen flex items-center justify-center bg-dark pt-16">
      <div className="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8">
        <div className="grid md:grid-cols-2 gap-12 items-center">
          {/* Text Content */}
          <div className="space-y-6">
            <p className="text-primary font-mono text-sm">Hi, my name is</p>
            <h1 className="text-4xl sm:text-5xl lg:text-6xl font-bold text-white">
              Your Name
            </h1>
            <h2 className="text-2xl sm:text-3xl text-gray-400">
              I build things for the web.
            </h2>
            <p className="text-gray-400 max-w-lg text-lg">
              A frontend developer based in Pokhara, Nepal, specializing in
              building exceptional digital experiences with React and Next.js.
            </p>
            <div className="flex gap-4">
              <a
                href="#projects"
                className="bg-primary text-white px-6 py-3 rounded-lg hover:bg-secondary transition-colors text-lg"
              >
                View My Work
              </a>
              <a
                href="#contact"
                className="border border-primary text-primary px-6 py-3 rounded-lg hover:bg-primary/10 transition-colors text-lg"
              >
                Contact Me
              </a>
            </div>
          </div>

          {/* Profile Image */}
          <div className="flex justify-center">
            <div className="relative w-64 h-64 sm:w-80 sm:h-80">
              <Image
                src="/profile.jpg"
                alt="Your Name - Frontend Developer"
                fill
                className="rounded-full object-cover border-4 border-primary/30"
                priority
              />
            </div>
          </div>
        </div>
      </div>
    </section>
  );
}

These components use Tailwind CSS for responsive design that works across devices. The navigation collapses into a hamburger menu on mobile, and the hero section stacks vertically on smaller screens.

How Do You Create a Projects Showcase Section?

Build a dynamic project grid component that displays project cards with images, descriptions, technology tags, and links to live demos and GitHub repositories. Use TypeScript interfaces to type your project data for maintainability and scalability.

First, define the project data structure and content:

// src/data/projects.ts

export interface Project {
  id: number;
  title: string;
  description: string;
  image: string;
  technologies: string[];
  liveUrl: string;
  githubUrl: string;
  featured: boolean;
}

export const projects: Project[] = [
  {
    id: 1,
    title: "E-Commerce Platform",
    description:
      "A full-stack e-commerce application with product management, cart functionality, payment integration with Khalti, and admin dashboard.",
    image: "/projects/ecommerce.png",
    technologies: ["Next.js", "TypeScript", "Tailwind CSS", "Prisma", "PostgreSQL"],
    liveUrl: "https://myecommerce.vercel.app",
    githubUrl: "https://github.com/yourusername/ecommerce",
    featured: true,
  },
  {
    id: 2,
    title: "Task Management App",
    description:
      "A collaborative task management tool with real-time updates, drag-and-drop boards, and team workspace features.",
    image: "/projects/taskmanager.png",
    technologies: ["React", "Node.js", "Socket.io", "MongoDB"],
    liveUrl: "https://mytasks.vercel.app",
    githubUrl: "https://github.com/yourusername/task-manager",
    featured: true,
  },
  {
    id: 3,
    title: "Weather Dashboard",
    description:
      "A responsive weather application showing real-time data for cities across Nepal with 5-day forecasts and interactive maps.",
    image: "/projects/weather.png",
    technologies: ["Next.js", "TypeScript", "OpenWeather API", "Chart.js"],
    liveUrl: "https://nepaliweather.vercel.app",
    githubUrl: "https://github.com/yourusername/weather-app",
    featured: false,
  },
];

Now create the project card component:

// src/components/ProjectCard.tsx
import Image from "next/image";
import { Project } from "@/data/projects";

interface ProjectCardProps {
  project: Project;
}

export default function ProjectCard({ project }: ProjectCardProps) {
  return (
    <div className="bg-gray-900 rounded-xl overflow-hidden border border-gray-800 hover:border-primary/50 transition-all duration-300 group">
      {/* Project Image */}
      <div className="relative h-48 overflow-hidden">
        <Image
          src={project.image}
          alt={`Screenshot of ${project.title}`}
          fill
          className="object-cover group-hover:scale-105 transition-transform duration-300"
        />
      </div>

      {/* Project Content */}
      <div className="p-6 space-y-4">
        <h3 className="text-xl font-bold text-white">{project.title}</h3>
        <p className="text-gray-400 text-sm leading-relaxed">
          {project.description}
        </p>

        {/* Technology Tags */}
        <div className="flex flex-wrap gap-2">
          {project.technologies.map((tech) => (
            <span
              key={tech}
              className="text-xs bg-primary/10 text-primary px-3 py-1 rounded-full"
            >
              {tech}
            </span>
          ))}
        </div>

        {/* Links */}
        <div className="flex gap-4 pt-2">
          <a
            href={project.githubUrl}
            target="_blank"
            rel="noopener noreferrer"
            className="text-gray-400 hover:text-primary transition-colors text-sm flex items-center gap-1"
          >
            GitHub Code
          </a>
          <a
            href={project.liveUrl}
            target="_blank"
            rel="noopener noreferrer"
            className="text-gray-400 hover:text-primary transition-colors text-sm flex items-center gap-1"
          >
            Live Demo
          </a>
        </div>
      </div>
    </div>
  );
}

Create the projects section that uses the card component:

// src/components/Projects.tsx
import { projects } from "@/data/projects";
import ProjectCard from "./ProjectCard";

export default function Projects() {
  const featuredProjects = projects.filter((p) => p.featured);
  const otherProjects = projects.filter((p) => !p.featured);

  return (
    <section id="projects" className="py-20 bg-dark">
      <div className="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8">
        <h2 className="text-3xl font-bold text-white mb-2">
          Things I Have Built
        </h2>
        <p className="text-gray-400 mb-12">
          A selection of projects that showcase my skills and experience.
        </p>

        {/* Featured Projects Grid */}
        <div className="grid md:grid-cols-2 gap-8 mb-12">
          {featuredProjects.map((project) => (
            <ProjectCard key={project.id} project={project} />
          ))}
        </div>

        {/* Other Projects */}
        {otherProjects.length > 0 && (
          <>
            <h3 className="text-xl font-bold text-white mb-6">
              Other Projects
            </h3>
            <div className="grid sm:grid-cols-2 lg:grid-cols-3 gap-6">
              {otherProjects.map((project) => (
                <ProjectCard key={project.id} project={project} />
              ))}
            </div>
          </>
        )}
      </div>
    </section>
  );
}

How Do You Add Skills and Contact Sections?

Build a skills section displaying your technical competencies organized by category, and a contact section with a functional form or direct links. Both sections should be visually clean and provide the information employers need to evaluate and reach you.

Skills section component:

// src/components/Skills.tsx

interface SkillCategory {
  name: string;
  skills: string[];
}

const skillCategories: SkillCategory[] = [
  {
    name: "Frontend",
    skills: ["React", "Next.js", "TypeScript", "Tailwind CSS", "HTML5/CSS3"],
  },
  {
    name: "Backend",
    skills: ["Node.js", "Express", "Django", "REST APIs", "GraphQL"],
  },
  {
    name: "Database",
    skills: ["PostgreSQL", "MongoDB", "Prisma", "Redis"],
  },
  {
    name: "Tools & DevOps",
    skills: ["Git", "Docker", "Vercel", "AWS", "GitHub Actions"],
  },
];

export default function Skills() {
  return (
    <section id="skills" className="py-20 bg-gray-950">
      <div className="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8">
        <h2 className="text-3xl font-bold text-white mb-12">
          Skills & Technologies
        </h2>

        <div className="grid sm:grid-cols-2 lg:grid-cols-4 gap-8">
          {skillCategories.map((category) => (
            <div key={category.name} className="space-y-4">
              <h3 className="text-lg font-semibold text-primary">
                {category.name}
              </h3>
              <ul className="space-y-2">
                {category.skills.map((skill) => (
                  <li
                    key={skill}
                    className="text-gray-400 flex items-center gap-2"
                  >
                    <span className="w-1.5 h-1.5 bg-primary rounded-full" />
                    {skill}
                  </li>
                ))}
              </ul>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

Contact section component:

// src/components/Contact.tsx

export default function Contact() {
  return (
    <section id="contact" className="py-20 bg-dark">
      <div className="max-w-3xl mx-auto px-4 sm:px-6 lg:px-8 text-center">
        <h2 className="text-3xl font-bold text-white mb-4">Get In Touch</h2>
        <p className="text-gray-400 text-lg mb-8">
          I am currently looking for new opportunities. Whether you have a
          question, a project idea, or just want to say hello, my inbox is
          always open.
        </p>

        <div className="flex flex-col sm:flex-row justify-center gap-4 mb-12">
          <a
            href="mailto:your.email@example.com"
            className="bg-primary text-white px-8 py-3 rounded-lg hover:bg-secondary transition-colors text-lg"
          >
            Send Email
          </a>
          <a
            href="https://linkedin.com/in/yourprofile"
            target="_blank"
            rel="noopener noreferrer"
            className="border border-primary text-primary px-8 py-3 rounded-lg hover:bg-primary/10 transition-colors text-lg"
          >
            LinkedIn
          </a>
          <a
            href="https://github.com/yourusername"
            target="_blank"
            rel="noopener noreferrer"
            className="border border-gray-600 text-gray-300 px-8 py-3 rounded-lg hover:border-primary hover:text-primary transition-colors text-lg"
          >
            GitHub
          </a>
        </div>

        {/* Footer */}
        <p className="text-gray-600 text-sm">
          Designed & Built by Your Name | Pokhara, Nepal
        </p>
      </div>
    </section>
  );
}

How Do You Optimize Your Portfolio for SEO and Performance?

Use Next.js's built-in Metadata API to set page titles, descriptions, and Open Graph tags that help your portfolio rank on Google and display properly when shared on social media. Combine this with image optimization and proper semantic HTML for maximum SEO impact.

Configure metadata in your root layout and page:

// src/app/layout.tsx
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";
import Navbar from "@/components/Navbar";

const inter = Inter({ subsets: ["latin"] });

export const metadata: Metadata = {
  title: {
    default: "Your Name | Frontend Developer in Pokhara, Nepal",
    template: "%s | Your Name",
  },
  description:
    "Frontend developer specializing in React and Next.js. Based in Pokhara, Nepal. View my projects and get in touch.",
  keywords: [
    "frontend developer",
    "React developer Nepal",
    "Next.js developer Pokhara",
    "web developer Nepal",
  ],
  authors: [{ name: "Your Name" }],
  openGraph: {
    type: "website",
    locale: "en_US",
    url: "https://yourname.com.np",
    siteName: "Your Name - Portfolio",
    title: "Your Name | Frontend Developer",
    description: "Frontend developer specializing in React and Next.js.",
    images: [
      {
        url: "/og-image.png",
        width: 1200,
        height: 630,
        alt: "Your Name - Frontend Developer Portfolio",
      },
    ],
  },
  twitter: {
    card: "summary_large_image",
    title: "Your Name | Frontend Developer",
    description: "Frontend developer specializing in React and Next.js.",
    images: ["/og-image.png"],
  },
  robots: {
    index: true,
    follow: true,
  },
};

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en" className="scroll-smooth">
      <body className={`${inter.className} bg-dark text-white`}>
        <Navbar />
        {children}
      </body>
    </html>
  );
}

Assemble everything in your main page:

// src/app/page.tsx
import Hero from "@/components/Hero";
import Skills from "@/components/Skills";
import Projects from "@/components/Projects";
import Contact from "@/components/Contact";

export default function Home() {
  return (
    <main>
      <Hero />
      <Skills />
      <Projects />
      <Contact />
    </main>
  );
}

Performance optimization checklist:

Optimization Implementation Impact
Image optimization Use next/image with proper width/height 40-60% smaller images
Font optimization Use next/font for self-hosted fonts Eliminates layout shift
Code splitting Automatic with Next.js App Router Faster page loads
Lazy loading Images below fold loaded on scroll Faster initial paint
Metadata API Structured SEO data Better search rankings
Semantic HTML Proper heading hierarchy, landmarks Accessibility and SEO

How Do You Deploy Your Portfolio to Production?

Deploy your Next.js portfolio to Vercel with a single command or by connecting your GitHub repository for automatic deployments on every push. Vercel, built by the creators of Next.js, offers free hosting with a custom domain, SSL, and global CDN.

# Option 1: Deploy via CLI
npm install -g vercel
vercel

# Option 2: Connect GitHub repository
# 1. Push your code to GitHub
git init
git add .
git commit -m "Initial portfolio commit"
git remote add origin https://github.com/yourusername/portfolio.git
git push -u origin main

# 2. Visit vercel.com, import your GitHub repo
# 3. Vercel automatically detects Next.js and configures the build

After deployment, connect your custom domain. For developers in Nepal, you can register a .com.np domain through Mercantile Communications or other local registrars. In Vercel's dashboard, add your domain and update your DNS records.

For a professional touch, also set up:

  • Analytics: Vercel Analytics or Google Analytics to track visitors
  • Web Vitals monitoring: Check your Core Web Vitals scores
  • Sitemap: Add next-sitemap package for automatic sitemap generation
  • robots.txt: Ensure search engines can crawl your site

What the Reddit Community Says

Portfolio websites are one of the most discussed topics in developer communities. Here are insights from real conversations:

A highly upvoted response in r/webdev to "How do I build a developer portfolio that stands out?" stated: "The portfolio itself matters less than the projects in it. I've hired developers with simple one-page portfolios because their projects were genuinely impressive. Don't spend three months perfecting your portfolio design when you could be building projects to put in it." This is excellent practical advice.

In r/nextjs, a developer shared their experience: "Building my portfolio in Next.js was the best learning project I did. It forced me to learn the App Router, image optimization, metadata API, and deployment. When interviewers asked about my Next.js experience, I could talk about real decisions I made on my own project." This validates the dual benefit of a Next.js portfolio.

A thread in r/cscareerquestions noted: "For junior developers, I want to see 2-3 solid projects with clean code and good READMEs. A portfolio site is a nice bonus but not a substitute for actual project work. The best portfolios I've seen are simple but link to impressive GitHub repos." This reinforces the importance of substance over style.

Practical Takeaway

Build your portfolio iteratively, not all at once. Start with the components covered in this tutorial: navigation, hero, skills, projects, and contact. Deploy it immediately, even if it feels incomplete. A live portfolio that you improve over time is infinitely better than a perfect portfolio that stays on your local machine.

Focus your energy on the projects you showcase rather than the portfolio design itself. Two to three well-built projects with clear descriptions, technology tags, live demos, and GitHub links are more impactful than a flashy design with shallow content.

For developers in Nepal, include projects that demonstrate understanding of local context. An e-commerce app with Khalti payment integration, a Nepali-language interface, or a tool that solves a local problem will stand out to Nepali employers.

Update your portfolio regularly. Add new projects, refine descriptions, and keep your skills section current. Treat it as a living document of your professional growth.

Frequently Asked Questions

How many projects should I include in my portfolio?

Include three to five of your best projects. Quality matters far more than quantity. Each project should demonstrate different skills and have a clear description of the problem it solves, the technologies used, and your specific contributions. Having too many mediocre projects dilutes your portfolio's impact.

Should I use a template or build my portfolio from scratch?

Building from scratch, as this tutorial guides, is strongly recommended for developers because the portfolio itself becomes a portfolio piece. It demonstrates your coding ability and design sensibility. Templates are acceptable if you are not a frontend developer (for example, if you specialize in backend or data science), but customize them significantly.

How do I make my portfolio load faster?

Use Next.js's built-in Image component for automatic optimization, implement lazy loading for below-the-fold content, minimize third-party scripts, use system fonts or next/font for custom fonts, and keep your total page weight under 1MB. Test with Google PageSpeed Insights and aim for scores above 90.

Is it worth buying a custom domain for my portfolio?

Yes. A custom domain like yourname.com.np or yourname.dev looks significantly more professional than yourname.vercel.app. In Nepal, .com.np domains are affordable and add a local identity that can resonate with Nepali employers. The annual cost is minimal compared to the professional impression it creates.

Can I add a blog to my Next.js portfolio?

Absolutely. Next.js makes adding a blog straightforward using markdown files with a library like next-mdx-remote or contentlayer. A blog where you write about technologies you are learning demonstrates continuous growth and helps with SEO, bringing more traffic to your portfolio.

Build Your Portfolio with Expert Guidance

Want to build a portfolio that gets you hired? Swift Academy's Next.js Frontend Development course in Pokhara includes a portfolio project as part of the curriculum. You will build and deploy a production-ready portfolio with code reviews from experienced instructors, ensuring your portfolio follows best practices and makes the right impression. At NPR 16,000, it is a direct investment in your career. Enroll today.

Related Articles

Suggested Images

  1. Alt text: "Complete Next.js portfolio website screenshot showing hero section with developer photo navigation and dark theme design"
  2. Alt text: "Code editor showing Next.js project card component with TypeScript interface and Tailwind CSS styling"
  3. Alt text: "Side-by-side comparison of portfolio website on desktop and mobile screens demonstrating responsive design"

Related Posts

Building a Portfolio Website with Next.js: Step-by-Step Tutorial for Beginners - Swift Academy