Self-Hosting
Deploy your own instance of Levercast.
Levercast is a Next.js application that can be self-hosted on Vercel or any platform that supports Node.js.
Tech Stack
| Component | Technology |
|---|---|
| Framework | Next.js 15 (App Router) |
| Authentication | Clerk |
| Database | Neon (Serverless Postgres) |
| ORM | Drizzle |
| AI | Vercel AI SDK + OpenAI (GPT-4o-mini) |
| File Storage | Vercel Blob |
| Styling | Tailwind CSS 4 + shadcn/ui |
| Analytics | PostHog |
Prerequisites
Environment Variables
Copy .env.example to .env.local and fill in the required values:
Required
| Variable | Description |
|---|---|
DATABASE_URL | Neon Postgres connection string |
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY | Clerk publishable key |
CLERK_SECRET_KEY | Clerk secret key |
OPENAI_API_KEY | OpenAI API key for reformatting |
Platform Connections
| Variable | Description |
|---|---|
LINKEDIN_CLIENT_ID | LinkedIn OAuth app client ID |
LINKEDIN_CLIENT_SECRET | LinkedIn OAuth app client secret |
LINKEDIN_REDIRECT_URI | LinkedIn OAuth callback URL |
X_CLIENT_ID | X OAuth 2.0 client ID |
X_CLIENT_SECRET | X OAuth 2.0 client secret |
X_REDIRECT_URI | X OAuth callback URL (optional for local dev) |
FACEBOOK_APP_ID | Facebook app ID for Instagram |
FACEBOOK_APP_SECRET | Facebook app secret |
FACEBOOK_REDIRECT_URI | Instagram OAuth callback URL |
Optional
| Variable | Description |
|---|---|
CLERK_WEBHOOK_SIGNING_SECRET | Webhook secret for Clerk user sync |
CIRCLE_API_BASE_URL | Circle API base URL (default: https://app.circle.so) |
INSTAGRAM_DEFAULT_IMAGE_URL | Fallback image for Instagram posts |
BLOB_READ_WRITE_TOKEN | Vercel Blob token for image uploads |
CRON_SECRET | Secret for the scheduled publish cron endpoint |
NEXT_PUBLIC_POSTHOG_KEY | PostHog project API key |
NEXT_PUBLIC_POSTHOG_HOST | PostHog ingest host (default: /ingest) |
Database Setup
Levercast uses Drizzle ORM with Neon Postgres. Run migrations to set up the schema:
npx drizzle-kit generate # generate migration files
npx drizzle-kit migrate # apply migrationsRunning Locally
npm install
npm run devThe dev server starts at http://localhost:3847.
Deploying to Vercel
- Push your code to a Git repository
- Import the project in Vercel
- Add all environment variables in Vercel Dashboard → Settings → Environment Variables
- Deploy
Clerk Webhook
For user sync, add a webhook in the Clerk Dashboard pointing to:
https://your-domain/api/webhooks/clerkSet the CLERK_WEBHOOK_SIGNING_SECRET environment variable to the signing secret from Clerk.
Cron Jobs
For scheduled post publishing, configure a Vercel Cron job to hit /api/cron/publish. Set the CRON_SECRET environment variable to match the secret Vercel sends with cron requests.