How I Used Claude + OpenClaw to Migrate and Rebuild a Full-Stack Website in One Day
Author: Yao Song · NexAgent AI Solutions Tools: Claude Code (Opus 4.6) + OpenClaw Agent
Today I completed what would traditionally take one to two weeks: merging two independent server projects into a unified full-stack platform with a complete AI-driven operations system.
Background
I had two independently running projects:
- NexAgent — AI automation agency website (Next.js + Tailwind + PM2)
- OpenClaw Club — AI Agent hands-on course platform (Next.js + Flask + PostgreSQL + Docker)
They ran on different servers with different tech stacks and designs. Goal: merge into one unified platform.
Step 1: Data Migration (~10 min)
Claude Code operated both servers via SSH, automatically handling:
- Project file packaging and transfer
- PostgreSQL database export/import (including pgvector data)
- AI Agent workspace (12 skills, memory data) migration
- Docker Compose adaptation for new environment
Step 2: Backend Deployment (~15 min)
Docker Compose deployment of the full backend stack:
- PostgreSQL 17 + pgvector — course data + vector search
- Flask API — course management, blog CRUD, user auth
- Redis — caching
- MinIO — file storage
- Discord Bot — community moderation
- Memory Service — AI memory system (FastAPI + bge-m3 embeddings)
Step 3: Frontend Code-Level Merge (~30 min)
The most challenging part — merging two Next.js apps into one.
Route Design
Final route structure for nextagent.ca:
/zh,/en— Main site (bilingual)/zh/openclaw,/en/openclaw— Course platform/zh/blog,/en/blog— AI News Hub/api/openclaw/*— Flask backend proxy
Key Technical Decisions
- Next.js Route Groups with
[locale]for site-wide i18n - Middleware routing for automatic language detection
- API Proxy catch-all route forwarding to Flask
- Style unification — deleted 2800+ lines of CSS, switched to Tailwind + shadcn/ui
- OpenClaw Sidebar — fixed desktop sidebar + mobile bottom tabs
Step 4: AI Agent Migration
Full migration of OpenClaw Agent (codename: Ling Xiao):
- 13 Skills — course management, blog, site ops, memory, reminders, full-stack dev
- Memory data — structured facts + vector memories + reminders
- Bot API driven — no admin panel needed, Agent manages all content via API
Step 5: Automated Blog System
Built a daily auto-running AI news hub:
Sources: TechCrunch, The Verge, GitHub Trending, HuggingFace, Chinese AI outlets
Workflow:
- Daily 6AM cron trigger
- Fetch latest AI news from all sources
- AI generates bilingual summaries + categorization + tags
- Vector embeddings stored in pgvector for semantic search
- Articles saved as drafts for review
6 Categories: Models | Tools | Automation | Industry | OpenClaw | Insights
Step 6: System Optimization
8GB RAM server — every megabyte counts:
- Eliminated duplicate processes (~1GB saved)
- Reduced Gunicorn workers (~110MB saved)
- Docker container memory limits
- systemd service management
- Nginx direct Flask proxy (bypass Next.js layer)
Final: 2.5GB / 7.4GB used, all services healthy.
Key Takeaways
Claude Code Advantages
- Direct SSH operations — no local clone needed
- Self-healing errors — TypeScript errors auto-detected and fixed
- Cross-server coordination — simultaneous multi-server operations
- Full-stack coverage — frontend to backend to database to DevOps
OpenClaw Agent Value
- Skill-based architecture — each capability is standalone, composable, extensible
- Persistent memory — vector search + structured facts across sessions
- Bot API driven — AI is the CMS, no traditional admin panel needed
- Automated workflows — cron + AI + auto-categorization = hands-free operations
One Day's Work
- 2 servers merged
- 3 systems integrated (main site + courses + blog)
- Unified Tailwind + shadcn/ui design
- Bilingual support (EN/ZH)
- AI memory system deployed
- Automated news fetching
- 13 Agent Skills configured
- System performance optimized
Interested in AI Agent development? Join our free open classes (every Friday in April, 8PM ET / 5PM PT) or visit nextagent.ca/openclaw.
Written by Yao Song, assisted by Claude Code + OpenClaw Agent.