Thanks to visit codestin.com
Credit goes to github.com

Skip to content

niczy/gitslice

Repository files navigation

Gitslice

Gitslice is a distributed version control system that enables efficient, conflict-free collaboration on large codebases through slice-based workflows.

Project Structure

.
├── proto/                  # Protocol Buffer definitions and generated code
│   ├── slice/             # Slice service proto files
│   │   ├── slice_service.proto
│   │   ├── slice_service.pb.go
│   │   └── slice_service_grpc.pb.go
│   └── admin/             # Admin service proto files
│       ├── admin_service.proto
│       ├── admin_service.pb.go
│       └── admin_service_grpc.pb.go
├── slice_service/         # Slice service server implementation
│   └── main.go
├── admin_service/         # Admin service server implementation
│   └── main.go
├── gs_cli/               # CLI client implementation
│   └── main.go
├── spec/                 # Design specifications
│   ├── PRODUCT_VISION.md
│   ├── DATA_MODEL.md
│   ├── ALGORITHMS.md
│   ├── CLI_DESIGN.md
│   ├── API_DESIGN.md
│   └── ARCHITECTURE.md
└── .github/workflows/    # CI/CD workflows
    └── build.yml

Getting Started

Prerequisites

  • Go 1.21 or higher
  • Protocol Buffers compiler (protoc)
  • protoc-gen-go
  • protoc-gen-go-grpc

Install Dependencies

go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/[email protected]

Generate Proto Code

cd proto/slice
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative slice_service.proto

cd ../admin
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative admin_service.proto

Build

# Build slice service
go build -o slice_service_server ./slice_service/

# Build admin service
go build -o admin_service_server ./admin_service/

# Build CLI
go build -o gs_cli ./gs_cli/

Run

# Run slice service (listens on :50051)
./slice_service_server

# Run admin service (listens on :50052)
./admin_service_server

# Run CLI
./gs_cli --help

Development

Adding New Proto Definitions

  1. Add or modify .proto files in proto/slice/ or proto/admin/
  2. Regenerate the golang code using protoc
  3. Update the service implementations as needed
  4. Run tests and ensure builds pass

Running Tests

# Run all tests
go test ./...

# Run specific package tests
go test ./slice_service/
go test ./admin_service/
go test ./gs_cli/

CI/CD

GitHub Actions workflow is configured to:

  • Install Go and dependencies
  • Generate proto code
  • Build all services
  • Test server startup
  • Test CLI help command

See .github/workflows/build.yml for details.

SSL Certificates for NGINX

Generate a self-signed certificate and key for agenttools.dev and api.agenttools.dev with:

sudo mkdir -p /etc/ssl/private /etc/ssl/certs
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
  -keyout /etc/ssl/private/agenttools.dev.key \
  -out /etc/ssl/certs/agenttools.dev.crt \
  -subj "/CN=agenttools.dev" \
  -addext "subjectAltName=DNS:agenttools.dev,DNS:api.agenttools.dev"

Documentation

See the spec/ directory for detailed design specifications:

License

[Add your license here]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published