Test commit.
A modern personal blog built with Next.js and FastAPI, featuring markdown-based content, tag filtering, and responsive design.
- π Markdown Blog Posts - Write posts in markdown with frontmatter
- π·οΈ Tag System - Organize and filter posts by tags
- πΌοΈ Image Support - Optimized image handling and serving
- π± Responsive Design - Mobile-first, works on all devices
- β‘ Fast Performance - Static generation with incremental updates
- π SEO Optimized - Built-in metadata and Open Graph support
- π¨ Modern UI - Clean design with CSS Modules
- π Easy Deployment - Optimized for Vercel
βββββββββββββββββββββββββββββββββββββββββββ
β Vercel β
βββββββββββββββββββββββββββββββββββββββββββ€
β Next.js Frontend ββββΊ FastAPI Backendβ
β (React + TypeScript) (Python) β
βββββββββββββββββββββββββββββββββββββββββββ
- Frontend: Next.js 14+ with App Router and TypeScript
- Backend: FastAPI serving blog content via REST API
- Deployment: Vercel with automatic HTTPS and global CDN
- Node.js 18+
- Python 3.11+
- npm or yarn
./start-dev.shThis starts both the frontend and backend servers. Visit:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/docs
Backend:
cd backend
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn main:app --reloadFrontend:
cd frontend
npm install
npm run devwillcapio-old/
βββ frontend/ # Next.js application
β βββ app/ # App Router pages
β βββ components/ # React components
β βββ lib/ # Utilities (API, theme)
β βββ public/ # Static assets
β
βββ backend/ # FastAPI application
β βββ main.py # API server
β βββ content/ # Markdown blog posts
β βββ requirements.txt
β
βββ vercel.json # Deployment configuration
- Next.js 14+ (App Router)
- TypeScript
- CSS Modules
- React 18
- FastAPI
- Python Markdown
- Frontmatter parsing
- Uvicorn (ASGI server)
- Vercel
- Automatic HTTPS
- Global CDN
-
Create a new directory in
backend/content/posts/:mkdir backend/content/posts/2024-12-19
-
Create
index.mdwith frontmatter:--- title: "My New Post" date: "2024-12-19" tags: ["tech", "blog"] cover: "./cover-image.jpg" --- Your post content here...
-
Add images to the same directory
-
Restart the backend to see changes
# Install Vercel CLI
npm i -g vercel
# Login
vercel login
# Deploy to production
vercel --prodSet NEXT_PUBLIC_API_URL in Vercel:
- Development:
http://localhost:8000 - Production:
https://your-domain.vercel.app
- Quick Start Guide - Get up and running fast
- Deployment Guide - Deploy to Vercel
- Project Overview - Full technical overview
- Migration Summary - What was changed
- Migration Complete - Completion checklist
# Test the API
./test-api.sh
# Test frontend build
cd frontend && npm run build| Endpoint | Description |
|---|---|
GET /api/posts |
List all blog posts |
GET /api/posts/{slug} |
Get single post |
GET /api/tags |
Get all tags |
GET /api/posts/tag/{tag} |
Filter by tag |
GET /api/site-config |
Site configuration |
GET /docs |
API documentation |
Edit frontend/lib/theme.ts to change colors, fonts, and styles.
React components are in frontend/components/ with CSS Modules for styling.
All API logic is in backend/main.py. Easy to extend with new endpoints.
- β CORS properly configured
- β Environment variables for configuration
- β No sensitive data in code
- β HTTPS on Vercel
- β‘ Static Site Generation (SSG)
- π Incremental Static Regeneration (ISR)
- πΌοΈ Optimized image loading
- π Global CDN distribution
- π± Mobile-first responsive design
This is a personal blog, but feel free to fork and adapt for your own use!
MIT
Will Cap
- Website: WillCap.io
- Twitter: @thinkocapo
- GitHub: @thinkocapo
- LinkedIn: williamcapozzoli
- Originally built with Gatsby
- Migrated to Next.js + FastAPI architecture
- Deployed on Vercel
Status: β
Migration Complete
From: Gatsby v2
To: Next.js 14+ & FastAPI
Ready to deploy! π