git.station Svelte Themes

Git.station

High-performance, extremely lightweight Git service built with Zig and SvelteKit

Git station

A high-performance, extremely lightweight Git service built with Zig and SvelteKit.

Features

  • Create and manage Git repositories
  • Web-based repository browsing
  • CI/CD pipeline integration
  • Optimized for performance and minimal resource usage

Project Structure

git.station/
├── backend/     # Zig backend
├── frontend/    # SvelteKit frontend
└── scripts/     # Helper scripts

Getting Started

Prerequisites

Backend Setup

cd backend
zig build
zig build run
# zig build && zig build run

Frontend Setup

cd frontend
npm install
npm run dev

Testing

Git Station includes a comprehensive test suite for the backend components. Tests can be run either locally or in Docker.

Running Tests

The run-tests.sh script in the backend directory provides various options for running tests:

cd backend
sh run-tests.sh [options]

Test 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

Examples

Run 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

Continuous Integration

Tests are automatically run on every push to the master branch and on all pull requests through GitHub Actions. The workflow:

  1. Builds the Docker container for testing
  2. Runs the complete test suite
  3. 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.sh

Testing Environment Requirements

Local Testing

For 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 sqlite3

On Linux (Debian/Ubuntu):

apt-get install zig libgit2-dev libsqlite3-dev

Docker Testing

For Docker-based testing, you need:

  • Docker
  • docker-compose

The Docker setup handles all dependencies automatically.

Test Architecture

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.

Development

Screenshot 2025-03-07 at 03 14 42

License

MIT

Top categories

svelte logo

Need a Svelte website built?

Hire a professional Svelte developer today.
Loading Svelte Themes