Skip to content
Merged
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
16 changes: 16 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Lightning Git local Docker stack. Copy this file to .env and fill it in.
# docker compose reads it; do not wrap values in quotes.

# Supabase project, free tier is enough (Project Settings -> API).
# SUPABASE_API_KEY is the service_role key: the backend is a trusted server and
# needs it to write metadata. SUPABASE_ANON_KEY is the public anon key.
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_API_KEY=your-service-role-key
SUPABASE_ANON_KEY=your-anon-key

# GitHub OAuth app, only needed to add repositories (the backend clones them on
# your behalf). Leave these as placeholders to boot the stack and sign in; set
# real values when you want to watch a repo.
GITHUB_CLIENT_ID=placeholder
GITHUB_CLIENT_SECRET=placeholder
GITHUB_CALLBACK_URL=http://localhost:8080/auth/github/callback
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@
*.log
.idea/
*.swp

# local Docker stack secrets (see .env.example)
/.env
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<p align="center">
<img src="assets/banner.png" alt="lightning-git: catch Git conflicts before they reach a pull request" width="100%">
</p>

# Lightning Git

![alpha](https://img.shields.io/badge/status-alpha-9b2c2c?style=flat-square) ![CI](https://img.shields.io/badge/CI-path--filtered-1a1a1a?style=flat-square) ![tests](https://img.shields.io/badge/tests-passing-2d6a4f?style=flat-square) ![self-hosted](https://img.shields.io/badge/self--hosted-9b2c2c?style=flat-square)
Expand Down Expand Up @@ -76,6 +80,22 @@ The Notbremse (the German term for an emergency brake, kept as a product name) i

Each package keeps its own lockfile and builds on its own. There is no root workspace and no shared `node_modules`. A deploy host points at a single subfolder and never has to understand the rest of the repo, and the VS Code extension is packaged without the dependency-hoisting surprises a shared install would cause. The cost is that the two Node packages install separately; for three pieces that ship to different places, that is the cheaper trade.

## Quickstart with Docker

The backend and the frontend run together with one command. You need Docker and a Supabase project; the free tier is enough, and the backend uses it for accounts and project metadata.

```bash
cp .env.example .env
# put your Supabase URL and keys in .env
docker compose up --build
```

The frontend is then on http://localhost:5173 and the backend on http://localhost:8080.

First-time setup also needs the database schema once: run `backend/src/supabase/table_creation.sql` in your Supabase project's SQL editor. Adding a repository to watch uses GitHub authorization so the backend can clone it read-only. Set the `GITHUB_*` values in `.env` for that; sign-up and sign-in work without them.

This stack runs Lightning Git locally. Production deploys each package from its own subfolder; see [DEPLOYMENT.md](DEPLOYMENT.md).

## Running it locally

Each package has its own README with the real detail. In short:
Expand Down
Binary file added assets/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Local development stack: the backend and the frontend with one command.
# Requires Docker and a Supabase project. Copy .env.example to .env and fill it
# in first. This runs Lightning Git locally; production deploys each package from
# its own subfolder (see DEPLOYMENT.md).
services:
backend:
build: ./backend
env_file: .env
ports:
- "8080:8080"

frontend:
build: ./frontend
environment:
VITE_API_BASE_URL: "http://localhost:8080"
VITE_WS_URL: "ws://localhost:8080"
ports:
- "5173:5173"
depends_on:
- backend
4 changes: 4 additions & 0 deletions frontend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
dist
.env
.env.*
9 changes: 9 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Frontend dev server for the local Docker stack (see ../docker-compose.yml).
# Production builds the static site instead; see ../DEPLOYMENT.md.
FROM node:20-slim
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
EXPOSE 5173
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]
Loading