mirror of
https://github.com/bitbaum/orangecat.git
synced 2026-12-04 06:49:58 +01:00
Forty-five 2025 plans, assessments, design scenarios, status reports and superseded business docs move to docs/archive/ (same relative path). Each described a plan or a snapshot as if it were the running system: strict:false, a five-table schema, an "organization" entity, price_sats, a Gemini /api/chat widget, a /auth/forgot-password page, Google Places, building group labels and contract voting flows that never landed. Fixed in place: NAVIGATION_UX_DESIGN.md (referenced by .claude/rules) gains a status note naming what shipped and where; GENERIC_API_HANDLERS.md lists the handler options the code actually takes; datetime_standards.md points at scripts/dev/; CONTRIBUTING.md describes the auto-merge shipping flow. Inbound links repointed (SECURITY.md at the root, SUPABASE_SCHEMA_GUIDE.md for schema). Claude-Session: https://claude.ai/code/session_01PJkbo18cRNXtgPWZN2S9cD Co-authored-by: Claude <noreply@anthropic.com>
5.7 KiB
5.7 KiB
🚀 OrangeCat Development Environment Setup
Complete guide to setting up your development environment for OrangeCat development.
📋 Prerequisites
Before you begin, ensure you have:
Required Software
- Node.js 18+ LTS - Download
- Git - Version control system
- pnpm 11 - Package manager (
packageManagerfield pins the version; Corepack activates it)
Optional but Recommended
- VS Code - IDE with excellent TypeScript support
- Supabase CLI - For local database development
- Docker - For containerized development
⚡ Quick Setup (5 minutes)
1. Clone Repository
git clone <repository-url>
cd orangecat
2. Install Dependencies
pnpm install
3. Set Up Environment Variables
# Copy template
cp config/production.env.template .env.local
# Edit with your credentials
# Required: NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_ANON_KEY
4. Database Setup
OrangeCat uses a self-hosted Supabase instance at https://supabase.orangecat.ch (Hetzner box).
- Point
.env.localat the self-hosted instance (URL + keys) - Migrations are SQL files in
supabase/migrations/, applied viapsqlon the box (seedocs/operations/supabase/migrations-guide.md)
5. Start Development Server
# Use the clean start command (recommended)
pnpm run fresh:start
# Alternative (if ports conflict)
pnpm run dev:clean
🔧 Development Environment Details
Node.js Setup
- Version: 18.17.0+ (LTS)
- Package Manager: pnpm 11 (
pnpm-lock.yamlis the only lockfile) - Environment: Development uses
.env.local
Supabase Configuration
- Development & Production: Uses the self-hosted Supabase instance at
https://supabase.orangecat.ch(Hetzner box) - No Local Database: Single self-hosted instance for consistency
- Migrations: SQL files in
supabase/migrations/applied viapsql(seedocs/operations/supabase/migrations-guide.md)
VS Code Extensions (Recommended)
{
"recommendations": [
"ms-vscode.vscode-typescript-next",
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"bradlc.vscode-tailwindcss",
"ms-vscode.vscode-json",
"formulahendry.auto-rename-tag"
]
}
🧪 Testing Setup
Test Database
# Set up test environment
cp .env.example .env.test.local
# Run tests
pnpm test
# Run with coverage
pnpm run test:coverage
Browser Testing
# Install Playwright browsers
pnpm exec playwright install
# Run E2E tests
pnpm run test:e2e
🔒 Security Setup
Environment Variables
# Required for development
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key
# Optional for advanced features
SUPABASE_SERVICE_ROLE_KEY=your_service_key
SUPABASE_ACCESS_TOKEN=your_access_token
Authentication Setup
- Supabase handles authentication automatically
- No additional setup required for basic auth
- Social logins configured in Supabase dashboard
🐛 Debugging Setup
Browser DevTools
- Open Chrome DevTools (F12)
- Go to Network tab
- Check Console for errors
- Monitor Application tab for React DevTools
VS Code Debugging
// .vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Next.js: debug server-side",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/node_modules/next/dist/bin/next",
"args": ["dev"],
"cwd": "${workspaceFolder}"
}
]
}
📊 Monitoring Setup
Local Monitoring
# Start monitoring dashboard
pnpm run monitor:metrics
# Check application health
pnpm run health:check
Error Tracking
- Console errors automatically logged
- Production errors sent to monitoring service
- Database query performance tracked
🚀 Advanced Setup Options
Docker Development
# Build and run with Docker
docker-compose up --build
# Run tests in Docker
docker-compose run --rm app pnpm test
Multiple Environment Setup
# Development
cp config/production.env.template .env.local
# Staging
cp config/production.env.template .env.staging
# Production
# Handled by deployment platform
🔧 Troubleshooting Setup Issues
Port Conflicts
# Kill existing Node processes
pnpm run kill:node
# Clear Next.js cache
pnpm run clear:cache
# Start fresh
pnpm run fresh:start
Database Issues
OrangeCat uses cloud Supabase - no local database to manage.
# Check cloud database connectivity
node scripts/diagnostics/check-supabase.js
# View database logs / run schema changes
# (Managed Supabase Cloud retired 2026-06 — DB is now self-hosted at supabase.orangecat.ch on the Hetzner box; access via the box / founder.)
Permission Issues
# Fix file permissions
chmod +x scripts/*.sh
chmod +x scripts/*.bat
# Fix node_modules permissions (if needed)
sudo chown -R $(whoami) node_modules/
📚 Related Documentation
- Development Workflow - Complete development guide
- Architecture Overview - System design
- Testing Guide - Testing strategies
- Deployment Guide - Production deployment
🆘 Getting Help
If you encounter issues:
- Check existing documentation - Browse
/docs/thoroughly - Search GitHub issues - Others may have encountered similar problems
- Check console logs - Error messages often provide clues
- Verify environment variables - Ensure all required variables are set
Last Updated: 2026-06-15 Setup Time: ~5-10 minutes for basic setup, ~30 minutes for full environment