Refactor codebase for Phase 3

This commit is contained in:
2026-06-08 13:34:53 -05:00
parent 6320f51295
commit c32e08be38
32 changed files with 4718 additions and 3323 deletions
+64
View File
@@ -0,0 +1,64 @@
# Gitocean
Gitocean is a small Go-based Git hosting platform for personal use. It provides a CLI, JSON HTTP API, MySQL metadata storage, and HTTP Smart Git transport. There is no web UI and no SSH transport.
## Quickstart
```bash
go run ./cmd/gitocean init
go run ./cmd/gitocean server --config storage/config.json
```
In another shell:
```bash
go run ./cmd/gitocean register
go run ./cmd/gitocean login
go run ./cmd/gitocean repo create demo --public
go run ./cmd/gitocean clone USER/demo
```
## Storage
Bare repositories are stored under:
```text
storage/repos/{owner}/{repo}.git
```
Server config defaults to:
```text
storage/config.json
```
CLI auth config defaults to:
```text
~/.config/gitocean/config.json
```
## Development
Run checks with:
```bash
gofmt -w .
go test ./...
go vet ./...
```
## Code layout
```text
cmd/gitocean/ thin executable entrypoint
internal/app/ application command dispatch and domain handlers
internal/model/ shared data models
internal/config/ client/server config helpers
internal/dbutil/ MySQL connection helpers
internal/gitutil/ reusable Git command helpers
internal/httputil/ JSON HTTP helpers
internal/backup/ backup/restore helpers
internal/validate/ name and branch validators
plans/ phase plans
```