Overview
EpiNeko is optimized for deployment on Vercel with a Supabase backend. This guide covers the complete deployment process from local development to production.This guide assumes you have already set up your Supabase project and configured environment variables locally.
Prerequisites
Before deploying, ensure you have:Vercel Account
A free or paid Vercel account (sign up at vercel.com)
Deployment Methods
Method 1: Deploy with Vercel CLI (Recommended)
Deploy from project root
- Link your project to Vercel
- Detect Next.js framework
- Create a preview deployment
Method 2: Deploy via Vercel Dashboard
Import Git Repository
- Go to vercel.com/new
- Select “Import Git Repository”
- Choose your GitHub repository
- Click “Import”
Configure Project
- Framework Preset: Next.js (auto-detected)
- Root Directory:
./(default) - Build Command:
next build(auto-detected) - Output Directory:
.next(auto-detected) - Install Command:
npm install(auto-detected)
Add Environment Variables
In the “Environment Variables” section:
| Name | Value | Environments |
|---|---|---|
NEXT_PUBLIC_SUPABASE_URL | https://your-project.supabase.co | Production, Preview, Development |
NEXT_PUBLIC_SUPABASE_ANON_KEY | eyJhbGc... | Production, Preview, Development |
Build Configuration
Next.js Build Settings
The project uses default Next.js 15 build configuration:package.json
Build Output
The build process:- Compiles TypeScript to JavaScript
- Optimizes React components
- Generates static pages where possible
- Creates server-side rendered routes
- Optimizes images and assets
Environment-Specific Configuration
Production Environment
URL: Your custom domain oryour-app.vercel.app
Environment Variables:
- Use your production Supabase project
- Enable production optimizations
- Configure custom domains
- Go to Supabase Dashboard → Authentication → URL Configuration
- Add your production URL to “Site URL”
- Add to “Redirect URLs”:
https://your-app.vercel.app/**
Preview Environment
URL: Automatically generated for each pull request Purpose: Test changes before merging to main branch Configuration:- Uses same environment variables as production
- Separate database recommended for testing
- Automatic deployment on PR creation
- Vercel Dashboard → Project Settings → Git
- Enable “Automatic Deployments” for pull requests
- Configure branch patterns if needed
Development Environment
URL:http://localhost:3000
Configuration:
- Uses
.env.localfile - Hot module reloading enabled
- Development Supabase project recommended
Custom Domain Configuration
Add Domain in Vercel
- Vercel Dashboard → Project → Settings → Domains
- Click “Add Domain”
- Enter your domain (e.g.,
epineko.com)
Configure DNS
Add these records to your DNS provider:For Apex Domain (epineko.com):For Subdomain (www.epineko.com):
Wait for DNS Propagation
DNS changes can take 24-48 hours to propagate globally.
Vercel will automatically issue SSL certificate once DNS is configured.
Database Migrations
Initial Schema Deployment
Your Supabase database should already have the schema from local development:RLS Policies
Ensure Row Level Security policies are enabled:Performance Optimization
Caching Strategy
The application uses Next.js caching for external API calls:Image Optimization
Next.js automatically optimizes images from MyAnimeList CDN:next.config.ts
- Automatic WebP conversion
- Responsive image sizing
- Lazy loading
- CDN distribution
Monitoring and Analytics
Vercel Analytics
Enable Vercel Analytics for production insights:Error Tracking
Implement error boundaries in production:src/app/error.tsx
Continuous Deployment
Automatic Deployments
Vercel automatically deploys when you push to GitHub: Main Branch → Production Deployment Feature Branches → Preview Deployments Pull Requests → Preview DeploymentsDeployment Workflow
Rollback Strategy
If a deployment fails or has issues:Troubleshooting
Build Failed: Missing Environment Variables
Build Failed: Missing Environment Variables
Error:
Error: Missing Supabase environment variablesSolution:- Verify variables are added in Vercel Dashboard
- Check variable names match exactly
- Ensure selected for correct environment
- Redeploy after adding variables
Authentication Errors in Production
Authentication Errors in Production
Error: Users can’t sign in or get redirected incorrectlySolution:
- Check Supabase Dashboard → Authentication → URL Configuration
- Verify Site URL matches production URL
- Add production URL to Redirect URLs
- Include wildcard:
https://your-app.vercel.app/**
Images Not Loading
Images Not Loading
Error: Anime posters show broken image iconsSolution:
- Verify
next.config.tsincludes MyAnimeList CDN - Check remote patterns configuration
- Ensure images array exists in config
- Redeploy after config changes
API Rate Limit Errors
API Rate Limit Errors
Error: Jikan API rate limit exceededSolution:
- Implement request queuing
- Increase cache duration
- Use CDN for static content
- Consider Jikan API premium tier
Post-Deployment Checklist
After deploying, verify these items:- Application loads at production URL
- User registration works
- User login works
- Anime search returns results
- Adding to library works
- Episode tracking functions correctly
- Images load properly
- Mobile responsive design works
- Custom domain (if configured) resolves correctly
- SSL certificate is active
- No console errors in production
- Analytics tracking is active
Scaling Considerations
Database Scaling
As your user base grows:Connection Pooling
Supabase includes built-in connection pooling
Database Indexes
Add indexes on frequently queried columns
Read Replicas
Use Supabase Pro for read replicas
Caching Layer
Implement Redis for session storage
Vercel Scaling
Vercel automatically scales based on traffic:- Serverless Functions: Auto-scale per request
- Edge Network: Global CDN distribution
- DDoS Protection: Built-in protection
- No downtime deployments: Zero-downtime updates
Related Documentation
Environment Variables
Configure secrets properly
Project Structure
Understand the codebase
Supabase Setup
Initial database configuration