|
|
||
|---|---|---|
| cmd/server | ||
| scripts | ||
| .gitignore | ||
| AGENTS.md | ||
| README.md | ||
| go.mod | ||
README.md
Verstak Sync Server
Standalone sync server for Verstak2 platform.
Overview
This server provides synchronization between devices running Verstak2. It handles:
- Device registration and authentication
- Operational transform-based sync
- Blob storage for attachments
- User management with email confirmation
Quick Start
# Build
go build -o verstak-sync-server ./cmd/server
# Run
./verstak-sync-server -port 47732 -data ./server-data
# First run with admin user
./verstak-sync-server -admin-user admin -admin-pass secret
Configuration
| Flag | Default | Description |
|---|---|---|
-port |
47732 | HTTP port |
-data |
./server-data | Data directory |
-admin-user |
Create admin user (first run) | |
-admin-pass |
Admin password (first run) |
Architecture
cmd/server/ - Entry point
internal/server/ - Server implementation
- server.go - Core server logic
- handlers.go - HTTP handlers
- schema.go - Database schema
API Endpoints
POST /api/push- Push operations to serverGET /api/pull- Pull operations from serverPOST /api/device/pair- Pair device with tokenPOST /api/user/register- Register new userPOST /api/user/login- User login
Development
# Run tests
go test ./...
# Build for production
CGO_ENABLED=1 go build -o verstak-sync-server ./cmd/server
License
MIT