Skip to content

Development Setup - ThriveSend B2B2G

Last Updated: October 20, 2025


Before you begin, ensure you have the following installed:

SoftwareMinimum VersionRecommendedPurpose
Node.js20.x LTS20.11+JavaScript runtime
pnpm8.xLatestPackage manager
PostgreSQL16.x16.1+Database
Git2.xLatestVersion control
  • Prisma Studio: GUI for database (included with Prisma)
  • VS Code: Recommended IDE with extensions
  • Docker: For containerized PostgreSQL (optional)

Terminal window
# Clone via SSH (recommended)
git clone git@github.com:gedeza/thrive-send-b2b2g.git
# Or via HTTPS
git clone https://github.com/gedeza/thrive-send-b2b2g.git
# Navigate to project
cd thrive-send-b2b2g
Terminal window
# Install pnpm globally
npm install -g pnpm
# Verify installation
pnpm --version
# Should output: 8.x or higher
Terminal window
# Install all project dependencies
pnpm install
# This will install:
# - Next.js 15.5.4
# - TypeScript 5.x
# - Prisma 6.x
# - Clerk Auth
# - Radix UI + shadcn/ui
# - And 100+ other dependencies

Screenshot Placeholder:

../../assets/images/screenshots/dev-setup-pnpm-install.png
Terminal window
# Install PostgreSQL 16 (Ubuntu/Debian)
sudo apt update
sudo apt install postgresql-16 postgresql-contrib-16
# Start PostgreSQL service
sudo systemctl start postgresql
sudo systemctl enable postgresql
# Create database and user
sudo -u postgres psql
-- In PostgreSQL shell:
CREATE DATABASE thrivesend_dev;
CREATE USER thrivesend WITH PASSWORD 'devpassword';
GRANT ALL PRIVILEGES ON DATABASE thrivesend_dev TO thrivesend;
\q
Terminal window
# Run PostgreSQL in Docker
docker run --name thrivesend-postgres \
-e POSTGRES_DB=thrivesend_dev \
-e POSTGRES_USER=thrivesend \
-e POSTGRES_PASSWORD=devpassword \
-p 5432:5432 \
-d postgres:16

Create .env.local file in the project root:

Terminal window
# Copy example environment file
cp .env.example .env.local

Edit .env.local with your values:

Terminal window
# Database
DATABASE_URL="postgresql://thrivesend:devpassword@localhost:5432/thrivesend_dev"
# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="pk_test_your-key-here"
CLERK_SECRET_KEY="sk_test_your-key-here"
# Clerk URLs
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/dashboard
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/onboarding/organization
# Resend Email (optional for local dev)
RESEND_API_KEY="re_your-key-here"
RESEND_FROM_EMAIL="noreply@yourdomain.com"
# Redis (optional for local dev)
REDIS_URL="redis://localhost:6379"
# Sentry (optional for local dev)
SENTRY_DSN="your-sentry-dsn"
# Application
NEXT_PUBLIC_APP_URL="http://localhost:3000"
NODE_ENV="development"

Screenshot Placeholder:

../../assets/images/screenshots/dev-setup-env-config.png
  1. Go to https://clerk.com and create an account
  2. Create a new application
  3. Select “Next.js” as your framework
  4. Copy the API keys to your .env.local
  5. Configure organization settings:
    • Enable “Organizations” feature
    • Set organization roles

Screenshot Placeholder:

../../assets/images/screenshots/dev-setup-clerk-dashboard.png
Terminal window
# Generate Prisma Client
npx prisma generate
# Run database migrations
npx prisma migrate dev
# You'll see output like:
# ✔ Generated Prisma Client
# ✔ Applied 1 migration
# Database schema is up to date!
# Seed the database with sample data
npx prisma db seed
# This creates:
# - Sample organizations
# - Test users
# - Sample clients (government and business)
# - Test campaigns

Screenshot Placeholder:

../../assets/images/screenshots/dev-setup-prisma-migrate.png
Terminal window
# Run the development server
pnpm dev
# You should see:
# ▲ Next.js 15.5.4
# - Local: http://localhost:3000
# - Environments: .env.local
# ✓ Ready in 2.5s

Open http://localhost:3000 in your browser.

Screenshot Placeholder:

../../assets/images/screenshots/dev-setup-app-running.png

Create .vscode/extensions.json:

{
"recommendations": [
"prisma.prisma",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"bradlc.vscode-tailwindcss",
"ms-playwright.playwright",
"github.copilot"
]
}

Create .vscode/settings.json:

{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"tailwindCSS.experimental.classRegex": [
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
["cn\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
]
}

Run the following commands to verify everything is set up correctly:

Terminal window
# 1. Check Node.js version
node --version
# Expected: v20.x.x
# 2. Check pnpm version
pnpm --version
# Expected: 8.x.x
# 3. Check PostgreSQL connection
npx prisma db execute --stdin <<< "SELECT 1;"
# Expected: Query executed successfully
# 4. Check Prisma Client
npx prisma generate
# Expected: ✔ Generated Prisma Client
# 5. Run linter
pnpm lint
# Expected: No errors (or only warnings)
# 6. Run tests
pnpm test
# Expected: Tests pass (may have some skipped)
# 7. Build the project
pnpm build
# Expected: ✓ Compiled successfully

Terminal window
# Find process using port 3000
lsof -i :3000
# Kill the process
kill -9 <PID>
# Or use a different port
pnpm dev -- -p 3001
Terminal window
# Delete node_modules and reinstall
rm -rf node_modules
rm pnpm-lock.yaml
pnpm install
# Generate Prisma Client
npx prisma generate
Terminal window
# Check PostgreSQL is running
sudo systemctl status postgresql
# Test connection
psql -h localhost -U thrivesend -d thrivesend_dev
# Check DATABASE_URL in .env.local
echo $DATABASE_URL
  1. Verify API keys in .env.local
  2. Check Clerk dashboard for application status
  3. Ensure organization feature is enabled
  4. Clear browser cookies and retry

Now that your development environment is set up:

  1. Read Project Structure to understand the codebase
  2. Explore System Design for architecture overview


Last Updated: October 20, 2025