Dyeink can be deployed to various platforms including Vercel, Cloudflare Workers, or traditional servers. This guide covers deployment options and environment configuration.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/subratomandal/dyeink/llms.txt
Use this file to discover all available pages before exploring further.
Deployment Options
Choose the deployment platform that best fits your needs:Vercel
Best for easy deployment with zero configuration. Excellent for Next.js and frontend hosting.
Cloudflare Workers
Best for global edge deployment with low latency. Great for serverless backends.
Traditional Servers
Best for full control and custom infrastructure. VPS, AWS EC2, etc.
Vercel Deployment
Vercel provides seamless deployment for both frontend and backend components.Prerequisites
- Vercel account (vercel.com)
- Git repository (GitHub, GitLab, or Bitbucket)
- Completed Auth0, MongoDB, and Storage setup
Deploy Frontend (Platform)
Connect repository
- Log in to Vercel
- Click Add New > Project
- Import your Git repository
- Vercel will auto-detect the framework settings
Configure build settings
Set the following for your platform frontend:
- Framework Preset: Vite (or auto-detected)
- Root Directory:
platform - Build Command:
npm run buildorvite build - Output Directory:
dist - Install Command:
npm install
Deploy Backend (API)
Create backend project
- Create a new Vercel project for your backend
- Import the same repository
- Set Root Directory to
backend
Configure build settings
- Framework Preset: Other
- Root Directory:
backend - Build Command:
npm run build(if using TypeScript) - Output Directory: Leave empty for Node.js
- Install Command:
npm install
Get Vercel API Credentials
For domain management features, you need Vercel API access:Create access token
- Go to Settings > Tokens in Vercel dashboard
- Click Create Token
- Name it “Dyeink API Access”
- Set expiration (or no expiration)
- Click Create and copy the token
Get project and team IDs
Project ID:
- Navigate to your project settings
- Copy the Project ID from the General tab
- Go to your team settings
- Copy the Team ID
- If not using teams, omit this variable
Cloudflare Workers Deployment
Deploy your backend as serverless functions at the edge.Prerequisites
- Cloudflare account with Workers enabled
- Wrangler CLI installed:
npm install -g wrangler - Cloudflare API token
Setup
Traditional Server Deployment
Deploy to a VPS, AWS EC2, DigitalOcean Droplet, or similar.Prerequisites
- Linux server (Ubuntu 20.04+ recommended)
- Node.js 18+ installed
- Nginx or Apache for reverse proxy
- SSL certificate (Let’s Encrypt recommended)
Backend Deployment
Configure environment
Configure Nginx
Create Nginx configuration:Save to
/etc/nginx/sites-available/dyeink-api and enable:Frontend Deployment
Environment Variables Reference
Complete list of all environment variables for production deployment:Frontend Variables
| Variable | Description | Example |
|---|---|---|
VITE_AUTH0_DOMAIN | Auth0 tenant domain | your-tenant.auth0.com |
VITE_AUTH0_CLIENT_ID | Auth0 SPA client ID | abc123... |
VITE_AUTH0_AUDIENCE | Auth0 API identifier | https://api.dyeink.com |
VITE_AUTH0_REDIRECT_URI | OAuth callback URL | https://yourdomain.com |
VITE_API_BASE_URL | Backend API base URL | /api or https://api.yourdomain.com |
Backend Variables
| Variable | Description | Example |
|---|---|---|
MONGODB_URI | MongoDB connection string | mongodb+srv://... |
AUTH0_DOMAIN | Auth0 tenant domain | your-tenant.auth0.com |
AUTH0_CLIENT_ID | Auth0 application client ID | abc123... |
AUTH0_CLIENT_SECRET | Auth0 application client secret | secret123... |
AUTH0_AUDIENCE | Auth0 API identifier | https://api.dyeink.com |
AUTH0_MANAGEMENT_API_TOKEN | Auth0 Management API token | token123... |
R2_ACCOUNT_ID | Cloudflare account ID | abc123... |
R2_ACCESS_KEY_ID | R2 access key ID | access123... |
R2_SECRET_ACCESS_KEY | R2 secret access key | secret123... |
R2_BUCKET_NAME | R2 bucket name | dyeink-images |
R2_PUBLIC_URL | Public URL for R2 bucket | https://cdn.yourdomain.com |
VERCEL_TOKEN | Vercel API token (optional) | token123... |
VERCEL_PROJECT_ID | Vercel project ID (optional) | prj_... |
VERCEL_TEAM_ID | Vercel team ID (optional) | team_... |
PORT | Server port | 3000 |
NODE_ENV | Environment name | production |
FRONTEND_URL | Frontend URL for CORS | https://yourdomain.com |
CI/CD Setup
Automate deployments with GitHub Actions.GitHub Actions Example
Add secrets to GitHub
- Go to your repository Settings > Secrets and variables > Actions
- Click New repository secret
- Add all required secrets (VERCEL_TOKEN, environment variables, etc.)
Post-Deployment Checklist
Verify all services
- Frontend loads correctly
- Backend API responds
- Authentication works (login/logout)
- Database connection is stable
- File uploads work (R2 storage)
- Custom domains are configured
Configure monitoring
Set up monitoring and error tracking:
- Application monitoring (Sentry, LogRocket, etc.)
- Uptime monitoring (UptimeRobot, Pingdom)
- Log aggregation (Logtail, Papertrail)
- Performance monitoring (Vercel Analytics, Cloudflare Analytics)
Security hardening
- SSL certificates are active
- CORS is properly configured
- Rate limiting is enabled
- Security headers are set
- Environment variables are secured
- API keys are rotated
Update Auth0 settings
Update Auth0 with production URLs:
- Allowed Callback URLs
- Allowed Logout URLs
- Allowed Web Origins
- CORS settings
Troubleshooting
Build fails on Vercel
Build fails on Vercel
- Check build logs for specific errors
- Verify all environment variables are set
- Ensure
package.jsonscripts are correct - Check Node.js version compatibility
- Try building locally first:
npm run build
API returns 500 errors
API returns 500 errors
- Check backend logs for stack traces
- Verify database connection string
- Ensure all required environment variables are set
- Check Auth0 configuration
- Verify R2 credentials are correct
Authentication not working
Authentication not working
- Verify Auth0 callback URLs match your domain
- Check that AUTH0_AUDIENCE is identical in frontend and backend
- Ensure cookies are enabled
- Check browser console for CORS errors
- Verify JWT token is being sent in Authorization header
Images not loading
Images not loading
- Check R2_PUBLIC_URL is correct
- Verify CORS settings on R2 bucket
- Ensure images were uploaded successfully
- Check Content-Type headers
- Test direct access to R2 URL
Performance Optimization
Next Steps
Auth0 Setup
Review authentication configuration
MongoDB Setup
Review database configuration
Storage Setup
Review storage configuration

