This project has been migrated from Gatsby to Next.js + FastAPI architecture.
willcapio-old/
├── frontend/ # Next.js 14+ application
│ ├── app/ # App Router pages
│ ├── components/ # React components
│ ├── lib/ # Utilities (API client, theme)
│ └── public/ # Static assets
├── backend/ # FastAPI application
│ ├── content/ # Markdown blog posts
│ ├── main.py # FastAPI server
│ └── requirements.txt
└── vercel.json # Vercel deployment config
cd backend
# Create virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run development server
uvicorn main:app --reload --port 8000The API will be available at http://localhost:8000
API Documentation: http://localhost:8000/docs
cd frontend
# Install dependencies
npm install
# Run development server
npm run devThe frontend will be available at http://localhost:3000
GET /api/posts- Get all blog postsGET /api/posts/{slug}- Get a single post by slugGET /api/tags- Get all tagsGET /api/posts/tag/{tag}- Get posts by tagGET /api/site-config- Get site configuration
- Install Vercel CLI:
npm i -g vercel - Login to Vercel:
vercel login
# From project root
vercel
# For production
vercel --prodSet the following environment variable in Vercel:
NEXT_PUBLIC_API_URL- Your production API URL (e.g.,https://your-domain.vercel.app)
- Static Site Generation (SSG): Blog posts are pre-rendered at build time
- Incremental Static Regeneration (ISR): Content revalidates every hour
- Image Optimization: Next.js Image component for optimized images
- SEO-Friendly: Built-in metadata and SEO support
- Fast API: Python-based API with markdown processing
- Responsive Design: Mobile-first responsive design
- Next.js 14+ (App Router)
- TypeScript
- CSS Modules
- React 18
- FastAPI
- Python 3.x
- Python Markdown
- Frontmatter
- Vercel
This migration from Gatsby included:
- ✅ Replaced Gatsby's GraphQL with REST API
- ✅ Migrated Emotion CSS-in-JS to CSS Modules
- ✅ Converted React components to Next.js components
- ✅ Set up FastAPI backend for content serving
- ✅ Migrated all markdown content
- ✅ Copied static assets
- ✅ Configured Vercel deployment
Blog posts are stored in backend/content/posts/ as markdown files with frontmatter:
---
title: "Post Title"
date: "2024-12-19"
tags: ["tag1", "tag2"]
cover: "cover-image.jpg"
---
Post content here...To add a new post, create a new directory in backend/content/posts/ with an index.md file and any images.
MIT