{"id":38058990,"url":"https://github.com/montrellcruse/quorum-sql","last_synced_at":"2026-05-05T07:03:09.920Z","repository":{"id":331599691,"uuid":"1084667852","full_name":"montrellcruse/quorum-sql","owner":"montrellcruse","description":"Collaborative SQL query management with version control and peer review. Self-hosted or cloud-ready.","archived":false,"fork":false,"pushed_at":"2026-01-14T08:09:39.000Z","size":1122,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-18T08:29:44.198Z","etag":null,"topics":["postgresql","query-manager","react","sql","supabase","tailwindcss","typescript","vite"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/montrellcruse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-28T01:56:23.000Z","updated_at":"2026-01-14T08:08:14.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/montrellcruse/quorum-sql","commit_stats":null,"previous_names":["montrellcruse/quorum-sql"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/montrellcruse/quorum-sql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/montrellcruse%2Fquorum-sql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/montrellcruse%2Fquorum-sql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/montrellcruse%2Fquorum-sql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/montrellcruse%2Fquorum-sql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/montrellcruse","download_url":"https://codeload.github.com/montrellcruse/quorum-sql/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/montrellcruse%2Fquorum-sql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28721989,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T08:27:05.734Z","status":"ssl_error","status_checked_at":"2026-01-24T08:27:01.197Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["postgresql","query-manager","react","sql","supabase","tailwindcss","typescript","vite"],"created_at":"2026-01-16T20:27:59.876Z","updated_at":"2026-02-07T23:16:16.142Z","avatar_url":"https://github.com/montrellcruse.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"assets/logo.png\" alt=\"Quorum Logo\" width=\"300\"\u003e\n  \u003ch1\u003eCollaborative SQL Query Management\u003c/h1\u003e\n  \u003cp\u003e\n    \u003cstrong\u003eVersion Control \u0026 Peer Review for SQL\u003c/strong\u003e\n  \u003c/p\u003e\n  \u003cp\u003e\n    Manage, version, and approve SQL queries with your team. Self-hosted or cloud-ready.\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n[![CI](https://github.com/montrellcruse/quorum-sql/actions/workflows/ci.yml/badge.svg)](https://github.com/montrellcruse/quorum-sql/actions/workflows/ci.yml)\n[![Security](https://github.com/montrellcruse/quorum-sql/actions/workflows/security.yml/badge.svg)](https://github.com/montrellcruse/quorum-sql/actions/workflows/security.yml)\n![React](https://img.shields.io/badge/React-18-61dafb?style=flat-square\u0026logo=react)\n![TypeScript](https://img.shields.io/badge/TypeScript-5-3178c6?style=flat-square\u0026logo=typescript)\n![Vite](https://img.shields.io/badge/Vite-7-646cff?style=flat-square\u0026logo=vite)\n![PostgreSQL](https://img.shields.io/badge/PostgreSQL-16-336791?style=flat-square\u0026logo=postgresql)\n![Tailwind CSS](https://img.shields.io/badge/Tailwind-3-38bdf8?style=flat-square\u0026logo=tailwindcss)\n\n\u003c/div\u003e\n\n## 📖 About\n\n**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).\n\nUnlike shared folders or wikis, Quorum provides:\n- **Git-like version history** for every query change\n- **Mandatory peer review** before queries go live\n- **Team isolation** with database-level security\n- **Full audit trail** of who changed what and when\n\nPerfect for data teams, analytics engineers, and anyone who needs governance over shared SQL.\n\n## ✨ Key Features\n\n| Feature | Description |\n|---------|-------------|\n| **🔒 Team Isolation** | Multi-tenant architecture with Row-Level Security (RLS). Teams only see their own data. |\n| **📝 Version Control** | Complete change history with diff views and rollback capability. |\n| **✅ Approval Workflows** | Configurable approval quotas per team. Require 1, 2, or more reviewers. |\n| **👥 Peer Review** | Self-approval prevented at the database level. Changes require teammates. |\n| **🔑 Role-Based Access** | Admin and member roles with granular permissions. |\n| **🏠 Self-Hosted Option** | Run on your own infrastructure with Docker. No vendor lock-in. |\n| **☁️ Cloud Ready** | Deploy to Supabase for managed PostgreSQL and authentication. |\n| **📁 Folder Organization** | Hierarchical folders to organize queries by project, team, or domain. |\n\n## 🚀 Quick Start\n\n### Option 1: Guided Setup (Recommended)\n\n```bash\ngit clone https://github.com/montrellcruse/quorum-sql.git\ncd quorum-sql\npnpm install\npnpm dev\n```\n\nVisit **http://localhost:8080/setup** and follow the configuration wizard.\n\n### Option 2: Docker (Self-Hosted)\n\n```bash\ngit clone https://github.com/montrellcruse/quorum-sql.git\ncd quorum-sql\ndocker compose up -d db server\npnpm install \u0026\u0026 pnpm dev\n```\n\nOpen **http://localhost:8080** to access the application.\n\n## 🛠️ Deployment Options\n\n| Mode | Best For | Auth | Database |\n|------|----------|------|----------|\n| **Self-Hosted** | Full control, air-gapped environments | Local accounts | PostgreSQL via Docker |\n| **Supabase Cloud** | Quick start, managed infrastructure | Supabase Auth + Google OAuth | Supabase PostgreSQL |\n\n## 💻 Tech Stack\n\n- **Frontend**: [React 18](https://react.dev/) with [Vite 7](https://vitejs.dev/)\n- **Language**: [TypeScript 5](https://www.typescriptlang.org/)\n- **Styling**: [Tailwind CSS 3](https://tailwindcss.com/) + [shadcn/ui](https://ui.shadcn.com/)\n- **Backend**: [Fastify](https://fastify.dev/) REST API\n- **Database**: [PostgreSQL 16](https://www.postgresql.org/) with Row-Level Security\n- **ORM/Client**: [Supabase JS](https://supabase.com/docs/reference/javascript) or direct REST\n- **Validation**: [Zod 4](https://zod.dev/)\n- **State**: [TanStack Query](https://tanstack.com/query)\n\n## 🏗️ Architecture\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                        Frontend                              │\n│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────────┐  │\n│  │   React     │  │  TanStack   │  │   Tailwind CSS      │  │\n│  │   Router    │  │   Query     │  │   + shadcn/ui       │  │\n│  └─────────────┘  └─────────────┘  └─────────────────────┘  │\n└────────────────────────────┬────────────────────────────────┘\n                             │\n              ┌──────────────┴──────────────┐\n              ▼                             ▼\n┌─────────────────────────┐   ┌─────────────────────────────┐\n│   REST API (Fastify)    │   │   Supabase Client (Cloud)   │\n│   - JWT Auth            │   │   - Supabase Auth           │\n│   - Rate Limiting       │   │   - Google OAuth            │\n│   - CORS                │   │   - Real-time (optional)    │\n└───────────┬─────────────┘   └──────────────┬──────────────┘\n            │                                │\n            └──────────────┬─────────────────┘\n                           ▼\n┌─────────────────────────────────────────────────────────────┐\n│                      PostgreSQL                              │\n│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────────┐  │\n│  │  8 Tables   │  │  37+ RLS    │  │  Security Definer   │  │\n│  │             │  │  Policies   │  │  Functions          │  │\n│  └─────────────┘  └─────────────┘  └─────────────────────┘  │\n└─────────────────────────────────────────────────────────────┘\n```\n\n## 📊 Database Schema\n\n8 tables with comprehensive Row-Level Security:\n\n| Table | Purpose |\n|-------|---------|\n| `profiles` | User information synced with auth |\n| `teams` | Team settings + approval quotas |\n| `team_members` | User-team relationships with roles |\n| `team_invitations` | Pending invitations by email |\n| `folders` | Hierarchical query organization |\n| `sql_queries` | Versioned query storage |\n| `query_history` | Complete change audit trail |\n| `query_approvals` | Approval tracking per version |\n\nSee [supabase/ERD.md](supabase/ERD.md) for the full entity relationship diagram.\n\n## ⚙️ Configuration\n\n### Environment Variables\n\nCopy `.env.example` to `.env` and configure:\n\n```bash\n# Database Provider: 'rest' (self-hosted) or 'supabase' (cloud)\nVITE_DB_PROVIDER=rest\n\n# Self-Hosted Mode\nVITE_API_BASE_URL=http://localhost:8787\nVITE_AUTH_PROVIDERS=local\n\n# OR Supabase Mode\nVITE_SUPABASE_URL=https://your-project.supabase.co\nVITE_SUPABASE_PUBLISHABLE_KEY=your-anon-key\n\n# Common Settings\nVITE_ALLOWED_EMAIL_DOMAIN=@yourcompany.com\nVITE_APP_NAME=Quorum\n```\n\n### Setup Wizard\n\nThe setup wizard at `/setup` guides you through:\n\n1. **Choose Provider** — Self-Hosted or Supabase Cloud\n2. **Configure Settings** — Email domain restrictions, app name\n3. **Generate Config** — Download your `.env` file\n\n## 📈 Observability\n\nFrontend telemetry supports:\n\n- **Sentry** error tracking (`VITE_SENTRY_DSN`, `VITE_SENTRY_ENV`, `VITE_SENTRY_TRACES_SAMPLE_RATE`)\n- **PostHog** product analytics (`VITE_POSTHOG_KEY`, `VITE_POSTHOG_HOST`)\n\n### Error-to-issue automation (Sentry → GitHub)\n\nSentry is initialized in `src/lib/telemetry.ts`, but GitHub issue creation is configured in Sentry, not in this repo.\nFollow the placeholder runbook to enable or document the integration: `runbooks/sentry-github.md`.\n\n## 📜 Scripts\n\n| Command | Description |\n|---------|-------------|\n| `pnpm dev` | Start development server on port 8080 |\n| `pnpm build` | Build for production |\n| `pnpm lint` | Run ESLint |\n| `pnpm preview` | Preview production build |\n| `pnpm test` | Run server unit tests |\n| `pnpm test:e2e` | Run end-to-end tests (Playwright) |\n\n## 🔒 Security\n\nQuorum is built with security as a core principle:\n\n- **37+ RLS Policies** — Database-level access control on all tables\n- **Team Isolation** — Users only see their teams' data\n- **Peer Review Enforcement** — Self-approval prevented at database level\n- **Domain Restriction** — Configurable email domain authentication\n- **Strong Password Policy** — Minimum 8 chars with uppercase, lowercase, number, and special character requirements plus common password blocklist\n- **SQL Injection Protection** — Parameterized queries throughout\n- **XSS Protection** — React's automatic escaping + CSP headers (enforced in both dev and production)\n- **Security Definer Functions** — Controlled privilege elevation with `SET search_path`\n- **Rate Limiting** — Per-route rate limits on all endpoints via `@fastify/rate-limit`\n- **Non-Root Docker** — Container runs as `node` user, not root\n\nSee [SECURITY.md](SECURITY.md) for the complete security policy and audit history.\n\n## 📁 Project Structure\n\n```\n├── src/\n│   ├── components/        # React components\n│   │   ├── setup/         # Setup wizard\n│   │   └── ui/            # shadcn/ui components\n│   ├── contexts/          # Auth \u0026 Team React contexts\n│   ├── pages/             # Route page components\n│   ├── hooks/             # Custom React hooks\n│   └── integrations/      # Supabase client config\n├── server/                # Fastify REST API\n│   ├── src/\n│   │   ├── routes/        # API route handlers\n│   │   └── middleware/    # Auth, rate limiting\n│   └── package.json\n├── supabase/\n│   ├── migrations/        # Squashed baseline migration\n│   ├── schema.sql         # Schema documentation\n│   └── ERD.md             # Entity relationship diagram\n├── docker-compose.yml     # Docker services config\n└── .env.example           # Environment template\n```\n\n## 🤝 Contributing\n\nContributions are welcome! Please follow these steps:\n\n1. **Fork** the repository\n2. **Create** a feature branch (`git checkout -b feature/amazing-feature`)\n3. **Test** your changes (`pnpm lint \u0026\u0026 pnpm build`)\n4. **Commit** with a clear message (`git commit -m 'Add amazing feature'`)\n5. **Push** to your branch (`git push origin feature/amazing-feature`)\n6. **Open** a Pull Request\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.\n\n## 📄 License\n\nThis project is licensed under the MIT License — see [LICENSE](LICENSE) for details.\n\n## 🆘 Support\n\n- **Issues**: [GitHub Issues](https://github.com/montrellcruse/quorum-sql/issues)\n- **Security**: [SECURITY.md](SECURITY.md) for vulnerability reporting\n- **Database Docs**: [supabase/README.md](supabase/README.md)\n\n---\n\n\u003cdiv align=\"center\"\u003e\n  \u003csub\u003eBuilt for teams who care about SQL governance\u003c/sub\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmontrellcruse%2Fquorum-sql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmontrellcruse%2Fquorum-sql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmontrellcruse%2Fquorum-sql/lists"}