Enterprise-grade AI art evaluation platform supporting 42 AI models from 15 organizations. Full-stack application featuring complete iOS design system migration, real AI model benchmarking with Unified Model Interface, comprehensive E2E testing infrastructure, and production Google Cloud Platform deployment.
Windows:
start.bat # Starts backend (:8001) + frontend (:5173)Linux/macOS:
./start.sh # Starts backend (:8001) + frontend (:5173)Frontend Development:
cd wenxin-moyun
npm install --legacy-peer-deps
npm run dev # http://localhost:5173Backend Development:
cd wenxin-backend
pip install -r requirements.txt
python init_db.py # Initialize database with sample data
python -m uvicorn app.main:app --reload --port 8001Frontend (React 19 + iOS Design) ββ Backend (FastAPI + SQLAlchemy) ββ AI Providers (8 providers)
β β β
iOS Components Unified Model Interface Model Adapters
Zustand State Evaluation Engine Provider-specific APIs
Playwright Tests Real-time WebSockets Intelligent Scoring
β β β
Cloud Storage (Static) ββ Cloud Run (Backend API) ββ Secret Manager (API Keys)
β
Cloud SQL (PostgreSQL)
Frontend (wenxin-moyun/)
- Framework: React 19 + TypeScript 5.8 + Vite 7.1
- Styling: Tailwind CSS 4.1 with pure iOS design tokens
- State: Zustand 4.4 + custom hooks
- Animation: Framer Motion 12.23 (iOS spring physics)
- Charts: Recharts 3.1 with D3 integration
- Testing: Playwright E2E (64 test cases across 9 spec files)
Backend (wenxin-backend/)
- Framework: FastAPI + SQLAlchemy (async)
- Database: SQLite (dev) / PostgreSQL (production)
- AI Integration: Unified Model Interface with 8 provider adapters
- Real-time: WebSocket for battle updates
- Deployment: Docker + Google Cloud Run
Project Information:
- Project Name:
WenXin MoYun - Project ID:
wenxin-moyun-prod-new - Region:
asia-east1 - Service Name:
wenxin-moyun - Artifact Registry Repository:
wenxin-images
GitHub Actions Service Account:
- Email:
[email protected] - Purpose: Automated CI/CD deployment to Google Cloud Platform
The GitHub Actions service account requires these roles:
- Artifact Registry Administrator - Create/manage Docker repositories
- Cloud Run Admin - Deploy services to Cloud Run
- Cloud SQL Admin - Manage database connections and migrations
- Secret Manager Secret Accessor - Access API keys and secrets
- Storage Admin - Deploy frontend to Cloud Storage
Required Secrets in GitHub Repository Settings:
| Secret | Description | Source |
|---|---|---|
GCP_SA_KEY |
Service account JSON | Google Cloud Console |
OPENAI_API_KEY |
OpenAI API access | https://platform.openai.com/api-keys |
ANTHROPIC_API_KEY |
Anthropic API access | https://console.anthropic.com/ |
GEMINI_API_KEY |
Google Gemini API | Google AI Studio (optional) |
Secrets stored in GCP Secret Manager:
| Secret Name | Purpose | Example Value |
|---|---|---|
db-password |
Database password for PostgreSQL | randomSecurePassword123 |
secret-key |
Application secret key for JWT tokens | longRandomSecretKey456 |
openai-api-key |
OpenAI API key for AI model access | sk-... |
anthropic-api-key |
Anthropic API key for Claude models | sk-ant-... |
gemini-api-key |
Google Gemini API key | AIza... |
Development Environment:
- Demo Account: Username
demo/ Passworddemo123 - Admin Account: Username
admin/ Passwordadmin123
Development (SQLite):
DATABASE_URL=sqlite+aiosqlite:///./wenxin.dbProduction (PostgreSQL on Cloud SQL):
DATABASE_URL=postgresql+asyncpg://wenxin:[PASSWORD]@/wenxin_db?host=/cloudsql/wenxin-moyun-prod-new:asia-east1:wenxin-postgresDatabase Instance Details:
- Instance Name:
wenxin-postgres - Database Name:
wenxin_db - Username:
wenxin - Connection: Cloud SQL Proxy via Unix socket
Enable Required APIs:
gcloud services enable cloudbuild.googleapis.com
gcloud services enable run.googleapis.com
gcloud services enable sqladmin.googleapis.com
gcloud services enable secretmanager.googleapis.com
gcloud services enable storage.googleapis.com
gcloud services enable artifactregistry.googleapis.comCreate Service Account:
gcloud iam service-accounts create github-actions \
--description="GitHub Actions CI/CD" \
--display-name="GitHub Actions"Grant Required Roles:
# Artifact Registry Administrator
gcloud projects add-iam-policy-binding wenxin-moyun-prod-new \
--member="serviceAccount:[email protected]" \
--role="roles/artifactregistry.admin"
# Cloud Run Admin
gcloud projects add-iam-policy-binding wenxin-moyun-prod-new \
--member="serviceAccount:[email protected]" \
--role="roles/run.admin"
# Cloud SQL Admin
gcloud projects add-iam-policy-binding wenxin-moyun-prod-new \
--member="serviceAccount:[email protected]" \
--role="roles/cloudsql.admin"
# Secret Manager Secret Accessor
gcloud projects add-iam-policy-binding wenxin-moyun-prod-new \
--member="serviceAccount:[email protected]" \
--role="roles/secretmanager.secretAccessor"
# Storage Admin
gcloud projects add-iam-policy-binding wenxin-moyun-prod-new \
--member="serviceAccount:[email protected]" \
--role="roles/storage.admin"Create Service Account Key:
gcloud iam service-accounts keys create github-actions-key.json \
--iam-account=github-actions@wenxin-moyun-prod-new.iam.gserviceaccount.com# Database password
echo -n "your-secure-db-password" | gcloud secrets create db-password --data-file=-
# Application secret key
echo -n "your-long-random-secret-key" | gcloud secrets create secret-key --data-file=-
# AI API keys
echo -n "your-openai-api-key" | gcloud secrets create openai-api-key --data-file=-
echo -n "your-anthropic-api-key" | gcloud secrets create anthropic-api-key --data-file=-
echo -n "your-gemini-api-key" | gcloud secrets create gemini-api-key --data-file=-Go to GitHub repository β Settings β Secrets and variables β Actions:
- GCP_SA_KEY: Copy contents of
github-actions-key.json - OPENAI_API_KEY: Your OpenAI API key
- ANTHROPIC_API_KEY: Your Anthropic API key
- GEMINI_API_KEY: Your Google Gemini API key (optional)
Run Tests:
cd wenxin-moyun
# Headless mode (CI)
npm run test:e2e
# Interactive UI mode
npm run test:e2e:ui
# Debug mode
npm run test:e2e:debug
# Headed browser
npm run test:e2e:headed
# View test report
npm run test:e2e:reportTest Coverage (64 tests across 9 spec files):
homepage.spec.ts- Homepage functionality and navigationai-models.spec.ts- Leaderboard, NULL score handling, filteringios-components.spec.ts- iOS design system componentsauth.spec.ts,battle.spec.ts,evaluation.spec.ts- Core featuresperformance.spec.ts,visual.spec.ts- Performance and visual regression
cd wenxin-backend
# Run all tests
pytest
# Run specific test with verbose output
pytest tests/test_auth.py -v
# Run tests with coverage
pytest --cov=app tests/Trigger: Push to main or master branch
Pipeline Steps:
- Test Phase: Frontend build, backend tests, E2E tests
- Deploy Phase: Docker build/push, database migrations, Cloud Run deployment
- Release Phase: Automated release notes with service URLs
Production URLs:
- Frontend: https://storage.googleapis.com/wenxin-moyun-prod-new-static/
- Backend API: Deployed to Cloud Run (URL in deployment logs)
- API Docs:
[BACKEND_URL]/docs
Backend:
docker build -f wenxin-backend/Dockerfile.cloud -t asia-east1-docker.pkg.dev/wenxin-moyun-prod-new/wenxin-images/wenxin-backend:latest wenxin-backend/
docker push asia-east1-docker.pkg.dev/wenxin-moyun-prod-new/wenxin-images/wenxin-backend:latest
gcloud run deploy wenxin-moyun-api --image=asia-east1-docker.pkg.dev/wenxin-moyun-prod-new/wenxin-images/wenxin-backend:latest --region=asia-east1Frontend:
cd wenxin-moyun
npm run build
gsutil -m rsync -r -d dist/ gs://wenxin-moyun-prod-new-static/The platform features a complete iOS design system with authentic Apple design language:
IOSButton - Native iOS button with glass morphism
<IOSButton variant="primary" size="lg" glassMorphism emoji="like">
Action
</IOSButton>IOSCard - Container with structured content
<IOSCard variant="elevated" interactive animate>
<IOSCardHeader title="Title" emoji={<RankEmoji rank={1} />} />
<IOSCardContent>Content</IOSCardContent>
<IOSCardFooter>
<IOSButton>Action</IOSButton>
</IOSCardFooter>
</IOSCard>IOSToggle - iOS-style switches
<IOSToggle checked={value} onChange={setValue} color="green" />60+ Microsoft Fluent Emoji SVGs with semantic categorization:
<StatusEmoji status="completed" animated /> // β
<RankEmoji rank={1} size="lg" /> // π₯
<TypeEmoji type="painting" size="md" /> // π¨iOS Colors:
- Blue
#007AFF(Primary) - Green
#34C759(Success) - Orange
#FF9500(Warning) - Red
#FF3B30(Destructive)
Glass Morphism Effects:
- Native backdrop-blur and transparency
- iOS-style shadows and surfaces
- Subtle noise texture for authenticity
npm run dev # Start dev server (port 5173+)
npm run build # TypeScript check + production build
npm run lint # ESLint validation
npm run preview # Preview production build
# E2E Testing (Playwright - 64 test cases)
npm run test:e2e # Run tests headless across all browsers
npm run test:e2e:ui # Interactive UI mode for debugging
npm run test:e2e:debug # Step-by-step debugging mode
npm run test:e2e:headed # Run tests in visible browser
npm run test:e2e:report # Show HTML test report
npm run test:e2e -- --grep="auth" # Run specific test pattern
# Environment validation
npm run validate-env # Verify Node.js/Python versions match CIpip install -r requirements.txt # Install dependencies
python -m uvicorn app.main:app --reload --port 8001 # Start API server
python init_db.py # Reset database with sample data
# Testing
pytest # Run all tests
pytest tests/test_auth.py -v # Run specific test verbose
pytest -k "test_login" -v # Run tests matching pattern
pytest --cov=app tests/ # Test coverage
# AI Model Testing
python test_unified_interface.py # Verify models use correct APIs
python openai_benchmark.py # Run real AI benchmarksProblem: NOT_FOUND: Secret [projects/8164039155/secrets/db-password] not found
Solution: Ensure project ID (not numeric ID) is used:
# β Wrong (uses numeric ID)
gcloud secrets versions access latest --secret="db-password"
# β
Correct (specifies project ID)
gcloud secrets versions access latest --secret="db-password" --project=wenxin-moyun-prod-newProblem: Permission denied when pushing Docker images
Solutions:
- Verify service account has
artifactregistry.adminrole - Ensure repository exists:
gcloud artifacts repositories create wenxin-images \ --repository-format=docker \ --location=asia-east1
Strict Mode Violations:
// β Wrong: Multiple element matches
page.locator('[required]')
// β
Correct: Use .first() for multiple matches
page.locator('[required]').first()
// β Wrong: Invalid .or() syntax
page.locator('text=/error/i, .error-page')
// β
Correct: Proper .or() method
page.locator('text=/error/i').or(page.locator('.error-page'))Node.js Version: Must use 20.19.4 for CI compatibility
# Check version
node --version
# Install correct version (using nvm)
nvm install 20.19.4
nvm use 20.19.4Port Conflicts: Frontend auto-increments from 5173 if port is taken
Windows Compatibility: Use del instead of rm, check Windows Defender
Backend Health Check:
curl -f "[BACKEND_URL]/health"Frontend Health Check:
curl -f "https://storage.googleapis.com/wenxin-moyun-prod-new-static/index.html"Check Model Rankings:
cd wenxin-backend
python -c "
import sqlite3
conn = sqlite3.connect('wenxin.db')
cursor = conn.cursor()
cursor.execute('SELECT name, model_type, overall_score FROM ai_models ORDER BY overall_score DESC NULLS LAST')
print([f'{row[0]}: {row[2] if row[2] is not None else \"N/A\"}' for row in cursor.fetchall()[:10]])
conn.close()
"Reset Development Database:
# Windows
del wenxin.db
# Linux/macOS
rm wenxin.db
# Recreate with sample data
python init_db.py- 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
This project is licensed under the MIT License - see the LICENSE file for details.
For issues and questions:
- GitHub Issues: Create an issue
- Email: [email protected]
- Documentation: See
CLAUDE.mdfor detailed technical documentation
Built with β€οΈ using React 19, FastAPI, and Google Cloud Platform