Deployment Guide
How to deploy OptStuff — prerequisites, Vercel deployment, and production configuration.
OptStuff is open source and designed to be self-hosted. This guide walks you through deploying the application.
Prerequisites
| Service | Purpose | Recommended Provider |
|---|---|---|
| PostgreSQL | Data storage (teams, projects, API keys, usage) | Neon, Supabase, or any PostgreSQL provider |
| Clerk | User authentication | Clerk (required) |
| Hosting | Application runtime | Vercel (recommended), any Node.js-compatible platform |
Deploy to Vercel
Vercel is the recommended deployment target as OptStuff is built on Next.js.
1. Fork the Repository
Fork EricTsai83/optstuff to your GitHub account.
2. Set Up External Services
PostgreSQL
- Create a PostgreSQL database (e.g., on Neon)
- Note your connection string:
postgresql://user:password@host/database
Clerk
- Create a Clerk application
- Note your Publishable Key and Secret Key
- Configure sign-in/sign-up URLs to match your deployment
API Key Encryption
Generate a 32+ character encryption secret:
openssl rand -base64 323. Import to Vercel
- Go to vercel.com/new
- Import your forked repository
- Set the Root Directory to
apps/optstuff-dashboard - Add environment variables (see Environment Variables for the full list)
- Deploy
4. Run Database Migrations
After the first deployment, run the database migrations:
pnpm db:pushOr use the Drizzle migration scripts included in the project.
5. Verify
- Visit your deployment URL
- Sign up / sign in via Clerk
- Create a team and project
- Generate an API key and test an image request
Production Checklist
- PostgreSQL database created and connected
- Clerk application configured with correct redirect URLs
-
API_KEY_ENCRYPTION_SECRETset to a unique 32+ character value -
NEXT_PUBLIC_APP_URLset to your production URL - Database migrations applied
- First team and project created successfully
- Test image request returns optimized image
Related Documentation
- Environment Variables — Complete reference of all configuration variables
- Quick Start — Dashboard walkthrough after deployment
- Next.js Integration — Framework setup for signed image URLs
Last updated on