How evanray-team/xray-image-server works
Xray Image Server accepts HTTP requests and produces PNGs from registered image templates, with rendering dispatched through a worker pool. Its main product branches are maimai music/player imagery and the themed constant-table background pipeline. Shared rendering handles validation, fonts, SVG generation and rasterization; game logic and asset access support the domain templates. The README documents optional PostgreSQL/OSS-backed online assets. Some links are limited to imports and README statements because several runtime modules were not excerpted.
Main entry points: render-template.ts Template engine · index.ts Server startup · asset.ts Asset manager · mai-logic.ts Game logic
Components 26
HTTP service
- Server startup
core/index.ts - Render endpoint
apis/render.post.ts - Ping endpoint
apis/ping.get.ts - Logging
core/logger.ts
Render runtime
- Render service
core/render-service.ts - Worker pool
core/worker-pool.ts - Render worker
core/render-worker.ts - Worker protocol
core/worker-types.ts - Template engine
core/render-template.ts - Configuration
core/config.ts
Maimai imagery
- Music info image
templates/maiMusicInfo.tsx - Best 50 image
templates/maiPlayerBest50.tsx - Music record image
templates/maiPlayerMusicRecord.tsx - Collection status
templates/maiPlayerCollectionStatus.tsx - Score list image
templates/maiPlayerScoreList.tsx - Game logic
core/mai-logic.ts - Game constants
core/mai-constants.ts - Constant table
templates/maiConstantTable.tsx - Table background
templates/maiConstantTableBackground.tsx - Theme registry
templates/maiConstantTableTheme/theme-index.tsx - Table themes
templates/maiConstantTableTheme - Theme credits
templates/maiConstantTableTheme/theme-credits.tsx
Assets and data
- Asset manager
core/asset.ts - SQL database
- Tencent COS
Other components
- HTTP client
Connections 34
- HTTP client → Render endpoint: requests render
README.md - HTTP client → Ping endpoint: checks health
apis/ping.get.ts - Server startup → Render service: initializes
core/index.ts - Server startup → Ping endpoint: registers
core/index.ts - Server startup → Render endpoint: registers
core/index.ts - Render service → Worker pool: initializes pool
core/render-service.ts - Worker pool → Render worker: creates worker
core/worker-pool.ts - Worker pool → Worker protocol: uses messages
core/worker-pool.ts - Render worker → Worker protocol: uses messages
core/worker-types.ts - Render worker → Template engine: renders with
core/render-worker.ts - Template engine → Asset manager: loads fonts
core/render-template.ts - Render endpoint → Render service: dispatches render
- Music info image → Template engine: defines template
templates/maiMusicInfo.tsx - Best 50 image → Template engine: defines template
templates/maiPlayerBest50.tsx - Music record image → Template engine: defines template
templates/maiPlayerMusicRecord.tsx - Collection status → Template engine: defines template
templates/maiPlayerCollectionStatus.tsx - Score list image → Template engine: defines template
templates/maiPlayerScoreList.tsx - Music info image → Game logic: uses game logic
templates/maiMusicInfo.tsx - Music record image → Game logic: uses game logic
templates/maiPlayerMusicRecord.tsx - Best 50 image → Game logic: uses game logic
templates/maiPlayerBest50.tsx - Score list image → Game logic: uses game logic
templates/maiPlayerScoreList.tsx - Music info image → Game constants: uses constants
templates/maiMusicInfo.tsx - Music record image → Game constants: uses constants
templates/maiPlayerMusicRecord.tsx - Constant table → Template engine: defines template
templates/maiConstantTable.tsx - Table background → Theme registry: prepares theme
templates/maiConstantTableBackground.tsx - Theme registry → Table themes: dispatches themes
templates/maiConstantTableTheme/theme-index.tsx - Table themes → Theme credits: loads credits
templates/maiConstantTableTheme/theme-magical.tsx - Table themes → Asset manager: loads imagery
templates/maiConstantTableTheme/theme-credits.tsx - Game logic → Asset manager: loads covers
core/mai-logic.ts - Asset manager → SQL database: reads asset records
- Asset manager → Tencent COS: downloads remote images
core/asset.ts - Server startup → Logging: configures logging
core/index.ts - Server startup → Configuration: uses configuration
core/index.ts - Render worker → Configuration: loads configuration
core/render-worker.ts