A modern Next.js portfolio and blog website with GitHub API integration and MDX-powered content.
- Portfolio Homepage with hero banner and projects showcase
- Blog System powered by MDX with markdown support
- GitHub Projects automatically fetched from GitHub API
- Responsive Design with Tailwind CSS and dark mode support
- SEO Optimised with automatic sitemap generation
- Node.js 16.x or higher
- npm or yarn
- Clone the repository:
git clone <your-repo-url>
cd website- Install dependencies:
npm install- Create your environment file:
cp .env.local.example .env.local- Configure your environment variables in
.env.local:
# Optional: Google Analytics
NEXT_PUBLIC_GOOGLE_ANALYTICS=G-XXXXXXXXXX
# Required: GitHub Integration
GITHUB_USERNAME=your-github-username
GITHUB_AUTH_TOKEN=ghp_xxxxxxxxxxxx # Optional, prevents rate limitingRun the development server:
npm run devOpen http://localhost:3000 to see your site.
npm run build
npm startThe build process automatically generates a sitemap at /sitemap.xml.
- Create a new
.mdxfile incontent/blog/:
---
title: 'Your Post Title'
date: '2024-01-15'
excerpt: 'A brief description of your post'
---
# Your Content Here
Write your blog post content using Markdown or MDX.- Rebuild the site to generate static pages:
npm run build- Homepage Hero: Edit
components/Hero.js - About Page: Edit
pages/about.js - Footer: Edit the footer section in
components/Layout.js - Navigation: Edit the nav section in
components/Layout.js
Projects are automatically fetched from your GitHub account using the GITHUB_USERNAME environment variable. The site displays your 6 most recent repositories with:
- Repository name and description
- Programming language
- Star and fork counts
- Direct link to the repository
To customise which repos are shown, edit pages/api/github/repos.js.
website/
├── components/ # React components
│ ├── Layout.js # Main layout with nav and footer
│ ├── Hero.js # Homepage hero section
│ ├── ProjectsSection.js # GitHub projects display
│ └── ErrorBoundary.js # Error boundary component
├── pages/ # Next.js pages
│ ├── index.js # Homepage
│ ├── about.js # About page
│ ├── blog/
│ │ ├── index.js # Blog listing page
│ │ └── [slug].js # Dynamic blog post pages
│ └── api/
│ └── github/
│ └── repos.js # GitHub API route
├── content/
│ └── blog/ # Blog posts (MDX files)
├── lib/
│ ├── blog.js # Blog utility functions
│ └── githubapi/ # GitHub API integration
├── styles/ # CSS and Tailwind styles
└── public/ # Static assets
- Framework: Next.js 14
- Styling: Tailwind CSS with dark mode
- Content: MDX (Markdown + JSX)
- API: GitHub REST API
- Deployment Ready: Vercel, Netlify, or any Node.js host
npm run dev- Start development servernpm run build- Build for productionnpm start- Start production servernpm run postbuild- Generate sitemap (runs automatically after build)
npm audit currently reports high severity issues in cross-spawn via @swc/cli. This is a dev-only dependency chain and does not affect the production runtime bundle. Resolving it requires a breaking upgrade of @swc/cli. We are deferring that change for now and will revisit during the next dependency refresh.
- Contact Details: Edit the footer in
components/Layout.js - About Page: Update
pages/about.jswith your bio, skills, and experience - Hero Message: Customise the welcome message in
components/Hero.js - Site Title: Update the
Layouttitle prop in each page
The site uses Tailwind CSS. Customise the theme in tailwind.config.js:
- Colors (including the
autumn-orangeaccent color) - Typography
- Breakpoints
- Dark mode settings
- Push your code to GitHub
- Import your repository in Vercel
- Configure environment variables
- Deploy!
The site can be deployed to any platform that supports Next.js:
- Netlify
- AWS Amplify
- DigitalOcean App Platform
- Your own Node.js server
| Variable | Required | Description |
|---|---|---|
NEXT_PUBLIC_GOOGLE_ANALYTICS |
No | Google Analytics tracking ID |
GITHUB_USERNAME |
Yes | Your GitHub username for projects |
GITHUB_AUTH_TOKEN |
No | GitHub personal access token (prevents rate limiting) |
MIT License - Feel free to use this project for your own portfolio!
For issues or questions, please open an issue on GitHub.