Technology Use

GearN Server is built on Node.js and TypeScript, with Express for HTTP APIs, Socket.IO for real-time transport, and MongoDB for persistent game data. The stack is intentionally practical: fast to run locally, simple to deploy, and flexible enough for live game operations.

Node.js 20+TypeScriptExpressSocket.IOMongoDBJWTMsgPackFirebase Admin
Runtime

Node.js provides the event-driven runtime used by the server. It fits GearN's workload well because game backend traffic is mostly I/O-heavy: API calls, database reads/writes, socket events, file uploads, and external service calls.

  • Handles many concurrent requests without spawning a thread per request.
  • Works well with async MongoDB, HTTP, mail, push notification, and socket workflows.
  • Requires Node.js >= 20.0.0 in the server package.
Language

TypeScript is used across the server codebase to keep request models, response models, entity contracts, and CloudScript workflows explicit.

  • Improves maintainability for large API surfaces.
  • Reduces runtime mistakes in request conversion and entity mapping.
  • Supports CloudScript templates written in TypeScript.
Database

MongoDB stores flexible game data such as players, characters, groups, inventory, store items, content data, leaderboard data, logs, and dashboard settings.

  • Good fit for evolving game data schemas.
  • Supports separate data and log database connections.
  • Used by Socket.IO adapters for cluster-aware real-time delivery.
Transport Layer

GearN exposes both HTTP and socket transports. This lets a game use simple REST-style calls where latency is not critical, and keep a persistent socket connection for real-time events.

TechnologyUsed ForWhy It Matters
ExpressHTTP API, health check, upload/download routing, dashboard/server endpointsSimple routing model with proven middleware support.
Socket.IOAuthenticated real-time API calls, push events, rooms, online statusReliable WebSocket-style communication with fallback handling.
MsgPackCompact request/response payloads for HTTP and socketReduces payload size compared with plain JSON when enabled.
CORSAllowed origin, methods, headers, and credentials controlKeeps browser-based dashboard and client calls predictable.
Security And Integration

GearN uses focused libraries for authentication, password hashing, external identity verification, push notification, email, and file upload. These pieces should stay boring and battle-tested.

  • jsonwebtoken and jwks-rsa verify token-based authentication and third-party identity flows.
  • bcrypt hashes account and admin passwords.
  • Firebase Admin sends push notifications to player devices.
  • Nodemailer handles email delivery workflows.
  • Multer processes file upload requests for content features.
Request Flow
1. Client

Unity, C#, TypeScript, JavaScript, Java, or Cocos Creator client sends an HTTP or socket request.

2. Transport

Express or Socket.IO receives JSON/MsgPack payloads and passes them through middleware.

3. Middleware

Authentication, permission rules, request limits, payload limits, and debug logging are applied.

4. Handler

Request handlers convert input into typed service operations for the target GearN feature.

5. Database

MongoDB stores and reads entity data, logs, leaderboards, settings, and content records.

6. Response

The server returns a structured response and can push socket events to one player, a room, or all players.

Production Features
  • Cluster settings let multiple GearN nodes cooperate behind a larger deployment.
  • Mongo Socket.IO adapter helps socket events work across nodes.
  • DDoS settings control request rate, pending request count, upload/download pressure, and payload size.
  • Log4js supports console and file logging for operations and debugging.
  • Systeminformation provides runtime machine data for dashboard and diagnostics.
Core Dependencies
AreaPackagesPurpose
Runtimenode >= 20 typescriptModern JavaScript runtime and type-safe server development.
HTTPexpress body-parser corsREST-style endpoints, middleware, request parsing, and CORS policies.
Realtimesocket.io @socket.io/mongo-adapter @socket.io/mongo-emitterSocket API, rooms, player events, and distributed socket communication.
StoragemongodbPrimary database access for game data, logs, content, and settings.
Securitybcrypt jsonwebtoken jwks-rsa node-forgePassword hashing, token signing/verification, public key lookup, and crypto support.
Integrationaxios firebase-admin nodemailer multerExternal HTTP calls, push notifications, email delivery, and file uploads.
Operationslog4js systeminformation @msgpack/msgpackLogging, server diagnostics, and compact binary payload encoding.