- Node.js 18+ (Download)
- Git (Download)
- Database: PostgreSQL (recommended) or SQLite (development)
- AI Provider API Keys: At least one required
# Create new project directory
mkdir phoenix-ai-universal
cd phoenix-ai-universal
# Initialize git repository
git init
# Create package.json (copy from artifacts above)
# Create all configuration files from the artifacts# Install all packages
npm install
# Generate Prisma client
npx prisma generate# Copy environment template
cp .env.example .env.local
# Edit .env.local with your settings
nano .env.localRequired Environment Variables:
# Database
DATABASE_URL="postgresql://user:password@localhost:5432/phoenix_ai"
# At least one AI provider (recommended: start with Anthropic)
ANTHROPIC_API_KEY="sk-ant-your-key-here"
# Authentication
NEXTAUTH_SECRET="run-openssl-rand-base64-32-to-generate"
NEXTAUTH_URL="http://localhost:3000"# Apply database schema
npx prisma db push
# (Optional) Open database browser
npx prisma studio# Start development server
npm run dev
# Open browser
open http://localhost:3000# Install Vercel CLI
npm i -g vercel
# Deploy
vercel
# Set environment variables in Vercel dashboard
# Add database (Vercel Postgres recommended)# Install Railway CLI
npm install -g @railway/cli
# Login and deploy
railway login
railway up
# Add PostgreSQL database in Railway dashboard# Build and run with Docker Compose
docker-compose up -d
# Includes PostgreSQL, Redis, and Ollama- Connect GitHub repository to Render
- Create PostgreSQL database
- Deploy web service
- Configure environment variables
- Visit console.anthropic.com
- Create API key
- Add to
ANTHROPIC_API_KEY
- Visit platform.openai.com
- Create API key
- Add to
OPENAI_API_KEY
- Visit aistudio.google.com
- Create API key
- Add to
GOOGLE_API_KEY
# Install Ollama
curl -fsSL https://ollama.ai/install.sh | sh
# Pull models
ollama pull llama3.1
ollama pull mixtral
# Set LOCAL_AI_URL="http://localhost:11434"# Run all tests
npm test
# Type checking
npm run type-check
# Linting
npm run lint
# Build test
npm run buildThe system includes comprehensive analytics:
- Token Usage Tracking - Monitor costs across providers
- Response Time Metrics - Performance monitoring
- Provider Health Status - Real-time availability
- User Session Analytics - Conversation insights
Add new providers by implementing BaseAIProvider:
export class CustomProvider extends BaseAIProvider {
async chat(messages, model, config) {
// Your implementation
}
}Modify phases in the Phoenix interface:
const phases = [
{ id: 'research', name: 'Research', icon: Search },
{ id: 'design', name: 'Design', icon: Palette },
// Add your phases
];Customize the Phoenix architect persona:
const systemPrompt = `
You are Phoenix, specialized in ${domain}.
Current phase: ${phase}
Focus on: ${objectives}
`;Database Connection Errors
# Check DATABASE_URL format
# Ensure database is running
# Run: npx prisma db pushAPI Key Issues
# Verify API key format
# Check provider status at their status pages
# Test with minimal requestBuild Failures
# Clear Next.js cache
rm -rf .next
npm run buildPort Conflicts
# Change port in package.json
"dev": "next dev -p 3001"Production Tuning
- Enable Redis for session storage
- Configure CDN for static assets
- Set up proper database indexes
- Enable response caching
Scaling Considerations
- Use load balancers for multiple instances
- Implement horizontal database scaling
- Set up provider API quotas
- Monitor and alert on usage thresholds
- Documentation: Complete API docs included
- Issues: GitHub Issues for bug reports
- Discussions: GitHub Discussions for questions
- Updates: Watch repository for new features
# Update dependencies
npm update
# Update Prisma
npx prisma generate
# Security audits
npm audit fix- Set up error tracking (Sentry recommended)
- Monitor provider API quotas
- Track response times and success rates
- Regular database maintenance
- Environment variables configured
- Database connected and migrated
- At least one AI provider working
- Authentication system functional
- Development server running
- Tests passing
- Ready for deployment
π Congratulations! You now have a production-ready Universal AI Interface that can work with any AI provider, featuring intelligent fallbacks, real-time streaming, and enterprise-grade architecture.