A comprehensive campaign management tool for tabletop RPGs, built with Next.js and FastAPI. Organize your campaigns, characters, locations, lore, and their interconnected relationships through an intuitive markdown editor, built on top of a graph database for the best AI assistance. Check out the hosted version here to see it in action before hosting yourself: Weave
- Multi-campaign support - Create and manage multiple RPG campaigns
- Campaign isolation - Each campaign has its own secure data space
- Real-time switching - Switch between campaigns instantly
- Rich text editor - Powered by TipTap with markdown support
- Flexible content types - Notes, Characters, Locations, Sessions, and Lore
- Graph relationships - Connect any content with meaningful relationships
- Full-text search - Find content quickly across your entire campaign
- Smart content generation - AI-powered NPCs, locations, and items
- Contextual assistance - AI understands your campaign's context
- Embedding search - Semantic search across all content
- Command palette - Quick access with Cmd+K
- Offline-first - Works without internet, syncs when connected
- Visual relationships - See connections between content
- Type safety - Built with TypeScript throughout
- Next.js 15 - React framework with App Router
- React 19 - Latest React with concurrent features
- TypeScript - Full type safety
- Tailwind CSS - Utility-first styling
- IndexedDB/Dexie - Local-first data storage
- FastAPI - High-performance Python API
- Neo4j - Graph database for relationships
- Redis - Task queue and caching
- Clerk - Authentication and user management
- LangChain - AI integration framework
- Docker and Docker Compose
- Node.js 18+ (for local development)
- Python 3.13+ (for local backend development)
- Clone the repository
git clone https://github.com/KirklandGee/weave
cd weave- Set up environment variables
cp .env.example .envConfigure the following variables in .env:
# Authentication (required)
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_your_key_here
CLERK_SECRET_KEY=sk_test_your_secret_here
# AI Services (optional but recommended)
OPENAI_API_KEY=sk-your_openai_key_here
GOOGLE_API_KEY=your_google_api_key_here
# Observability (optional)
LANGFUSE_PUBLIC_KEY=pk-lf-your_key_here
LANGFUSE_SECRET_KEY=sk-lf-your_secret_here
LANGFUSE_HOST=https://cloud.langfuse.com# Build and start all services
npm run docker:prod
# Or manually with docker-compose
docker-compose -f docker-compose.prod.yml up --build# Start with hot reload
npm run docker:dev
# Or manually
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --build- Main App: http://localhost:3001
- Marketing Site: http://localhost:3000
- Backend API: http://localhost:8000
- Neo4j Browser: http://localhost:7474 (neo4j/secretgraph - dev only)
cd backend
pip install uv # Modern Python package manager
uv sync # Install dependencies
uv run python -m fastapi dev api/index.py --port 8000# Install dependencies
npm install
# Start development servers
npm run dev # Both app and marketing
# Or individually:
npm run dev:app # Main app on :3001
npm run dev:marketing # Marketing on :3000# Seed the Neo4j database with initial schema
npm run docker:seed
# Or manually
docker-compose run --rm seeder# View logs
npm run docker:logs
# Reset everything
npm run docker:down:volumes
# Backend services only
npm run docker:backend| Service | Description | Port | Dependencies |
|---|---|---|---|
app |
Main Next.js application | 3001 | backend |
marketing |
Marketing website | 3000 | - |
backend |
FastAPI Python backend | 8000 | neo4j, redis |
rq-worker |
Background task processor | - | backend, redis |
neo4j |
Graph database | 7474, 7687 | - |
redis |
Task queue & caching | 6379 | - |
- Create a Clerk account at clerk.com
- Create a new application
- Copy your keys to the environment variables
- Configure allowed origins in Clerk dashboard:
http://localhost:3000(marketing)http://localhost:3001(app)- Your production domain
- Get API key from platform.openai.com
- Add to
OPENAI_API_KEYin.env
- Get API key from Google AI Studio
- Add to
GOOGLE_API_KEYin.env
- Sign up/login with Clerk authentication a. If you want to make use of the AI features, you'll need to either remove the checks for or upgrade your account in Clerk to a higher tier.
- Click "New Campaign" in the sidebar
- Give it a name and description
- Start creating content!
- Character Generation: Create detailed NPCs
- Location Building: Generate immersive locations
- Session Planning: AI-assisted session prep
- Content Summarization: Auto-generate summaries
ai-rpg-manager/
βββ apps/
β βββ app/ # Main Next.js application
β βββ marketing/ # Marketing website
βββ backend/ # FastAPI Python backend
β βββ api/ # API routes
β βββ services/ # Business logic
β βββ models/ # Data models
βββ docker-compose.* # Docker configurations
βββ package.json # Workspace configuration
# Development
npm run dev # Start all development servers
npm run dev:app # App only
npm run dev:marketing # Marketing only
# Building
npm run build # Build all workspaces
npm run build:app # App only
npm run build:marketing # Marketing only
# Docker
npm run docker:dev # Development with Docker
npm run docker:prod # Production deployment
npm run docker:seed # Seed database
# Code Quality
npm run lint # Lint all code
npm run format # Format all code
npm run format:check # Check formatting- LLM call tracking - Monitor AI usage
- Performance metrics - Response times and costs
- Error tracking - Debug AI issues
- Usage analytics - Understand user patterns
- Backend: http://localhost:8000/health
- Database: Neo4j browser at http://localhost:7474
# Set secure passwords
NEO4J_PASSWORD=your_secure_password_here
# Production URLs
BACKEND_URL=https://api.yourdomain.com
NEXT_PUBLIC_APP_URL=https://app.yourdomain.com
# Enable production optimizations
NODE_ENV=production
ENVIRONMENT=production- Backend: Increase workers in Dockerfile CMD
- Database: Use Neo4j Enterprise for clustering
- Redis: Use Redis Cluster for high availability
- Frontend: Deploy to CDN (Vercel, Netlify, etc.)
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow TypeScript strict mode
- Use conventional commits
- Update documentation
This project is licensed under the MIT License - see the LICENSE file for details.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Looking for a hassle-free experience? We offer a fully managed hosted version at use-weave.app with:
- β Automatic updates and maintenance
- β Scalable infrastructure
- β Premium AI features
- β Priority support
- β Collaborative campaigns
Built with β€οΈ for the tabletop RPG community
