A modern self-hosted Git platform for teams that want speed, control, and clean workflows.
OpenCodeHub combines Git hosting, pull requests, issues, wiki, merge queue, automation, and a stack-first CLI in one deployable system.
Most teams eventually hit the same pain points:
- PRs are too large to review quickly
- Tooling is split across many services
- Data residency and security requirements are hard to satisfy in SaaS-only setups
OpenCodeHub is built for that reality: self-hosted by default, with workflows optimized for fast review cycles and scalable team collaboration.
These are not roadmap claims; they are implemented modules and routes in this repository.
- Git hosting over HTTP and SSH (
src/pages/git/*,src/lib/ssh.ts,src/lib/git-server.ts) - Pull requests with comments, reviews, drafts, approvals (
src/pages/[owner]/[repo]/pulls/*) - Issues, labels, milestones, and project boards (
src/pages/[owner]/[repo]/issues/*,src/pages/[owner]/[repo]/milestones/*,src/pages/[owner]/[repo]/projects/*) - Repository wiki and revision history (
src/pages/[owner]/[repo]/wiki/*) - Organizations, collaborators, repository settings, branch protection
- Stacked PR workflows in web + CLI (
src/lib/stacks.ts,cli/src/commands/stack/index.ts) - Merge queue and conflict handling (
src/lib/merge-queue.ts,src/pages/[owner]/[repo]/merge-queue.astro) - GitHub Actions-style pipeline engine + runner endpoints (
src/lib/pipeline.ts,src/pages/api/actions/*,src/runner/*) - Webhooks and automation rules (
src/pages/api/repos/[owner]/[repo]/webhooks/*,src/lib/automations.ts)
- Rate limiting middleware (
src/middleware/rate-limit.ts,src/middleware.ts) - CSRF utilities (
src/middleware/csrf.ts) - Input validation layer (
src/lib/validation.ts) - MFA (TOTP), OAuth/OIDC, token management, audit surfaces (
src/pages/api/user/settings/2fa.ts,src/lib/oidc.ts,src/pages/admin/audit.astro)
- REST API routes: 140+ files under
src/pages/api/ - GraphQL endpoint (
src/pages/api/graphql.ts) - OpenAPI JSON endpoint (
src/pages/api/openapi.json.ts) - CLI with 20+ command groups under
cli/src/commands/
- Database adapter factory with multiple drivers (
src/db/adapter/index.ts) - Pluggable storage backends (
src/lib/storage.ts)
OpenCodeHub is a modular monolith: one main app, optional worker/runner processes, pluggable persistence, and Git protocol handling integrated into the platform.
Node.js >= 20npmgitbun(recommended; used by helper scripts like admin seeding)
git clone https://github.com/swadhinbiswas/OpencodeHub.git
cd OpenCodeHub
npm installcp .env.example .envFor local development, SQLite defaults in .env.example are enough to start.
npm run db:pushbun run scripts/seed-admin.tsnpm run devApp URL: http://localhost:3000
cp .env.example .env
docker-compose up -dDefault Docker app URL: http://localhost:4321
Optional admin user creation:
docker-compose exec app bun run scripts/seed-admin.tsBefore production deployment, set strong values for at least:
JWT_SECRETSESSION_SECRETINTERNAL_HOOK_SECRETCRON_SECRETRUNNER_SECRETAI_CONFIG_ENCRYPTION_KEYSITE_URL(HTTPS)
Useful references:
DEPLOYMENT.mddocs/administration/deployment.mddocs/administration/security.md
# App lifecycle
npm run dev
npm run build
npm run preview
# Code quality and tests
npm run lint
npm run typecheck
npm run test
npm run test:coverage
# Database
npm run db:generate
npm run db:migrate
npm run db:push
npm run db:studio
# Optional background processes
npm run worker:start
npm run runner:start
npm run git:startThe companion CLI is published as opencodehub-cli and implemented in cli/.
Install and test:
npm install -g opencodehub-cli
och --helpTypical flow:
och auth login --url http://localhost:3000
och init --url http://localhost:3000
och stack create feature/auth-step-1
och stack submit
och queue list- Platform docs:
docs/ - Docs site source:
docs-site/ - API docs entry:
docs/api/rest-api.md - CLI reference:
docs/reference/cli-commands.md - Contribution guide:
CONTRIBUTING.md
OpenCodeHub is active and evolving. Core collaboration features are functional, while some advanced areas are still being expanded.
Tracking documents:
doc/feature_audit.mddoc/missing_implementation_tracker.mdgithub-issues-checklist.md
Contributions are welcome.
- Fork the repository
- Create a branch
- Run lint/tests
- Open a pull request
See CONTRIBUTING.md for development workflow and standards.
MIT. See LICENSE.