How magomedcoder/repo works
Repo is a lightweight self-hosted Git hosting service: users manage personal namespaces and nested repository folders, browse and transport Git repositories, and collaborate through issues and pull requests. HTTP handlers route API requests into use cases; SSH and Smart HTTP provide Git transport, while SQLite stores account and collaboration metadata and Git repositories hold versioned content. The web app is the user-facing client. The graph preserves README capabilities, but some subsystem connections are documented or inferred because their source was not excerpted.
Main entry points: handler API handlers · model.go SQLite database · router.go HTTP router · repository_usecase.go Repository management
Components 27
Web client
- Vue application
web/src/App.vue - API client
web/src/api/client.ts - Product views
web/src/views
HTTP API
- HTTP router
internal/delivery/http/router.go - Auth middleware
internal/delivery/http/middleware/auth.go - API handlers
internal/delivery/http/handler
Git hosting
- SSH transport
internal/delivery/ssh/server.go - Git repository engine
internal/infrastructure/git/repository.go - Git browsing
internal/infrastructure/git/browse.go - Merge operations
internal/infrastructure/git/merge.go
Application services
- Authentication
internal/usecase/auth_usecase.go - Repository management
internal/usecase/repository_usecase.go - Folder management
internal/usecase/folder_usecase.go - Issues
internal/usecase/issue_usecase.go - Pull requests
internal/usecase/pull_request_usecase.go - Git operations
internal/usecase/git_usecase.go - Organizations
internal/usecase/organization_usecase.go - Profiles
internal/usecase/profile_usecase.go - Access tokens
internal/usecase/token_usecase.go - SSH keys
internal/usecase/ssh_key_usecase.go
Persistence
- SQLite database
internal/infrastructure/persistence/sqlite/model.go - Repository store
internal/infrastructure/persistence/sqlite/repository.go - Issue store
internal/infrastructure/persistence/sqlite/issue.go - Pull request store
internal/infrastructure/persistence/sqlite/pull_request.go
Other components
- User
- Browser
- Git client
Connections 31
- User → Vue application: uses
README.md - Vue application → Product views: renders
- Product views → API client: requests
- API client → HTTP router: calls API
- HTTP router → API handlers: routes
internal/delivery/http/router.go - HTTP router → Auth middleware: protects routes
internal/delivery/http/router.go - API handlers → Authentication: invokes
internal/delivery/http/handler/auth.go - API handlers → Repository management: invokes
internal/delivery/http/handler/repository.go - API handlers → Issues: invokes
internal/delivery/http/handler/issue.go - API handlers → Pull requests: invokes
- API handlers → Folder management: invokes
- API handlers → Organizations: invokes
- API handlers → Profiles: invokes
- API handlers → Access tokens: invokes
- API handlers → SSH keys: invokes
- Auth middleware → Authentication: authenticates
internal/delivery/http/middleware/auth.go - Repository management → Git repository engine: initializes
internal/usecase/repository_usecase.go - Repository management → Repository store: persists metadata
- Folder management → SQLite database: stores folders
- Issues → Issue store: stores issues
- Pull requests → Pull request store: stores requests
- Authentication → SQLite database: stores accounts
- Git client → SSH transport: Git over SSH
README.md - SSH transport → Git operations: serves Git
internal/delivery/ssh/server.go - Git operations → Git repository engine: runs Git transport
- Git client → HTTP router: Smart HTTP
- Git operations → Git browsing: browses content
- Pull requests → Merge operations: merges changes
- Repository store → SQLite database: reads and writes
internal/infrastructure/persistence/sqlite/repository.go - Issue store → SQLite database: reads and writes
- Pull request store → SQLite database: reads and writes