Skip to content
This repository was archived by the owner on Oct 9, 2026. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .context/dofs
Submodule dofs deleted from a4b1d1
1 change: 0 additions & 1 deletion .context/isomorphic-git
Submodule isomorphic-git deleted from 93d3ef
39 changes: 34 additions & 5 deletions .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- reopened
- synchronize
- closed
- ready_for_review
concurrency:
group: pr-preview-${{ github.event.pull_request.number }}
cancel-in-progress: false
Expand All @@ -25,18 +26,14 @@ env:
# App Secrets
BETTER_AUTH_SECRET: ${{ secrets.BETTER_AUTH_SECRET }}
jobs:
deploy-preview:
ci:
if: ${{ github.event.action != 'closed' }}
runs-on: ubuntu-latest
# Requires approval for external contributors (configured in repo Settings → Environments)
environment: preview
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
# Checkout the PR head commit (safe after environment approval)
ref: ${{ github.event.pull_request.head.sha }}
- &a1
name: Setup pnpm
Expand All @@ -49,10 +46,42 @@ jobs:
with:
node-version: "24"
cache: pnpm
- &a4
name: Cache turbo
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- &a3
name: Install dependencies
shell: bash
run: pnpm install
- name: Lint
run: pnpm check
- name: Typecheck
run: pnpm typecheck
- name: Test
run: pnpm test
deploy-preview:
needs: [ci]
if: ${{ github.event.action != 'closed' && !github.event.pull_request.draft }}
runs-on: ubuntu-latest
# Requires approval for external contributors (configured in repo Settings → Environments)
environment: preview
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
# Checkout the PR head commit (safe after environment approval)
ref: ${{ github.event.pull_request.head.sha }}
- *a1
- *a2
- *a4
- *a3
- name: Deploy Preview
run: pnpm --filter ./apps/web run deploy
cleanup-preview:
Expand Down
6 changes: 0 additions & 6 deletions .gitmodules

This file was deleted.

30 changes: 17 additions & 13 deletions .zed/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
"format_on_save": "on",
"languages": {
"JavaScript": {
"language_servers": [
"!eslint",
"!typescript-language-server",
"..."
],
"formatter": {
"language_server": {
"name": "biome"
Expand All @@ -27,17 +32,11 @@
}
},
"TypeScript": {
"formatter": {
"language_server": {
"name": "biome"
}
},
"code_actions_on_format": {
"source.fixAll.biome": true,
"source.organizeImports.biome": true
}
},
"JSX": {
"language_servers": [
"!eslint",
"!typescript-language-server",
"..."
],
"formatter": {
"language_server": {
"name": "biome"
Expand All @@ -49,6 +48,11 @@
}
},
"TSX": {
"language_servers": [
"!eslint",
"!typescript-language-server",
"..."
],
"formatter": {
"language_server": {
"name": "biome"
Expand All @@ -61,14 +65,14 @@
}
},
"lsp": {
"typescript-language-server": {
"vtsls": {
"settings": {
"typescript": {
"preferences": {
"includePackageJsonAutoImports": "on"
}
}
}
}
},
}
}
4 changes: 1 addition & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ Gitflare is a selfhosted GitHub alternative which can be hosted on serverless pl

- Never run `dev` or `build` commands, unless explicitly instructed.
- After making code changes, always run the linter with `pnpm check:fix` to ensure code quality and adherence to guidelines.
- Always fetch latest docs for the library or tool you are working with.
- For shadcn/ui components, refer to https://ui.shadcn.com/llms.txt for full docs list. You can add `.md` after any docs page URL to get the markdown version. ALWAYS prefer markdown docs. ONLY use `pnpm` to install new components.
- For other libraries or tools, use context7 mcp server to fetch latest docs.
- Do not create useless comments that simply describe what the code already says. Comments are for adding context around the code when that context is not immediately obvious.

## Build/Lint/Test Commands

Expand Down
12 changes: 12 additions & 0 deletions apps/web/alchemy.run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import alchemy from "alchemy";
import {
D1Database,
DurableObjectNamespace,
R2Bucket,
TanStackStart,
Worker,
} from "alchemy/cloudflare";
Expand All @@ -22,6 +23,15 @@ const repoDO = DurableObjectNamespace("repos", {
sqlite: true,
});

const hybridRepoDO = DurableObjectNamespace("hybrid-repos", {
className: "HybridRepo",
sqlite: true,
});

const bucket = await R2Bucket("gitflare-bucket", {
name: "gitflare-bucket",
});

const db = await D1Database("gitflare-db", {
name: "gitflare-db",
migrationsDir: "./migrations",
Expand All @@ -43,6 +53,8 @@ function getCurrentUrl() {
export const web = await TanStackStart("web", {
bindings: {
REPO: repoDO,
HYBRID_REPO: hybridRepoDO,
BUCKET: bucket,
DB: db,
LOG_LEVEL: isProd ? "warn" : "debug",
SITE_URL: getCurrentUrl(),
Expand Down
8 changes: 8 additions & 0 deletions apps/web/drizzle-do.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { defineConfig } from "drizzle-kit";

export default defineConfig({
schema: "./src/do/schema/git.ts",
out: "./drizzle-do",
dialect: "sqlite",
driver: "durable-sqlite",
});
26 changes: 26 additions & 0 deletions apps/web/drizzle-do/0000_opposite_mattie_franklin.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
CREATE TABLE `git_object_index` (
`oid` text PRIMARY KEY NOT NULL,
`pack_id` text NOT NULL,
`pack_offset` integer NOT NULL,
`compressed_size` integer NOT NULL,
`type` text NOT NULL,
`is_delta` integer DEFAULT false NOT NULL,
`base_oid` text,
FOREIGN KEY (`pack_id`) REFERENCES `git_packs`(`pack_id`) ON UPDATE no action ON DELETE restrict
);
--> statement-breakpoint
CREATE INDEX `idx_object_pack` ON `git_object_index` (`pack_id`);--> statement-breakpoint
CREATE TABLE `git_packs` (
`pack_id` text PRIMARY KEY NOT NULL,
`r2_key` text NOT NULL,
`object_count` integer,
`size_bytes` integer,
`created_at` integer NOT NULL
);
--> statement-breakpoint
CREATE TABLE `git_refs` (
`name` text PRIMARY KEY NOT NULL,
`value` text NOT NULL,
`is_symbolic` integer DEFAULT false NOT NULL,
`updated_at` integer NOT NULL
);
Loading
Loading