Skip to content

artbitrage/BrowserQuest

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

๐ŸŽฎ BrowserQuest

A modernized HTML5/JavaScript multiplayer game experiment, rebuilt with a bleeding-edge tech stack.

Node.js React Vite TypeScript License: MPL 2.0

โœจ Features

  • Modern Monorepo: npm workspaces with @bq/client, @bq/server, @bq/shared
  • Real-time Multiplayer: WebSocket-based networking with ws
  • Type-Safe: End-to-end TypeScript with shared types
  • Docker Ready: Multi-stage Dockerfiles with docker-compose orchestration
  • CI/CD: GitHub Actions for lint, test, and build

๐Ÿš€ Quick Start

Prerequisites

  • Node.js >= 22.0.0
  • npm >= 10

Development

# Install dependencies
npm install

# Start all services in development mode
npm run dev

# Or start individually
npm run dev --workspace @bq/client
npm run dev --workspace @bq/server

Production (Docker)

# Build and run all services
docker-compose up --build

# Access:
# - Client: http://localhost:8080
# - Server: ws://localhost:8000

๐Ÿ“ Project Structure

browserquest-monorepo/
โ”œโ”€โ”€ apps/
โ”‚   โ”œโ”€โ”€ client/          # React 19 + Vite 6 game client
โ”‚   โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ components/  # React UI (HUD, Login, Chat)
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ game/        # Canvas game engine
โ”‚   โ”‚   โ””โ”€โ”€ public/          # Static assets (sprites, audio)
โ”‚   โ””โ”€โ”€ server/          # Node.js WebSocket server
โ”‚       โ”œโ”€โ”€ src/
โ”‚       โ”‚   โ”œโ”€โ”€ entities/    # Game entities (Mob, Npc, Character)
โ”‚       โ”‚   โ”œโ”€โ”€ WorldServer.ts
โ”‚       โ”‚   โ””โ”€โ”€ player.ts
โ”‚       โ””โ”€โ”€ test/            # Vitest tests
โ”œโ”€โ”€ packages/
โ”‚   โ””โ”€โ”€ shared/          # Shared types, utils, constants
โ””โ”€โ”€ legacy/              # Original BrowserQuest code (reference)

๐Ÿ› ๏ธ Tech Stack

Layer Technology
Client React 19, Vite 6, TailwindCSS 4, Canvas 2D
Server Node.js 22, WebSocket (ws), Pino
Shared TypeScript 5.7, Zod
Database Redis (via ioredis)
CI/CD GitHub Actions, Docker
Tooling Biome (lint/format), Vitest

๐Ÿ“œ Scripts

Command Description
npm run dev Start all services in dev mode
npm run build Build all packages
npm run test Run all tests
npm run lint Check code with Biome
npm run lint:fix Auto-fix lint issues
npm run format Format code with Biome

๐Ÿงช Testing

# Run all tests
npm run test

# Run server tests only
npm run test --workspace @bq/server

Test Coverage:

  • Unit tests for Player, WorldServer, Utils
  • Integration tests for Game Loop (HELLO/WELCOME/MOVE handshake)

๐Ÿ“„ License

๐Ÿ™ Credits

Original game created by Little Workshop:

Modernization by the community.

About

A HTML5/JavaScript multiplayer game experiment.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 91.5%
  • CSS 4.0%
  • TypeScript 3.8%
  • HTML 0.6%
  • Python 0.1%
  • Dockerfile 0.0%