A high-performance, extremely lightweight Git service built with Zig and SvelteKit.
- Create and manage Git repositories
- Web-based repository browsing
- Branch management (create, delete)
- Pull request workflow (create, update, close, merge, delete source branch)
- CI/CD pipeline integration
- Optimized for performance and minimal resource usage
git.station/
├── backend/ # Zig backend
├── frontend/ # SvelteKit frontend
└── scripts/ # Helper scripts
- Zig (0.14.0 or later)
- Node.js (18 or later)
- libgit2 development libraries
- SQLite3 development libraries
cd backend
zig build
zig build run
# zig build && zig build runcd frontend
npm install
npm run devGET /api/repo/{repo_name}- Get repository detailsGET /api/repo/{repo_name}/branches- List branches in repository
POST /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 request
Git 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 message
Run all tests in Docker (requires Docker and docker-compose):
sh run-tests.shRun only Git tests locally:
sh run-tests.sh --git --localRun database tests locally:
sh run-tests.sh --db --localTests are automatically run on every push to the master branch and on all pull requests through GitHub Actions. The workflow:
- Builds the Docker container for testing
- Runs the complete test suite
- Reports the results directly in the GitHub interface
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.shFor local testing, you need:
- Zig compiler (0.14.0 or later)
- libgit2 development libraries
- SQLite3 development libraries
On macOS, you can install these with Homebrew:
brew install zig libgit2 sqlite3On Linux (Debian/Ubuntu):
apt-get install zig libgit2-dev libsqlite3-devFor Docker-based testing, you need:
- Docker
- docker-compose
The Docker setup handles all dependencies automatically.
The test suite is organized into several modules:
- Unit Tests: Basic functionality tests for individual components
- Git Tests: Tests for repository creation, cloning, and management
- Database Tests: Tests for data persistence and retrieval
- Authentication Tests: Tests for user authentication and authorization
Each test module can be run independently or as part of the complete test suite.
- The backend server will be available at http://localhost:8080
- The frontend development server will be available at http://localhost:5173
MIT