ClawReef Backend
ClawReef virtual desktop management platform backend API.
Tech Stack
- Golang 1.21+
- Gin 1.9+
- upper/db 4.x
- MySQL 8.0+
- JWT Authentication
Quick Start
Prerequisites
- Go 1.21 or higher
- MySQL 8.0+
- Docker (optional)
Development Setup
-
Install dependencies
make deps -
Start MySQL with Docker
make docker-up -
Run database migration
make migrate -
Start the server
make run
API Endpoints
Server runs on port 9001.
Authentication
POST /api/v1/auth/register- User registrationPOST /api/v1/auth/login- User loginPOST /api/v1/auth/refresh- Refresh tokenPOST /api/v1/auth/logout- User logoutGET /api/v1/auth/me- Get current user
Default Admin Account
- Username:
admin - Password:
admin123
Project Structure
backend/
├── cmd/server/ # Application entry point
├── internal/
│ ├── config/ # Configuration
│ ├── db/ # Database connection & migrations
│ ├── models/ # Data models
│ ├── repository/ # Data access layer
│ ├── services/ # Business logic
│ ├── handlers/ # HTTP handlers
│ ├── middleware/ # HTTP middleware
│ └── utils/ # Utilities
├── deployments/ # Docker & K8s configs
└── configs/ # Configuration files
Make Commands
make build- Build the binarymake run- Run the servermake test- Run testsmake fmt- Format codemake lint- Run lintermake docker-up- Start MySQL containermake migrate- Run database migrations