Getting Started

This guide covers the fastest path to a running OpenCan instance using Docker Compose. The full stack — app, Postgres, Redis, and MinIO — starts with a single command.

Prerequisites

  • Docker and Docker Compose (v2+)
  • A domain name (required for production TLS; optional for local testing)
  • A Resend account — required for magic link login and email verification
  • Google and/or GitHub OAuth app credentials (optional — only if you want those login methods)

Step 1 — Clone the repository

git clone https://github.com/sriramgopalan/opencan.git
cd opencan

Step 2 — Configure environment variables

cp .env.example .env

Open .env and fill in the values. At minimum you need:

  • NEXT_PUBLIC_APP_URL — the public URL of your instance (e.g. https://feedback.example.com)
  • AUTH_SECRET — generate with openssl rand -base64 32
  • AUTH_URL — same as your app URL
  • RESEND_API_KEY and RESEND_FROM — for email delivery
  • IP_HASH_SECRET — generate with openssl rand -hex 32

The Docker Compose file pre-configures Postgres, Redis, and MinIO with sensible defaults so you only need to set the app-level variables for a local run. See the full Environment Variables reference.

Step 3 — Start the stack

docker compose up -d

This brings up four containers: app, postgres, redis, and minio. On first boot, the app container automatically runs prisma migrate deploy to create the database schema.

Step 4 — Open the app

Visit http://localhost:3000. Register your first account at /auth/register, then follow the steps below to make it an admin.

First admin user

OpenCan doesn't have a setup wizard — the first user must be promoted to admin manually after registering.

Via SQL (fastest)

docker compose exec postgres psql -U postgres -d opencan -c \
  "UPDATE \"User\" SET role = 'ADMIN' WHERE email = 'your@email.com';"

Via Prisma Studio (visual)

docker compose exec app npm run db:studio

Open the User table, find your record, and set role to ADMIN.

What's next?

Development setup

If you want to work on OpenCan itself (not just self-host it):

git clone https://github.com/sriramgopalan/opencan.git
cd opencan
npm install
cp .env.example .env
# fill in .env values — DATABASE_URL and REDIS_URL can point to the Docker services below

docker compose up -d postgres redis minio

npm run dev:setup
# runs prisma db push then starts the Next.js dev server

The app is available at http://localhost:3000. On subsequent runs where the schema hasn't changed, npm run dev is sufficient.

Running tests

# Unit and integration tests
npm test

# Watch mode
npm run test:watch

# Coverage
npm run test:coverage

# End-to-end (requires a running app)
npm run test:e2e

# Type checking and linting
npm run type-check
npm run lint