2dd0501687
Build & Test (NowChessSystems) TeamCity build failed
refactor(bru): standardize authentication settings across requests chore: add coordinator base URL to configuration files
NowChess Bruno API Collection
Complete API collection for all NowChess microservices.
Structure
bruno/
├── collection.bru # Collection metadata
├── environments/ # Environment configurations
│ ├── local.bru # Local development (http://localhost)
│ ├── staging.bru # Staging (https://st.nowchess.janis-eccarius.de)
│ └── prod.bru # Production (https://nowchess.janis-eccarius.de)
├── core/ # Core service endpoints (port 8080)
│ ├── game.bru # Game management
│ ├── rules.bru # Rule validation (@InternalOnly)
│ ├── io.bru # Import/Export (@InternalOnly)
│ └── coordinator.bru # Orchestration
├── account/ # Account service (port 8083)
│ ├── account.bru # User & bot accounts
│ ├── challenge.bru # Player challenges
│ └── official-challenge.bru # Official bot challenges
├── store/ # Store service (port 8085)
│ └── game.bru # Game persistence
├── ws/ # WebSocket (port 8084)
│ ├── game-ws.bru # Game real-time updates
│ └── user-ws.bru # User notifications
└── bot/ # Bot integration
└── events.bru # Bot event streaming
Ingress Routing
Based on ingress-nginx configuration:
/api/account → nowchess-account-active:8083
/ws → nowchess-ws-active:8084
/api/store → nowchess-store-active:8085
/api → nowchess-core-active:8080
Environments
Local Development
baseUrl: http://localhost:8080
accountBaseUrl: http://localhost:8083
storeBaseUrl: http://localhost:8085
wsBaseUrl: ws://localhost:8084
Staging
baseUrl: https://st.nowchess.janis-eccarius.de/api
wsBaseUrl: wss://st.nowchess.janis-eccarius.de/ws
Production
baseUrl: https://nowchess.janis-eccarius.de/api
wsBaseUrl: wss://nowchess.janis-eccarius.de/ws
Environment Variables
Set these in your Bruno environment for authentication:
token: JWT token for regular user operationsadminToken: JWT token with Admin rolebotToken: Bot account JWT tokeninternalToken: Internal service-to-service tokengameId: Game identifier for game endpointsusername: User username for profile/challenge operationsplayerId: Player ID for store operationsbotId: Bot ID for bot endpointsbotName: Official bot name for challengesdifficulty: Bot difficulty 1000-2800 (ELO)color: white/black/random for bot challenges
Security Notes
From @modules/security/src:
- InternalOnly endpoints require internal service authentication
/api/rules/*/io/*
- @RolesAllowed endpoints require JWT with specific roles
- Admin operations
- Authenticated user operations
- Internal filters validate service-to-service calls
API Endpoints Summary
Public Endpoints (No Auth Required)
GET /api/account/{username}- Public profileGET /api/account/official-bots- List official botsGET /game/{gameId}- Game recordGET /api/board/game/{gameId}- Game stateGET /api/board/game/{gameId}/moves- Legal moves
Authenticated Endpoints (JWT Required)
POST /api/account- RegisterPOST /api/account/login- LoginGET /api/account/me- Current user profilePOST /api/challenge/*- Challenge operationsPOST /api/challenge/official/{botName}- Challenge official botPOST /api/account/bots- Create bot accountGET /api/bot/stream/events- Bot event streamWS /api/board/game/{gameId}/ws- Game WebSocketWS /api/user/ws- User notifications
Internal Endpoints (@InternalOnly)
POST /api/rules/*- Rule validationPOST /io/*- Format conversionPOST /api/board/game- Create game
Usage
- Select Environment: Click the environment dropdown and choose local/staging/prod
- Set Variables: Update
token,gameId,username, etc. as needed - Send Request: Click Send on any endpoint
- WebSocket: Use Bruno's WebSocket support or connect manually with:
websocat wss://nowchess.janis-eccarius.de/ws/api/board/game/GAMEID/ws
Example Workflows
Play a Game
POST /api/account- Create userPOST /api/account/login- Get JWT tokenPOST /api/challenge/official/Stockfish- Challenge a bot- Use returned
gameIdfor subsequent moves WS /api/board/game/{gameId}/ws- Connect for real-time updatesPOST /api/board/game/{gameId}/move/{uci}- Make moves
Manage Bot Account
POST /api/account- Create main accountPOST /api/account/login- Get tokenPOST /api/account/bots- Create bot account- Copy bot token from response
GET /api/bot/stream/events?botId={botId}- Listen for game invitesPOST /api/bot/game/{gameId}/move/{uci}- Submit moves
Notes
- All timestamps are ISO 8601 format
- Move notation uses UCI (e.g., "e2e4")
- Game IDs are auto-generated UUIDs
- WebSocket connections auto-close on inactivity (check your server timeout)