Installation
Get RankThis up and running in your local development environment.
Prerequisites
Before you begin, make sure you have the following installed:
- • Node.js (18.0 or later)
- • pnpm (recommended) or npm
- • PostgreSQL database (local or hosted)
- • Git for cloning the repository
Quick Start
1. Clone and Install
# Clone the repositorygit clone https://github.com/your-username/rankthis.gitcd rankthis# Install dependenciespnpm install# Copy environment templatecp .env.example .env
2. Environment Setup
Configure your .env file with the minimum required variables:
.env
# Database ConfigurationDATABASE_URL="postgresql://username:password@localhost:5432/rankthis"# AuthenticationAUTH_SECRET="your-generated-secret-key"AUTH_GOOGLE_ID="your-google-client-id"AUTH_GOOGLE_SECRET="your-google-client-secret"# Email ServiceAUTH_RESEND_KEY="re_your-resend-api-key"# Stripe (for payments)STRIPE_SECRET_KEY="sk_test_..."STRIPE_WEBHOOK_SECRET="whsec_..."# Client-side variablesNEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_test_..."# Cron jobs securityCRON_SECRET="your-cron-secret"
🔑 Generate AUTH_SECRET
Run this command to generate a secure secret:
openssl rand -base64 32
3. Database Setup
Initialize your database with Prisma:
# Generate Prisma clientpnpm db:generate# Run database migrationspnpm db:migrate# Optional: Seed the databasepnpm db:seed
4. Start Development Server
# Start the development serverpnpm dev
Visit http://localhost:3000 to see your application running!
Advanced Configuration
Complete Environment Variables
For full functionality, configure these additional variables:
.env
1# Database Configuration2DATABASE_URL="postgresql://username:password@localhost:5432/rankthis"34# Authentication5AUTH_SECRET="your-generated-secret-key"6AUTH_GOOGLE_ID="your-google-client-id"7AUTH_GOOGLE_SECRET="your-google-client-secret"89# Email Service10AUTH_RESEND_KEY="re_your-resend-api-key"1112# Stripe Configuration13STRIPE_SECRET_KEY="sk_test_..."14STRIPE_WEBHOOK_SECRET="whsec_..."1516# Stripe Price IDs (Tiered Subscriptions)17STRIPE_PRICE_PRO_MONTHLY="price_..."18STRIPE_PRICE_PRO_YEARLY="price_..."19STRIPE_PRICE_ULTRA_MONTHLY="price_..."20STRIPE_PRICE_ULTRA_YEARLY="price_..."2122# Client-side variables23NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_test_..."24NEXT_PUBLIC_POSTHOG_KEY="phc_..."25NEXT_PUBLIC_POSTHOG_HOST="https://eu.i.posthog.com"2627# Analytics (optional)28POSTHOG_HOST="https://eu.i.posthog.com"2930# Security31CRON_SECRET="your-cron-secret"
✅ Verify Installation
Check that everything is working correctly:
- • ✅ Development server starts without errors
- • ✅ Database connection successful
- • ✅ Authentication works (sign in/out)
- • ✅ No console errors in browser
Installation Complete!
Your development environment is ready. Next, configure your services.