{"id":28406792,"url":"https://github.com/voxelum/xmcl-web-api","last_synced_at":"2026-04-29T15:32:22.755Z","repository":{"id":45299603,"uuid":"507342613","full_name":"Voxelum/xmcl-web-api","owner":"Voxelum","description":"The web api implementation of XMCL","archived":false,"fork":false,"pushed_at":"2025-05-25T12:13:14.000Z","size":145,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-02T07:38:58.703Z","etag":null,"topics":["deno","deno-deploy","oak"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Voxelum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-06-25T15:08:37.000Z","updated_at":"2025-05-25T12:13:18.000Z","dependencies_parsed_at":"2024-04-19T07:25:58.967Z","dependency_job_id":"52da2417-2166-49b0-8ffe-3cdcd2f82645","html_url":"https://github.com/Voxelum/xmcl-web-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Voxelum/xmcl-web-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voxelum%2Fxmcl-web-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voxelum%2Fxmcl-web-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voxelum%2Fxmcl-web-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voxelum%2Fxmcl-web-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Voxelum","download_url":"https://codeload.github.com/Voxelum/xmcl-web-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voxelum%2Fxmcl-web-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262569810,"owners_count":23330286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deno","deno-deploy","oak"],"created_at":"2025-06-01T22:38:10.405Z","updated_at":"2026-04-29T15:32:22.742Z","avatar_url":"https://github.com/Voxelum.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# XMCL Web API\n\nThis repository contains the server-side code for the X-Minecraft Launcher (XMCL) web API. It provides various backend services that support the launcher functionality.\n\n## Overview\n\nThe XMCL Web API serves multiple functions:\n- Provides launcher update notifications and release information\n- Manages real-time communication for multiplayer sessions\n- Handles translations for mod descriptions and UI elements\n- Offers WebRTC services for peer-to-peer connections\n- Supports authentication with various services\n\n## Architecture\n\nThe API is implemented in multiple ways to ensure global availability and reliability:\n\n1. **Primary Service (Deno)** - Hosted on Deno Deploy\n   - Entry point: `index.ts`\n   - Global availability outside mainland China\n   - Uses MongoDB for data storage\n\n2. **Backup Service (Azure Functions)** - Written in TypeScript\n   - Entry point: `azure/index.ts`\n   - Uses the Azure Functions JavaScript/TypeScript runtime\n   - Provides fallback capabilities if the primary service is unavailable\n\n3. **Alibaba Cloud Function Service (Deno)** - Uses compiled binary\n   - Entry point: Compiled Deno binary via `aliyun/bootstrap`\n   - Alternative deployment option for better access in mainland China\n   - Uses `deno compile` to create a standalone executable\n\n4. **Mainland China Service** - Specialized version in Go\n   - Entry point: `main.go`\n   - Optimized for access within mainland China\n   - Contains adaptations for the Chinese network environment\n\n## API Endpoints\n\n### Primary Service (Deno)\n\n- `/latest` - Provides information about the latest launcher releases\n- `/releases/:filename` - Access to launcher release files with redirection to GitHub\n- `/notifications` - System notifications for launcher users from GitHub issues\n- `/flights` - Feature flight information for gradual rollouts\n- `/translation` - Translation services for mod descriptions (Modrinth and CurseForge)\n- `/group/:id` - Real-time WebSocket communication for launcher user groups\n- `/rtc/official` - WebRTC signaling for peer connections\n- `/zulu` - Custom endpoint for specific launcher functionality\n- `/elyby/authlib` - Authentication library access\n- `/modrinth/auth` - Modrinth authentication integration\n- `/kook-badge` - Access to KOOK integration information\n\n### Backup Service (Azure Functions - Go)\n\n- `/latest` - Similar to Deno service, provides launcher release information\n- `/notifications` - Provides notifications from GitHub issues\n- `/flights` - Feature flight configuration\n- `/zulu` - Proxies to xmcl-static-resource repository\n- `/appx` - Handles Windows appx file distribution with proxy support for Chinese users\n\n### Mainland China Service (Go)\n\n- `/group/:id` - Real-time WebSocket communication for groups\n- `/translation` - Translation services for mod descriptions\n- `/rtc/official` - WebRTC signaling service\n\n## Environment Variables\n\n### Primary Service (Deno)\n\n- `MONGO_CONNECION_STRING` - Alternative name for MongoDB connection string\n- `MONGODB_NAME` - Database name (default: \"xmcl-api\")\n- `GITHUB_PAT` - GitHub Personal Access Token for API access\n- `OPENAI_API_KEY` - API key for translation services using DeepSeek API\n- `RTC_SECRET` - Secret for WebRTC services\n- `CURSEFORGE_KEY` - API key for CurseForge integration\n- `MODRINTH_SECRET` - Secret for Modrinth authentication integration\n- `TURNS` - TURN server configuration (format: \"realm:ip,realm:ip\")\n\n### Backup Service (Azure Functions - TypeScript)\n\n- `GITHUB_PAT` - GitHub Personal Access Token for API access\n- `FUNCTIONS_CUSTOMHANDLER_PORT` - Port for Azure Functions custom handler (legacy)\n\n### Mainland China Service (Go)\n\n- `MONGO_CONNECION_STRING` - MongoDB connection string\n- `MONGODB_NAME` - Database name (default: \"xmcl-api\")\n- `CURSEFORGE_KEY` - API key for CurseForge integration\n- `RTC_SECRET` - Secret for WebRTC services\n- `TURNS` - TURN server configuration (format: \"realm:ip,realm:ip\") \n\n## Development\n\n### Prerequisites\n\n- [Deno](https://deno.land/) for the primary service\n- [Go](https://golang.org/) for the Azure Functions and China service\n- [MongoDB](https://www.mongodb.com/) for data storage\n- Azure Functions Core Tools (for local Azure Functions testing)\n\n### Local Development\n\n```bash\n# Run the Deno service locally\ndeno run --allow-net --allow-read --allow-env index.ts\n\n# Build and run the Go service for China\ngo build main.go\n./main\n\n# Run the Azure Functions service locally\ndeno run build:fn\nfunc start\n```\n\n## Deployment\n\n### Deno Deploy\n\nThe primary service is deployed on Deno Deploy, which automatically deploys from the main branch.\n\n### Azure Functions\n\nFor Azure Functions deployment, use the Azure CLI or Azure Portal:\n\n```bash\naz functionapp deployment source config-zip -g myResourceGroup -n myFunctionApp --src ./azure.zip\n```\n\n### Alibaba Cloud Function\n\nThe Deno service can be deployed to Alibaba Cloud Function using Serverless Devs with a compiled binary:\n\n```bash\n# Install Serverless Devs CLI\nnpm install -g @serverless-devs/s\n\n# Configure your Alibaba Cloud credentials\ns config add\n\n# Compile the Deno application\ndeno compile --allow-net --allow-read --allow-env \\\n  --output aliyun/xmcl-api \\\n  index.ts\n\n# Deploy the function\ns deploy --use-local -y\n```\n\nThe deployment uses a compiled Deno binary and automatically deploys from the main branch via GitHub Actions.\n\n**Required Secrets for GitHub Actions:**\n- `ALIYUN_ACCOUNT_ID` - Alibaba Cloud Account ID\n- `ALIYUN_ACCESS_KEY_ID` - Alibaba Cloud Access Key ID\n- `ALIYUN_ACCESS_KEY_SECRET` - Alibaba Cloud Access Key Secret\n- Environment variables (same as Primary Service)\n\n### Custom Server (China)\n\nFor the China service, deploy to a suitable hosting provider with Go support:\n\n```bash\ngo build -o server main.go\n# Then deploy the binary to your server\n```\n\n## TURN Server\n\nFor WebRTC functionality, a COTURN server is used. Configuration details are in `COTURN.md`.\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoxelum%2Fxmcl-web-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvoxelum%2Fxmcl-web-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoxelum%2Fxmcl-web-api/lists"}