Skip to main content

Architecture

bullstudio consists of four core services:
ServiceDescriptionDefault Port
WebNext.js application (UI + API)3000
WorkersBackground job processing (alerts, etc.)-
PostgresPrimary database5432
RedisQueue backend & caching6379

Prerequisites

  • Node.js >= 20
  • pnpm 10.4+
  • Docker & Docker Compose
  • A Resend account (for transactional emails)

1. Clone & Install

git clone https://github.com/emirce/bullstudio.git
cd bullstudio
pnpm install

2. Start Infrastructure

Start Postgres and Redis via Docker:
docker compose -f docker/dev/compose.yml up -d
This starts:
  • Postgres 16 on localhost:5432 (user: bullstudio_user, password: bullstudio_password, db: bullstudio_db)
  • Redis 7 on localhost:6379

3. Environment Variables

Copy the example env file and fill in the required values:
cp .env.example .env
VariableRequiredDescription
DATABASE_URLYesPostgres connection string
DIRECT_URLYesDirect Postgres connection (same as DATABASE_URL locally)
AUTH_SECRETYesRandom secret for NextAuth (openssl rand -base64 32)
ENCRYPTION_KEYYes32-byte hex key for encrypting Redis credentials (openssl rand -hex 32)
RESEND_API_KEYYesAPI key from Resend
AUTH_GOOGLE_IDNoGoogle OAuth client ID
AUTH_GOOGLE_SECRETNoGoogle OAuth client secret
AUTH_GITHUB_IDNoGitHub OAuth client ID
AUTH_GITHUB_SECRETNoGitHub OAuth client secret
Minimal .env for local development:
DATABASE_URL="postgresql://bullstudio_user:bullstudio_password@localhost:5432/bullstudio_db"
DIRECT_URL="postgresql://bullstudio_user:bullstudio_password@localhost:5432/bullstudio_db"
AUTH_SECRET="your-random-secret-here"
ENCRYPTION_KEY="your-64-char-hex-key-here"
RESEND_API_KEY="re_your_resend_key"
Hint:
  • Use openssl rand -base64 32 to generate AUTH_SECRET
  • Use openssl rand -hex 32 to generate ENCRYPTION_KEY

4. Prisma Setup

Generate the Prisma client and run migrations:
# Generate the Prisma client
pnpm prisma:generate

# Run database migrations
pnpm prisma:migrate-dev
prisma:generate must run before the dev server starts. The turbo pipeline handles this automatically when running pnpm dev.

5. Start Development

pnpm dev
This starts the web app at http://localhost:3000 with hot-reload enabled. To run workers separately:
pnpm dev -F workers

Resend Setup

bullstudio uses Resend for transactional emails (invitations, alerts, etc.).
  1. Create a free account at resend.com
  2. Add and verify your domain (or use the sandbox domain for development)
  3. Generate an API key and add it to your .env as RESEND_API_KEY
Without a valid Resend API key, email features (team invitations, alert notifications) will not work.