This template serves two primary purposes:
- Learning Resource: Understand how to architect and implement AI-powered features in modern web applications with proper observability and security
- Project Starter: Use as a foundation for building your own AI-enhanced applications with a proven tech stack
- Framework: React 19.1 with React Router 7
- Language: TypeScript 5.9
- Build Tool: Vite 7
- Styling: Tailwind CSS 4 with Radix UI components
- UI Libraries: Tabler Icons, Lucide React, Recharts
- State Management: React Context for user state
- HTTP Client: Supabase JS SDK 2.75
- Language: Python 3.13
- Framework: Flask with async support
- AI Orchestration: CrewAI 0.201
- LLM Integration: LiteLLM (supports multiple providers)
- Database Client: Supabase Python SDK 2.22
- Package Manager: UV (fast Python package installer)
- Database: PostgreSQL 16.4 (via Supabase)
- Authentication: Supabase Auth
- Containerization: Docker & Docker Compose
- AI Observability: Arize Phoenix 12.4.0
- Tracing: OpenTelemetry with OTLP exporters
- Instrumentation: OpenInference for CrewAI and LiteLLM
Before you begin, ensure you have the following installed:
- Docker: 20.10+ and Docker Compose 2.0+
- Node.js: 20+ (for local development without Docker)
- Python: 3.13+ (for local development without Docker)
- Supabase CLI: Latest version
brew install supabase/tap/supabase # macOS # or visit https://supabase.com/docs/guides/cli
- UV: Fast Python package installer
curl -LsSf https://astral.sh/uv/install.sh | sh - Git: For version control
- Your favorite code editor: VS Code, Cursor, etc.
- LLM Provider API Key: Currently configured for Groq (free tier available), but supports any LiteLLM-compatible provider (OpenAI, Anthropic, etc.)
git clone <repository-url>
cd wordpan-templateCreate environment files for each service:
cp web/.env.example web/.env.localcp ai/.env.example ai/.envcp phoenix/.env.example phoenix/.envStart the local Supabase instance:
# Start Supabase
supabase startThis will output your local Supabase credentials, including:
- API URL (typically
http://127.0.0.1:54321) Publishable key(use this forVITE_SUPABASE_ANON_KEYandSUPABASE_ANON_KEY)Secret key(use this forSUPABASE_SERVICE_ROLE_KEY)
web/.env.local and ai/.env files.
# Create the database schema
supabase db resetNote: This is safe on first setup. For ongoing development, see the Database Migration Guidelines section.
# Start all services with Docker Compose
docker compose up --buildThis will start:
- Web Frontend: http://localhost:5173
- AI Backend: http://localhost:8000
- Phoenix Observability: http://localhost:6006
- Phoenix Database: Internal PostgreSQL instance
- Web App: Open http://localhost:5173
- Sign Up: Create a new account via the signup page
- Generate Phrases: Navigate to the "Random Phrase" page to see AI in action
- Monitor AI: Open http://localhost:6006 to view AI traces and metrics in Phoenix
Test the AI endpoint:
curl http://localhost:8000/health
# Should return: {"status": "healthy"}cd web
npm install
npm run devcd ai
uv sync
uv run python run.pysupabase startdocker compose up phoenix phoenix-db# Create a new migration file
supabase migration new <descriptive_name>
# Edit the generated file in supabase/migrations/
# Add your SQL changesDO NOT RUN THESE COMMANDS (they will wipe data):
- ❌
supabase db reset - ❌
supabase db push
Instead, apply migrations manually:
For local development:
supabase migration up- React DevTools in browser
- Vite dev server shows errors in terminal
- Check Network tab for API calls
The AI service runs with debugpy on port 5678. A VS Code launch configuration is provided in .vscode/launch.json - just press F5 or use the "Run and Debug" panel to attach to the running container.
# Access Supabase Studio
open http://127.0.0.1:54323
# Direct database access
supabase db psqlOpen Phoenix at http://localhost:6006 to:
- View all AI agent traces
- Analyze LLM call latency and tokens
- Debug agent reasoning and outputs
- Track session performance
MIT License - feel free to use this template for any project.
This template is built with amazing open-source technologies:
- React - UI framework
- Vite - Build tool
- CrewAI - Multi-agent orchestration
- Supabase - Backend-as-a-Service
- Arize Phoenix - AI observability
- Tailwind CSS - Styling framework
- Radix UI - Accessible components
- Flask - Python web framework
- LiteLLM - LLM API abstraction
- Docker - Containerization
Built with ❤️ for developers building AI-powered applications
For questions or feedback, please open an issue or discussion.