open-git
open-git is a GitHub-inspired code hosting app with stronger AI workflows, Hexclave for authentication, and a coss/Base UI foundation.
Apps and Packages
apps/web- Next.js App Router application.packages/ui- shared coss/Base UI components and global styles.packages/code-storage- isomorphic-git + S3 SDK package.
Hexclave
The app is wired for Hexclave with:
apps/web/stack.ts- sharedHexclaveServerAppconfiguration.apps/web/app/handler/[...stack]/page.tsx- Hexclave catch-all handler.apps/web/hexclave.config.ts- local development dashboard configuration.apps/web/app/dashboard/page.tsx- example protected server route.apps/web/.env.example- required environment variables.
Copy apps/web/.env.example to apps/web/.env.local for local development.
Hexclave project credentials are injected by pnpm dev:web via the local
dashboard config file, so local .env.local should not contain cloud project
keys.
DATABASE_URL=postgresql://opengit:opengit@localhost:54329/opengit
CODE_STORAGE_BUCKET=opengit-code-storage
CODE_STORAGE_REGION=us-east-1
CODE_STORAGE_S3_ENDPOINT=http://localhost:9000
CODE_STORAGE_ACCESS_KEY_ID=opengit
CODE_STORAGE_SECRET_ACCESS_KEY=opengit_password
GIT_REMOTE_BASE_URL=http://localhost:4321
GIT_GATEWAY_PORT=4321
GIT_GATEWAY_CACHE_ROOT=.git-gateway-cache
OPEN_GIT_INTERNAL_AUTH_URL=http://localhost:3000/api/internal/repository-authorizations
OPEN_GIT_INTERNAL_AUTH_SECRET=replace-with-a-random-secret
Local Hexclave config is source-controlled in apps/web/hexclave.config.ts.
The web dev script starts Hexclave's local development dashboard and injects
the required app credentials:
pnpm dev:web
The local Hexclave dashboard runs at http://127.0.0.1:26700 while the dev
script is active.
Seed local Hexclave plus matching open-git users, orgs, team memberships, repository permissions, repositories, indexing jobs, and sample issues:
pnpm --filter web seed:local-dev
To wipe local app data first and rebuild the full fixture set:
pnpm --filter web reset:local-dev
Default login:
dev@open-git.local / password
Production deployments use Hexclave Cloud through
NEXT_PUBLIC_HEXCLAVE_PROJECT_ID and HEXCLAVE_SECRET_SERVER_KEY; see
deploy/.env.example.
Local Infrastructure
Hexclave owns authentication and session identity. open-git owns product data that needs app-level invariants, starting with unique usernames.
The local development stack uses Postgres and MinIO:
compose.yaml- local Postgres and S3-compatible MinIO for OrbStack/Docker.apps/web/db/schema.ts- schema definitions.apps/web/db/index.ts- shared Drizzle client.apps/web/db/user-profiles.ts- Hexclave user to app profile helper.apps/web/drizzle.config.ts- Drizzle migration config.packages/code-storage- SDK that stores bare Git repositories in S3.
user_profiles.stack_user_id is unique and maps to user.id from Hexclave.
user_profiles.username is also unique, but nullable until the future
onboarding flow lets a signed-in user reserve a username.
The onboarding flow lives at apps/web/app/onboarding. It validates usernames
on the server, writes the unique username to Postgres, then sets
clientReadOnlyMetadata.onboarded in Hexclave after the database write
succeeds.
Start all local infrastructure, then generate and apply migrations from the web app package:
pnpm infra:up
pnpm --filter web db:generate
pnpm --filter web db:migrate
To start over from an empty local Postgres/MinIO state, stop the local
containers and delete their Docker volumes, then bring infra back up, migrate,
and reseed. For app-data-only resets, prefer reset:local-dev; it preserves
Drizzle migration history and refuses non-local environments.
docker compose down -v
pnpm infra:up
pnpm --filter web db:migrate
pnpm --filter web reset:local-dev
Local Postgres runs on localhost:54329 with database, username, and password
all set to opengit.
Local MinIO exposes the S3 API on localhost:9000 and the browser console on
http://localhost:9001. The local bucket is created automatically as
opengit-code-storage; the console login is opengit /
opengit_password.
UI work: Docker infra + Next.js only (hot reload)
For day-to-day UI and app behavior, run Postgres and MinIO in Docker, then run
only the web app so Next loads apps/web/.env.local and Turbopack hot-reloads.
pnpm infra:up
pnpm --filter web db:migrate # after schema changes: db:generate then migrate
pnpm dev:web
Open http://localhost:3000. Do not use root pnpm dev unless you intend
to start every package: the CLI runner expects ~/.opengit/runner.json, and
git-worker / managed-runner need their own env and are not required for
basic browsing and repository CRUD in the UI.
Repository pages read from a Postgres index (branches, file tree, README HTML). Creating or forking a repo indexes synchronously in the web app. After git push through the gateway, run the indexing worker so the UI catches up:
pnpm --filter web indexing-worker
To clone or push over Git from your machine, run the gateway in a second
terminal (it uses the same env pattern as production; point DATABASE_URL and
S3 variables at the same Docker services as in .env.local):
pnpm --filter git-gateway dev
Git HTTP Gateway
The Git gateway exposes normal HTTPS-style Git remotes backed by the same S3 repository storage:
pnpm --filter git-gateway dev
git clone http://localhost:4321/<username>/<repository>.git
Public repositories can be cloned without credentials. Private clones and pushes
use HTTP Basic auth with your username and a Git token generated at
/settings/developer.
Adding components
To add coss components, run the registry command against the shared UI package:
pnpm dlx shadcn@latest add @coss/button -c packages/ui
This will place the shared components in the packages/ui/src/components directory.
Using components
To use the components in your app, import them from the ui package.
import { Button } from "@workspace/ui/components/button";