A high-performance, extremely lightweight Git service built with Zig and SvelteKit.
git.station/
├── backend/ # Zig backend
├── frontend/ # SvelteKit frontend
└── scripts/ # Helper scripts
cd backend
zig build
zig build run
# zig build && zig build run
cd frontend
npm install
npm run dev
GET /api/repo/{repo_name}
- Get repository detailsGET /api/repo/{repo_name}/branches
- List branches in repositoryPOST /api/repo/{repo_name}/branches
- Create a new branchDELETE /api/repo/{repo_name}/branch
- Delete a branch{ "branch": "branch-name-to-delete" }
GET /api/repo/{repo_name}/pulls
- List pull requests for a repositoryGET /api/repo/{repo_name}/pulls/{id}
- Get a specific pull requestPOST /api/repo/{repo_name}/pulls
- Create a new pull request{
"title": "Pull request title",
"body": "Description of changes",
"source_branch": "feature-branch",
"target_branch": "main"
}
PATCH /api/repo/{repo_name}/pulls/{id}
- Update a pull request{
"title": "Updated title",
"body": "Updated description",
"state": "open"
}
PUT /api/repo/{repo_name}/pulls/{id}/merge
- Merge a pull requestPUT /api/repo/{repo_name}/pulls/{id}/close
- Close a pull requestPUT /api/repo/{repo_name}/pulls/{id}/delete-branch
- Delete the source branch of a pull requestGit Station includes a comprehensive test suite for the backend components. Tests can be run either locally or in Docker.
The run-tests.sh
script in the backend
directory provides various options for running tests:
cd backend
sh run-tests.sh [options]
--all
: Run all tests (default)--git
: Run only Git-related tests--db
: Run only database tests--auth
: Run only authentication tests--unit
: Run only unit tests--local
: Run tests locally instead of in Docker--help
: Show help messageRun all tests in Docker (requires Docker and docker-compose):
sh run-tests.sh
Run only Git tests locally:
sh run-tests.sh --git --local
Run database tests locally:
sh run-tests.sh --db --local
Tests are automatically run on every push to the master
branch and on all pull requests through GitHub Actions. The workflow:
You can view test results in the "Actions" tab of the repository.
To run the same CI tests locally before pushing:
cd backend
./run-tests.sh
For local testing, you need:
On macOS, you can install these with Homebrew:
brew install zig libgit2 sqlite3
On Linux (Debian/Ubuntu):
apt-get install zig libgit2-dev libsqlite3-dev
For Docker-based testing, you need:
The Docker setup handles all dependencies automatically.
The test suite is organized into several modules:
Each test module can be run independently or as part of the complete test suite.
MIT