Skip to content
Menu

System design

Inside Bit Hotel.

On the website, a room was a numbered space on a floor plan. In the game, it was a place where guests could meet. In the marketplace, it was a collectible someone could own.

Explore the system map
Room 1001 · Floor 1

System map

Follow a guest action through the clients, services and records that powered the original hotel.

Bit Hotel system architecture The native shell hosted a Phaser client that connected to Nakama for multiplayer. The website read hotel and marketplace records through an API gateway. Wallet-signed EVM trades generated events for the marketplace index. Payment and shop services adjusted Nakama balances, and the shop could mint items on chain. GAME & MOBILE WEBSITE & COMMERCE JSON WebSocket load room HTTPS floor range query listings query sign signed tx trade event update index Native app React Native · Expo Game client Phaser 3 · Vue HUD Room match Nakama · live players Saved room Furniture · permissions Website Vue · floor plan & listings API gateway HTTP routing Hotel service Floor ranges · rooms Hotel database PostgreSQL · room types Marketplace API Filters · pagination Listing index PostgreSQL · sale status Player wallet Signs the transaction EVM marketplace Executes the trade Event listener Indexes listing changes GAME ECONOMY verify credit update buy mint item debit Payment provider Stripe or Pay.nl Payment processor Verifies the payment Nakama wallet RPC Credits & debits Player balance In-game currency In-game shop Item purchase Shop service Checks the balance Collection contract Mints the item

Multiplayer

Game clientPhaser 3 and the Vue HUD
Live room updates
Room matchNakama tracks the guests in the room
Loads room
Saved roomFurniture and permissions in Nakama storage

Mobile bridge

Game clientPhaser runs inside a WebView
JSON messages
Native shellReact Native and Expo
Device APIs
Phone featuresAudio and notifications

Room catalog

WebsiteVue floor explorer
HTTPS request
API gatewayRoutes catalog requests
Floor range
Hotel serviceLoads matching floors and rooms
Prisma query
Hotel databasePostgreSQL stores room footprints and types

NFT trades

Executing a trade

Player walletOpened from the marketplace website
Signed transaction
EVM marketplaceExecutes the trade on chain
Trade event
Event listenerPicks up the change in sale status
Updates the listing
Listing indexPostgreSQL stores the sale status

Browsing listings

WebsiteVue marketplace
HTTPS request
API gatewayRoutes listing requests
Filters and pagination
Marketplace APILooks up matching listings
Queries the index
Listing indexPostgreSQL stores the sale status

Game economy

Topping up

Payment providerStripe or Pay.nl
Payment verification
Payment processorConfirms a successful payment
Credits currency
Nakama wallet RPCUpdates the player’s in-game balance

Buying an NFT item

In-game shopThe player chooses an item
Purchase request
Shop serviceChecks the player’s balance
Nakama wallet RPCDebits game currency
Collection contractMints the purchased NFT

The game sent live actions to Nakama. The website used HTTP for catalog and listing data. A wallet signature authorized a trade on the EVM network.

Joining a room

Two guests can see each other move because both game clients listen to the same authoritative room match.

  1. Find the match

    The signed-in client calls findMatch. Nakama finds a running match for the requested space or creates one, then returns its ID.

  2. Get the room

    The client joins by ID. The server sends the current world state to the new guest and announces their arrival to the other players.

  3. Choose a tile

    A click in the scene sends OnPlayerSetGoal with tile coordinates over the match socket.

  4. Move on both screens

    The server updates the guest’s position in match state and broadcasts the movement. Each Phaser client moves the avatar in its own scene.

Where room data lived

A guest leaving a room removed their presence from the match. The floor plan, furniture arrangement and NFT ownership each had their own lifetime.

Question Source of truth How it was used
Where is room 1001? Hotel database The floor explorer drew the room at the tile coordinates assigned by the catalog import.
Who is here now? Nakama match state The match tracked each guest’s position until they left.
What is in the room? Nakama room storage Saved furniture placements and permissions were loaded when the room opened.
Who owns the token? NFT collection contract An on-chain transfer changed the owner. The marketplace kept a separate index of listings.

The game economy

Game balances lived in Nakama’s account wallet. Blockchain wallets held tokens. Two purchase paths connected those systems to the player experience.

Buying game currency

The payment processor verified a payment with its provider, then called a game RPC to credit the player’s balance. Order records were stored separately in PostgreSQL.

Buying an item in the shop

The shop checked and debited the game balance. For a mintable collection, its backend signed the mint, waited for a chain confirmation and recorded the purchase.

Repository guide

These are the original codebases behind the paths above. Open a group to see where each responsibility lived.

Game clients & shared messages
bithotel-game
The Phaser game and Vue interface. Network.ts connected the client to Nakama.
bithotel-mobile
The Expo app. AppView.tsx hosted the WebView and handled messages between the game and native code.
bithotel-common · bithotel-shared
Git submodules used by the client and server for operation codes, message types and shared game definitions.
Multiplayer & persistence
bithotel-server
The Nakama runtime. FindMatch.ts selected or created matches. PublicSpaceComponent.ts managed presence, movements and room initialization.
Hotel website & catalog
BitHotel-Website
The Vue site for browsing the building, opening floor plans, connecting a wallet and finding listings.
api-gateway
HTTP routes that forwarded website requests to the hotel and marketplace services.
backend-hotel
Floor layouts and room collections. floor-range.service.ts loaded the building, floors, rooms and collection metadata through Prisma.
Trading & the game economy
backend-marketplace
The listing API and EVM listener. listener.service.ts handled listing creation, execution and cancellation events.
bithotel-room-contracts · bithotel-contracts-upgradeable
Room collection and presale contracts, plus the Solidity marketplace implementation. The Casper marketplace had its own Rust contracts in bithotel-casper-contracts.
bithotel-web-services
Shop, payment and withdrawal services. The shop and payment processor used a shared game client to read and adjust balances through Nakama RPCs.

The portfolio preserves the floor plans and collection artwork from the original platform.

Explore the hotel floors Browse the marketplace
Thomas Guntenaar · Hotel floor explorer and mobile bridge

BIT HOTEL · FRONT DESK

This is a demo page.

Wallet connections and transactions are disabled. You can still explore the hotel and its collections.