Version Control & Peer Review for SQL
Manage, version, and approve SQL queries with your team. Self-hosted or cloud-ready.
Quorum is a team-based SQL query management platform with built-in version control and approval workflows. The name reflects the core featureβconfigurable approval quotas (a quorum is the minimum needed for a decision).
Unlike shared folders or wikis, Quorum provides:
- Git-like version history for every query change
- Mandatory peer review before queries go live
- Team isolation with database-level security
- Full audit trail of who changed what and when
Perfect for data teams, analytics engineers, and anyone who needs governance over shared SQL.
| Feature | Description |
|---|---|
| π Team Isolation | Multi-tenant architecture with Row-Level Security (RLS). Teams only see their own data. |
| π Version Control | Complete change history with diff views and rollback capability. |
| β Approval Workflows | Configurable approval quotas per team. Require 1, 2, or more reviewers. |
| π₯ Peer Review | Self-approval prevented at the database level. Changes require teammates. |
| π Role-Based Access | Admin and member roles with granular permissions. |
| π Self-Hosted Option | Run on your own infrastructure with Docker. No vendor lock-in. |
| βοΈ Cloud Ready | Deploy to Supabase for managed PostgreSQL and authentication. |
| π Folder Organization | Hierarchical folders to organize queries by project, team, or domain. |
git clone https://github.com/montrellcruse/quorum-sql.git
cd quorum-sql
pnpm install
pnpm devVisit http://localhost:8080/setup and follow the configuration wizard.
git clone https://github.com/montrellcruse/quorum-sql.git
cd quorum-sql
docker compose up -d db server
pnpm install && pnpm devOpen http://localhost:8080 to access the application.
| Mode | Best For | Auth | Database |
|---|---|---|---|
| Self-Hosted | Full control, air-gapped environments | Local accounts | PostgreSQL via Docker |
| Supabase Cloud | Quick start, managed infrastructure | Supabase Auth + Google OAuth | Supabase PostgreSQL |
- Frontend: React 18 with Vite 7
- Language: TypeScript 5
- Styling: Tailwind CSS 3 + shadcn/ui
- Backend: Fastify REST API
- Database: PostgreSQL 16 with Row-Level Security
- ORM/Client: Supabase JS or direct REST
- Validation: Zod 4
- State: TanStack Query
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Frontend β
β βββββββββββββββ βββββββββββββββ βββββββββββββββββββββββ β
β β React β β TanStack β β Tailwind CSS β β
β β Router β β Query β β + shadcn/ui β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ
β
ββββββββββββββββ΄βββββββββββββββ
βΌ βΌ
βββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββ
β REST API (Fastify) β β Supabase Client (Cloud) β
β - JWT Auth β β - Supabase Auth β
β - Rate Limiting β β - Google OAuth β
β - CORS β β - Real-time (optional) β
βββββββββββββ¬ββββββββββββββ ββββββββββββββββ¬βββββββββββββββ
β β
ββββββββββββββββ¬ββββββββββββββββββ
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β PostgreSQL β
β βββββββββββββββ βββββββββββββββ βββββββββββββββββββββββ β
β β 8 Tables β β 37+ RLS β β Security Definer β β
β β β β Policies β β Functions β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
8 tables with comprehensive Row-Level Security:
| Table | Purpose |
|---|---|
profiles |
User information synced with auth |
teams |
Team settings + approval quotas |
team_members |
User-team relationships with roles |
team_invitations |
Pending invitations by email |
folders |
Hierarchical query organization |
sql_queries |
Versioned query storage |
query_history |
Complete change audit trail |
query_approvals |
Approval tracking per version |
See supabase/ERD.md for the full entity relationship diagram.
Copy .env.example to .env and configure:
# Database Provider: 'rest' (self-hosted) or 'supabase' (cloud)
VITE_DB_PROVIDER=rest
# Self-Hosted Mode
VITE_API_BASE_URL=http://localhost:8787
VITE_AUTH_PROVIDERS=local
# OR Supabase Mode
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_PUBLISHABLE_KEY=your-anon-key
# Common Settings
VITE_ALLOWED_EMAIL_DOMAIN=@yourcompany.com
VITE_APP_NAME=QuorumThe setup wizard at /setup guides you through:
- Choose Provider β Self-Hosted or Supabase Cloud
- Configure Settings β Email domain restrictions, app name
- Generate Config β Download your
.envfile
Frontend telemetry supports:
- Sentry error tracking (
VITE_SENTRY_DSN,VITE_SENTRY_ENV,VITE_SENTRY_TRACES_SAMPLE_RATE) - PostHog product analytics (
VITE_POSTHOG_KEY,VITE_POSTHOG_HOST)
Sentry is initialized in src/lib/telemetry.ts, but GitHub issue creation is configured in Sentry, not in this repo.
Follow the placeholder runbook to enable or document the integration: runbooks/sentry-github.md.
| Command | Description |
|---|---|
pnpm dev |
Start development server on port 8080 |
pnpm build |
Build for production |
pnpm lint |
Run ESLint |
pnpm preview |
Preview production build |
pnpm test |
Run server unit tests |
pnpm test:e2e |
Run end-to-end tests (Playwright) |
Quorum is built with security as a core principle:
- 37+ RLS Policies β Database-level access control on all tables
- Team Isolation β Users only see their teams' data
- Peer Review Enforcement β Self-approval prevented at database level
- Domain Restriction β Configurable email domain authentication
- Strong Password Policy β Minimum 8 chars with uppercase, lowercase, number, and special character requirements plus common password blocklist
- SQL Injection Protection β Parameterized queries throughout
- XSS Protection β React's automatic escaping + CSP headers (enforced in both dev and production)
- Security Definer Functions β Controlled privilege elevation with
SET search_path - Rate Limiting β Per-route rate limits on all endpoints via
@fastify/rate-limit - Non-Root Docker β Container runs as
nodeuser, not root
See SECURITY.md for the complete security policy and audit history.
βββ src/
β βββ components/ # React components
β β βββ setup/ # Setup wizard
β β βββ ui/ # shadcn/ui components
β βββ contexts/ # Auth & Team React contexts
β βββ pages/ # Route page components
β βββ hooks/ # Custom React hooks
β βββ integrations/ # Supabase client config
βββ server/ # Fastify REST API
β βββ src/
β β βββ routes/ # API route handlers
β β βββ middleware/ # Auth, rate limiting
β βββ package.json
βββ supabase/
β βββ migrations/ # Squashed baseline migration
β βββ schema.sql # Schema documentation
β βββ ERD.md # Entity relationship diagram
βββ docker-compose.yml # Docker services config
βββ .env.example # Environment template
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Test your changes (
pnpm lint && pnpm build) - Commit with a clear message (
git commit -m 'Add amazing feature') - Push to your branch (
git push origin feature/amazing-feature) - Open a Pull Request
See CONTRIBUTING.md for detailed guidelines.
This project is licensed under the MIT License β see LICENSE for details.
- Issues: GitHub Issues
- Security: SECURITY.md for vulnerability reporting
- Database Docs: supabase/README.md