How patrikbures/gamesync works
Gamesync is a game-save synchronization CLI backed by a server. The intended user workflow is to configure the client, create or select a repository and branch, then sync local save files through the server; the server organizes snapshots and deduplicated chunks. The tree also shows administration for users, roles, and permissions. The README warns that the main branch is undergoing a rewrite, and the available excerpts do not show the sync implementation or most service wiring, so uncertain internal calls are omitted.
Main entry points: oas_handlers_gen.go HTTP handlers · db.go PostgreSQL state · syncer.go Sync engine · api_chunks.go Chunk API
Components 20
Client workflow
- CLI entry
cmd/gamesync/root.go - Sync commands
internal/client/cmd/sync/sync.go - Sync engine
internal/client/syncer/syncer.go - Local file scan
internal/client/util/all_files.go - Generated API client
internal/ogen/oas_client_gen.go
Server API
- Gamesync server
cmd/gamesync-server/serve.go - HTTP router
internal/ogen/oas_router_gen.go - HTTP handlers
internal/ogen/oas_handlers_gen.go - Repo and branch API
internal/server/service/api_repos.go - Snapshot API
internal/server/service/api_snapshots.go - Chunk API
internal/server/service/api_chunks.go - Identity and roles
internal/server/service/api_users.go
State and access
- Authentication
internal/server/middleware/authz.go - Permission rules
internal/server/permissions/permissions.go - PostgreSQL state
internal/server/dbm/db.go - Chunk storage
internal/server/storage/storage.go
Other components
- Game-save user
- Save files
- PostgreSQL
- Storage backend
Connections 22
- Game-save user → CLI entry: runs
- CLI entry → Sync commands: dispatches
- Sync commands → Sync engine: invokes
- Sync engine → Local file scan: scans saves
- Local file scan → Save files: reads files
- Sync engine → Generated API client: uses API
- Generated API client → Gamesync server: HTTP requests
- Gamesync server → HTTP router: serves HTTP
- HTTP router → HTTP handlers: dispatches
- HTTP handlers → Repo and branch API: handles repo calls
- HTTP handlers → Snapshot API: handles snapshot calls
- HTTP handlers → Chunk API: handles chunk calls
- HTTP handlers → Identity and roles: handles identity calls
- HTTP handlers → Authentication: middleware
- Authentication → Permission rules: checks access
- Repo and branch API → PostgreSQL state: state access
- Snapshot API → PostgreSQL state: state access
- Chunk API → PostgreSQL state: metadata access
- Chunk API → Chunk storage: stores chunks
- Identity and roles → PostgreSQL state: state access
- PostgreSQL state → PostgreSQL: reads and writes
- Chunk storage → Storage backend: stores data