CodeSlick - Production Deployment Guide¶
🚀 Quick Start (Vercel)¶
Prerequisites¶
- GitHub account with this repository
- Vercel account (free tier works perfectly)
- Git repository pushed to GitHub
Step 1: Deploy to Vercel¶
- Go to Vercel Dashboard
- Visit https://vercel.com/new
-
Sign in with your GitHub account
-
Import Repository
- Click "Add New Project"
- Select this repository:
codeslick2 -
Click "Import"
-
Configure Project
- Framework Preset: Next.js (auto-detected)
- Root Directory:
./(leave default) - Build Command:
npm run build(auto-detected) -
Output Directory:
.next(auto-detected) -
Environment Variables (Optional)
For Static Analysis Only (Recommended for MVP): - No environment variables needed - App works perfectly without AI features
For Advanced AI Analysis (Optional):
ENABLE_ADVANCED_ANALYSIS=true
QWEN_API_KEY=your_together_ai_key
QWEN_API_URL=https://api.together.xyz/v1
QWEN_MODEL=Qwen/Qwen2.5-Coder-32B-Instruct
- Deploy
- Click "Deploy"
- Wait 2-3 minutes for build to complete
- Your app will be live at
https://your-project.vercel.app
Step 2: Verify Deployment¶
- Open the deployed URL
- Test language switching (PT/EN toggle in header)
- Upload a code file or paste code
- Confirm language detection
- Run analysis
- Verify results display correctly
Step 3: Custom Domain (Optional)¶
- Go to Project Settings → Domains
- Add your custom domain
- Configure DNS records as instructed
- Wait for SSL certificate provisioning (automatic)
🔧 Technical Details¶
Build Configuration¶
- Framework: Next.js 15.5.4 with Turbopack
- Node Version: 18.x or higher
- Build Time: ~1.5 seconds (Turbopack optimized)
- Bundle Size: 137 kB (first load JS)
Performance Characteristics¶
- Static Pages: Pre-rendered at build time
- API Routes: Serverless functions (on-demand)
- Cache Strategy: 5-minute in-memory cache for analysis results
- Supported Regions:
iad1(US East - optimal latency)
Security Headers (Configured)¶
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Referrer-Policy: strict-origin-when-cross-origin
📊 Monitoring & Analytics¶
Recommended Additions (Post-MVP)¶
- Vercel Analytics (Built-in, free tier)
- Enable in Project Settings → Analytics
-
Tracks page views, performance metrics
-
Sentry (Error Tracking)
-
Add
SENTRY_DSNto environment variables -
Vercel Speed Insights (Free)
- Enable in Project Settings → Speed Insights
- Real User Monitoring (RUM)
🗄️ Database Setup (Future Phase)¶
For User Features (Authentication, Saved Analyses)¶
Recommended: Neon.tech (Serverless PostgreSQL)
- Create account at https://neon.tech
- Create new project
- Copy connection string
- Add to Vercel environment variables:
Schema Planning (Future)¶
-- Users table
CREATE TABLE users (
id UUID PRIMARY KEY,
email VARCHAR(255) UNIQUE,
created_at TIMESTAMP DEFAULT NOW()
);
-- Analysis history
CREATE TABLE analyses (
id UUID PRIMARY KEY,
user_id UUID REFERENCES users(id),
language VARCHAR(50),
code_hash VARCHAR(64),
result JSONB,
created_at TIMESTAMP DEFAULT NOW()
);
🚨 Troubleshooting¶
Build Fails¶
Check:
1. Node version (must be 18.x or higher)
2. All dependencies installed (npm install)
3. TypeScript errors fixed (npm run build locally first)
API Routes Not Working¶
Check:
1. Vercel function logs (Dashboard → Functions)
2. Environment variables correctly set
3. API route file structure: src/app/api/*/route.ts
Language Switching Not Persisting¶
Check: 1. Browser localStorage enabled 2. No ad blockers interfering with localStorage 3. HTTPS enabled (required for secure storage)
📝 Environment Variables Reference¶
| Variable | Required | Default | Description |
|---|---|---|---|
ENABLE_ADVANCED_ANALYSIS |
No | false |
Enable AI analysis features |
QWEN_API_KEY |
No* | - | Together.ai API key for Qwen |
QWEN_API_URL |
No* | - | Qwen API endpoint |
QWEN_MODEL |
No* | - | Model identifier |
HF_API_KEY |
No* | - | Alternative: Hugging Face key |
*Required only if ENABLE_ADVANCED_ANALYSIS=true
🎯 Post-Deployment Checklist¶
- Deployment successful
- Custom domain configured (if applicable)
- Language switching works (PT ↔ EN)
- File upload works
- Code analysis completes successfully
- Error handling displays properly
- Mobile responsive design verified
- Analytics enabled (Vercel Analytics)
- Error tracking configured (Sentry - optional)
- Performance monitoring active (Speed Insights)
📞 Support¶
Issues?
- Check Vercel build logs
- Review browser console for errors
- Test locally first: npm run build && npm start
Repository: https://github.com/your-username/codeslick2 Framework Docs: https://nextjs.org/docs Deployment Platform: https://vercel.com/docs