LegacyShell WikiLegacyShell Wiki
Back to LegacyShell
Home
Wiki
Plugins
Docs
Back to LegacyShell
Home
Wiki
Plugins
Docs
  • Documentation

    • Getting Started

      • What is LegacyShell?
      • Speed Setup
      • Requirements
      • Installation
      • First Run
      • Config Files
      • Making an Account
      • Troubleshooting (Getting Started)
    • Running a Server

      • Architecture Overview
      • The Database
      • Users and Ranks
      • Adding Game Servers
      • Client Mirrors
      • Perpetual
      • Backups
      • Rate Limiting
      • Moderation
      • Closed Mode
      • Deployment
      • Troubleshooting (Running a Server)
      • Hosting for Someone Else's Instance
    • Content Creation

      • Maps
      • Dealing with Babylon Models
      • Map Blocks
      • Items and Skins
      • Hats and Stamps
      • Sounds
      • Gamemodes
      • Seasonal Events
    • Plugin Development

      • Quickstart
      • I Want To...
      • Anatomy of a Plugin
      • Lifecycle
      • Dependencies
      • Events (Concept)
      • Event Reference

        • services: events
        • game: events — shared logic (src/shell/)
        • game: events — main-thread server process
        • game: events — per-connection client object
        • game: events — room lifecycle & tick loop
        • game: events — in-browser gameplay
        • client: events — client server & build pipeline
      • Commands
      • Client-Side Code
      • Static Assets
      • Content Packs
      • Networking
      • Workers and State
      • Prediction and Authority
      • Recipes

        • Recipe: Killstreaks
        • Recipe: New Pickup Item
        • Recipe: New Gamemode
        • Recipe: Custom Weapon
        • Recipe: UI Modification
        • Recipe: Discord Integration
        • Recipe: Replacing Core Behaviour
        • Recipe: Persistent Plugin Storage
        • Recipe: Rewarding Players with Currency
        • Recipe: Custom Per-Player Data
        • Recipe: Custom Theme
      • Publishing
      • Pitfalls
      • Modifiers
      • Sound and Apollo
    • Codebase Reference

      • Repo Layout
      • Shared Shell Layer
      • Server-Only Markers
      • The ss Object
      • Build Pipeline
      • Stamps and Babylons
      • Game Loop
      • Rooms and Workers
      • Wire Protocol
      • Generated

        • Wire Protocol Opcodes
        • Enums & Lookup Tables
        • Database Schema
        • Config Reference
        • Slash Command Reference
      • Services Internals
      • Catalog and Items
      • Permissions Internals
      • Physics and Collision
      • Known Quirks
      • Codebase Anecdotes
      • Development Timeline
    • Contributing

      • Documentation Style Guide
      • Generators
      • For AI Agents

Repo Layout

Audience: Core contributors, AI agents · Prereqs: Codebase Reference

Canonical source: the repository root

A directory-by-directory map of the monorepo - what lives where, and why, before diving into any one subsystem in depth.

Top level

PathWhat it is
src/shell/The shared game-logic layer - see Shared Shell Layer. Used by both the Node game server and the browser client.
src/defaultconfig/Template config files, copied into store/config/ by npm run init. See Config Files.
src/items/ (does not exist at this path)See note below - default items actually live under server-services/src/items/, not top-level src/.
src/scripts/Dev/build tooling - init.js, perpetual.js, gen-wiki-reference.js, and assorted one-off utilities (map converters, a stamp downloader, a bcrypt benchmark). Not part of the shared runtime code.
src/base-babylons/Base .babylon model files, merged with plugin-contributed models at build time - see Stamps and Babylons.
server-services/The services server role - see Services Internals.
server-game/The game server role - see Game Loop and Rooms and Workers.
server-client/The client server role, including the entire browser-facing static site and the build pipeline that assembles it - see Build Pipeline.
plugins_default/First-party bundled plugins.
plugins/User-installed/third-party plugins.
plugins_samples/Minimal example plugins referenced throughout the Plugin Development docs.
wiki/This wiki - VuePress 2, source in wiki/docs/wiki/wiki/wiki/plugins, config in wiki/.vuepress/.
store/Generated/runtime data - your personal config/, cached items.json/maps.json/servers.json, logs, backups. Not checked into git (per-deployment).
versionEnum.txt / versionHash.txtAuto-incremented by CI on every push to main - see Generators for the unrelated-but-similar wiki-generation CI job.

Inside server-services/

PathWhat it is
run-services.jsEntry point: instantiateSS → loadPlugins('services') → dynamic import of start-services.js.
start-services.jsThe bulk of services' own logic - DB boot, the WebSocket command dispatch switch, most of the services: event emit sites.
src/data_management/recordsManagement.js (all table DDL + CRUD helpers), accountManagement.js (bcrypt, auth tokens), sessionManagement.js, backups.js.
src/ratelimit.jsPer-IP sliding-window rate limiting.
src/items/*.js, src/maps/*.jsonDefault item and map definitions, loaded into the database on boot.
store/LegacyShellData.dbThe canonical SQLite database.

Inside server-game/

PathWhat it is
run-game.jsEntry point (main thread).
start-game.jsServices connection, the player-facing WebSocketServer, initItems() call.
src/roomManager.jsMain-thread room lookup/creation, the worker-thread pool.
src/worker.jsThe script each room's dedicated worker thread actually runs.
src/rooms.jsRoom simulation itself - by far the largest single event surface in the codebase. Runs inside the worker thread.
src/client.jsPer-connection player wrapper (ClientConstructor).

Inside server-client/

PathWhat it is
run-client.js / start-client.jsEntry point and the Express app / build orchestration.
src/prepare-modified.jsThe actual build step - splices src/shell/* into the browser bundle, minifies, injects plugin code.
src/stampsGenerator.jsComposites the stamp spritesheet.
src/client-static/Raw, hand-maintained browser assets - src/shellshock.min.js (the browser game source, despite the filename), editor/ (the map editor), libs/, sound/, app_nugget/.
store/client-modified/Generated build output - not checked into git.

A naming trap: src/items/ doesn't exist

If you go looking for the default item definitions at the top-level src/items/ (a reasonable guess, since src/shell/ and src/defaultconfig/ both live under top-level src/), you won't find it - the real path is server-services/src/items/, resolved relative to the services role's own currentDir, not the repo root. Same pattern for server-services/src/maps/. See Maps and Content Packs.

package.json's imports map is the real dependency graph for src/shell/

Every #hashtag subpath import (#comm, #player, #catalog, etc.) resolves through package.json's "imports" field - see Shared Shell Layer for what this enables. Two entries are stale (#start-client, #start-services point at nonexistent files under server-game/) - see Known Quirks.


This page was drafted with AI assistance and reviewed for accuracy. If something looks wrong, please open a PR or flag it.

Edit this page on GitHub
Next
Shared Shell Layer