Skip to content

Quick start

xymj-colyseus-server is an opinionated Colyseus server in TypeScript + Express: JWT, matchmaker rooms, frame-sync game rooms, chat rooms, and related conventions ship together. Below is the shortest path to run it locally; use the sidebar for deeper topics.

1. Clone & install

In the xymj-colyseus-server repository root:

bash
npm install

See Installation for Node / MySQL / Redis requirements.

2. Configure & run

Copy and edit .env.development (MySQL, Redis — needed for matchmaking / chat queues — JWT_SECRET, etc.), then:

bash
npm run dev

Default http://localhost:2567 (port from PORT).

3. Verify HTTP & static pages

GoalURL
Swaggerhttp://localhost:2567/api-docs
Static introhttp://localhost:2567/

Use Swagger or your login API to obtain a token; Colyseus join / joinOrCreate options must carry it (see JWT & room authentication — full text in Chinese until translated).

4. Try matchmaking in the browser

Open http://localhost:2567/MatchmakingDemo.html, set the server URL and JWT, open multiple tabs to exercise match:findmatch:found → join game_room. Parameters and scaling rules: Multi-scale matchmaking (stub → links to Chinese).

5. Where to go next

GoalDoc
Environment variablesConfiguration
Room names & layoutProject structure
Match / Party message namesMatchmaking, Protocol
Unity / Cocos / GodotEngine overview
Scenario pickersScenarios overview

Chinese mirror

Most deep-dive pages are still Simplified Chinese only. Each English stub links to the matching 中文 page at the same path without /en/.

English pages are partial; authoritative docs are in Simplified Chinese.