@ -12,7 +12,7 @@ The service boots from `main.go`, and all Go packages live under `src`. Use `src
-`make deploy e=<alias>`– pushes a build using the target defined in `build/deploy.sh`.
## Coding Style & Naming Conventions
Run `make fmt` to apply gofumpt, gci, and goimports; Go’s formatter enforces tab indentation and canonical spacing. Follow idiomatic naming—PascalCase for exported symbols, camelCase for internals, lowercase filenames—and keep package paths under `quantex.com/skeleton/<module>`. Group imports as standard library, third-party, then `quantex.com`, and avoid formatting-only commits.
Run `make fmt` to apply gofumpt, gci, and goimports; Go’s formatter enforces tab indentation and canonical spacing. Follow idiomatic naming—PascalCase for exported symbols, camelCase for internals, lowercase filenames—and keep package paths under `quantex.com/qfixpt/<module>`. Group imports as standard library, third-party, then `quantex.com`, and avoid formatting-only commits.
## Testing Guidelines
Keep `*_test.go` files beside the code and prefer table-driven cases. Guard integration tests with `QUANTEX_ENVIRONMENT` so they hit the intended backend, and regenerate Swagger with `make swag` whenever REST contracts change. Spot-check concurrency with `go test -race ./src/<package>` and store fixtures under package-level `testdata/` directories.
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Project Overview
This is a Go microservice skeleton/template for Quantex projects. It implements a **Hexagonal Architecture** (Ports & Adapters) pattern with clear separation between domain logic, application orchestration, and infrastructure concerns. The skeleton supports multiple execution modes (REST API service, MQTT async messaging, external API integration examples) through a runner-based system.
## Development Commands
### Building and Running
```bash
# Run the REST API service (text logs)
QUANTEX_ENVIRONMENT="dev" go run main.go -c -run service
# Run the REST API service (JSON logs)
QUANTEX_ENVIRONMENT="dev" go run main.go -run service
# Run with debug mode and specific log format
QUANTEX_ENVIRONMENT="dev" go run main.go -d -f tint1 -run service
# Build for current platform
make build
# Build for Linux (production)
make linux-build
```
### Available Runners
The application supports multiple execution modes via the `-run` flag:
-`service` - Main REST API server (Gin framework)
-`async` - MQTT messaging example
-`external` - QApix external API integration example
-`tracerr` - Error handling demonstration
-`logger` - Logging format demonstration
### Log Formats
Use `-f` or `-logs-format` flag:
-`json` - Structured JSON logs (default, for production)
-`text` - Plain text logs
-`tint1` - Single-line colored logs (best for local development)
-`tint2` - Two-line colored logs
### Testing and Linting
```bash
# Run all tests
make test
# Run tests for specific package
go test ./src/client/api/rest/...
# Run single test
go test ./src/... -run TestFunctionName
# Run checks and linters
make check
# Format code (gofumpt, gci, goimports)
make fmt
# Full CI pipeline (format, tidy, checks)
make ci
# Regenerate Swagger docs
make swag
# Run development workflow (checklist + check)
make dev
```
### Branch Management
```bash
# Create new branch with naming convention
make branch t=feature u=jdoe n=39m="add new endpoint"
src/domain/ (Domain layer - business logic & contracts)
↓
src/common/ (Cross-cutting concerns)
```
### Directory Organization
- **`src/domain/`** - Core business models and interfaces (Asyncer, Notifier, UserDataProvider). Pure domain logic with no dependencies on infrastructure.
- **`src/app/`** - Application-level configuration structures, version information, and global settings. Bridges domain and infrastructure.
- **`src/client/`** - All infrastructure implementations:
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.