navigation_

© 2026 Swadhin Biswas

~/projects / opencodehub-—-self-hosted-git-platform

OpencodeHub — Self-Hosted Git Platform

OpencodeHub is a fully self-hosted Git platform built to provide a secure, scalable, and customizable code collaboration environment—similar to GitHub/GitLab, but fully under your control. It supports SSH/HTTP Git workflows, pull requests, AI-assisted reviews, CI/CD integrations, and advanced developer productivity features like stacked PRs.

ai open-source opencode free self-hosted git github gitlab alternatives
OpencodeHub — Self-Hosted Git Platform

🔧 OpencodeHub — Self-Hosted Git Platform (Full-Stack Project)

OpencodeHub is a self-hosted Git collaboration platform designed to give teams full control over their source code infrastructure while delivering modern developer-experience features such as pull requests, stacked PRs, AI-assisted code reviews, CI/CD integrations, and rich analytics.

This project focuses heavily on backend system design, scalability, and developer tooling, with an interactive architecture visualization built using React Flow.


🌟 Key Features

  • 🔐 Secure Authentication & Authorization

    • JWT-based authentication
    • Role-Based Access Control (RBAC)
    • Rate limiting & secure API design
  • 🤖 AI-Assisted Code Review

    • Automatic pull-request analysis
    • Suggestions for code quality, best practices, and security
  • 🚀 CI/CD Integration

    • GitHub-Actions-style workflows
    • Support for self-hosted runners
  • 📦 Stacked Pull Requests

    • Break large features into smaller, dependent PRs
    • Faster reviews and cleaner merge history
  • 📊 Developer Metrics

    • PR lifecycle tracking
    • CI success rate
    • Review turnaround time
  • 🛠️ CLI Tooling

    • Submit and manage stacked PRs
    • View CI and review status from the terminal

🏗️ Backend Architecture (React Flow Design)

The backend system is modeled as an interactive flow diagram using React Flow, making the architecture easy to understand, extend, and maintain.

🔁 System Flow Representation

Flow Diagram

🧩 Architecture Breakdown

Client (Web UI / CLI)

  • Frontend built with Astro + React
  • CLI enables Git-native workflows and stacked PR management

API Gateway (tRPC)

  • Type-safe communication between frontend, CLI, and backend
  • Central request validation and routing layer

Authentication & RBAC

  • Handles user identity, permissions, and access policies
  • Enforces secure repository and pull request access

Repository & Pull Request Engine

  • Core Git operations (repositories, branches, merges)
  • Stacked PR logic and review orchestration
  • Webhooks and event-driven triggers

AI Review & CI/CD Service

  • Integrates with external AI providers for automated code analysis
  • Triggers CI pipelines and collects execution results

Database Layer (Drizzle ORM)

  • Stores:
    • Users & roles
    • Repository metadata
    • Pull requests & review history
    • Metrics & audit logs
  • Supports PostgreSQL, MySQL, and SQLite

Storage Layer

  • Stores artifacts, backups, and large objects
  • Pluggable drivers for local and cloud storage solutions

🧠 Tech Stack

  • Backend: Node.js, tRPC, Drizzle ORM
  • Frontend: Astro, React
  • Architecture Visualization: React Flow
  • Authentication: JWT, RBAC
  • Storage: Local, S3, MinIO
  • DevOps: Docker, Self-Hosted CI Runners
  • AI: OpenAI / Anthropic (optional)

Thanks for the Star!

If you appreciate my work, consider supporting me.

No support options configured yet.