Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 44 additions & 11 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,24 +1,57 @@
## Local development Postgres connection string
## Works with the Docker setup and a native PostgreSQL server using these credentials.
## See README "Local Postgres".
DATABASE_URL=postgres://postgres:postgres@localhost:5432/rr7_test
DATABASE_URL=postgres://postgres:postgres@localhost:5432/rocket

## For Google auth, also set (example placeholders):
## Dedicated database for integration tests. Required by `bun run test:integration`,
## and so by `bun run check`, which runs it. The suite truncates and re-migrates
## whatever it connects to, so it must differ from DATABASE_URL and its name must
## contain "test" — the harness refuses otherwise. `bun run db:up` creates this one.
TEST_DATABASE_URL=postgres://postgres:postgres@localhost:5432/rocket_test

## Session signing. Both are REQUIRED in production and optional in development.
# BETTER_AUTH_SECRET=generate-with-openssl-rand-base64-32
# BETTER_AUTH_URL=https://example.com

## The single header your proxy sets to the real client IP, used to bucket auth
## rate limits per caller. Without it Better Auth cannot tell callers apart and
## puts everyone in one shared bucket per path, so a few failed sign-ins from
## any one person lock out every user.
##
## Pick a header your proxy ALWAYS overwrites; anything a client can forge
## defeats the limit. Common values: x-real-ip (nginx, Caddy, most proxies),
## cf-connecting-ip (Cloudflare), fly-client-ip (Fly.io), x-vercel-forwarded-for
## (Vercel).
# AUTH_IP_ADDRESS_HEADER=x-real-ip

## Set automatically by Vercel — leave unset elsewhere. Vercel Web Analytics
## only has somewhere to report to when Vercel is serving the app, so this
## decides whether its client script loads at all.
# VERCEL=1

## ---------------------------------------------------------------------------
## Optional capabilities
##
## Absent configuration is valid and means the capability is unavailable.
## PARTIAL configuration is a startup error, never a degraded state.
## ---------------------------------------------------------------------------

## Google sign-in — set BOTH or NEITHER.
# GOOGLE_CLIENT_ID=your-google-client-id.apps.googleusercontent.com
# GOOGLE_CLIENT_SECRET=your-google-client-secret

## Azure OpenAI (required for /dashboard/ai)
## Azure AI Chat (experimental) — set BOTH the resource name and the API key.
## See docs/capabilities/ai-chat.md
# AZURE_OPENAI_RESOURCE_NAME=your-resource-name
# AZURE_OPENAI_API_KEY=your-api-key
# AZURE_OPENAI_DEPLOYMENT_NAME=gpt-5-chat

## Polar payments (see https://www.better-auth.com/docs/plugins/polar)
## Billing is OFF unless POLAR_ACCESS_TOKEN is set. When off, the Polar plugin is
## not mounted at all: sign-up works normally and the billing page shows a notice.
## Set POLAR_ENABLED=false to force it off even when a token is present.
# POLAR_ENABLED=false
## Polar billing — see docs/capabilities/billing.md
## Billing becomes available as soon as POLAR_ACCESS_TOKEN is set.
# POLAR_ACCESS_TOKEN=...
# POLAR_SERVER=sandbox # or production
# POLAR_WEBHOOK_SECRET=... # if using webhooks plugin
# Map your Polar product for the Pro plan (from Polar dashboard)
# POLAR_SERVER=sandbox
# POLAR_PRODUCT_PRO_ID=...
## Requires POLAR_ACCESS_TOKEN; setting it alone is a startup error.
# POLAR_WEBHOOK_SECRET=...
## Operational kill switch for a fully configured integration.
# POLAR_ENABLED=false
41 changes: 41 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
version: 2

updates:
- package-ecosystem: npm
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 10
groups:
# One PR per ecosystem cluster keeps review cost proportional to risk.
react-router:
patterns:
- "react-router*"
- "@react-router/*"
radix:
patterns:
- "@radix-ui/*"
- "radix-ui"
dev-tooling:
dependency-type: development
patterns:
- "*"
ignore:
# Better Auth carries the session and organization contract; its upgrades
# get a deliberate, tested pass rather than an automated bump. Minor is
# ignored too, not just major: the 1.3 -> 1.6 upgrade renamed
# auth.api.forgetPassword and changed the generated schema, so its minors
# are breaking in practice.
- dependency-name: better-auth
update-types:
- version-update:semver-major
- version-update:semver-minor
# The Polar plugin peers on a narrow better-auth range, so it can only
# move as part of that same deliberate pass.
- dependency-name: "@polar-sh/better-auth"
- dependency-name: "@polar-sh/sdk"

- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
165 changes: 165 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
name: CI

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
# Every job runs with all optional capabilities unconfigured: that is the
# configuration a fresh clone must survive.
BETTER_AUTH_SECRET: ci-secret-not-for-production

jobs:
static:
name: Static
runs-on: ubuntu-latest
# A fast subset of `bun run check` that fails before the database jobs
# finish spinning up. The `test` job runs the whole gate.
steps:
- uses: actions/checkout@v5

- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- run: bun install --frozen-lockfile

- name: Format
run: bun run format:check

- name: Lint
run: bun run lint

- name: Typecheck
run: bun run typecheck

- name: .env.example matches the schema
run: bun run env:check

test:
name: Test
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: rocket
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 5s
--health-timeout 3s
--health-retries 20
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/rocket
TEST_DATABASE_URL: postgres://postgres:postgres@localhost:5432/rocket_test
steps:
- uses: actions/checkout@v5

- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- run: bun install --frozen-lockfile

- name: Create the test database
run: bun run db:test:setup

- name: Migrate a fresh database from zero
run: bun run db:migrate
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/rocket_test

- name: The full gate
# The same single command developers run locally.
run: bun run check

e2e:
name: E2E and build
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: rocket
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 5s
--health-timeout 3s
--health-retries 20
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/rocket
TEST_DATABASE_URL: postgres://postgres:postgres@localhost:5432/rocket_test
steps:
- uses: actions/checkout@v5

- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- run: bun install --frozen-lockfile

- name: Build production assets
run: bun run build

- name: Create and migrate the test database
run: |
bun run db:test:setup
DATABASE_URL="$TEST_DATABASE_URL" bun run db:migrate

- name: Install Playwright browsers
run: bun run test:e2e:install

- name: Smoke journey
run: bun run test:e2e

- uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report
path: playwright-report/
retention-days: 7

security:
name: Security
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- uses: actions/checkout@v5

- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- run: bun install --frozen-lockfile

- name: Audit dependencies
run: bun audit --audit-level=high
continue-on-error: true

- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: javascript-typescript
queries: security-extended

- name: Analyze
uses: github/codeql-action/analyze@v4
with:
category: /language:javascript-typescript
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ node_modules

# generated files
/app/components/ui/icons
.react-router/
.react-router/
# Local dev server logs
.openlogs/
Loading
Loading