How wjiangh/donut_town works
Donut Town is a Slack-connected pixel-town app: teammates enter through Slack, appear as residents, explore and personalize the town, and use chat, home, and shop features. The main runtime divides between the browser town client and the Node server, which handles sign-in, API requests, and persistence. The README documents major capabilities whose detailed implementations were not sampled; those are represented at their supported module paths. Connections are limited to excerpted imports/calls and explicit README statements.
Main entry points: server.mjs HTTP server · app.js Town client · town-themes/service.mjs Theme service · chats/service.mjs Chat history
Components 28
Access and server
- HTTP server
server.mjs - OAuth sessions
slack/session.mjs - Slack sign-in
slack/oidc.mjs
Town experience
- Town client
app.js - Live presence
realtime/presence.mjs - Theme settings
town-themes/client.mjs - Theme contract
town-themes/contract.mjs - Theme service
town-themes/service.mjs - Theme storage
town-themes/store.mjs
Residents and places
- Character catalog
characters/catalog.mjs - Wardrobe rendering
characters/wardrobe/renderer.mjs - Wardrobe storage
characters/wardrobe/store.mjs - Pet companion
pets.mjs - Home and visits
house.mjs - Home luxury
house/luxury.mjs
Social and economy
- Chat history
chats/service.mjs - Chat records
chats/store.mjs - Donut invitations
slack/invitations.mjs - Shop experience
shop-room.mjs - Shop inventory
shop/store.mjs - Town social UI
social-client.mjs - Social records
social/store.mjs
External services and storage
- Slack API client
slack/client.mjs - Lottery bridge
lottery/bridge.mjs
Other components
- Slack teammate
- Slack platform
- Town browser
- Upstash Redis
Connections 30
- Slack teammate → Slack platform: signs in
- Slack platform → HTTP server: launches town
- HTTP server → OAuth sessions: verifies state
server.mjs - HTTP server → Slack sign-in: exchanges code
server.mjs - Town browser → Town client: opens
- Town client → Live presence: tracks presence
- Town client → Theme settings: mounts settings
app.js - Theme settings → Theme contract: validates theme
town-themes/client.mjs - HTTP server → Theme service: routes theme API
server.mjs - Theme service → Theme contract: checks permissions
town-themes/service.mjs - Theme service → Theme storage: loads and saves
- Town client → Character catalog: uses residents
app.js - Town client → Wardrobe rendering: renders outfits
app.js - HTTP server → Wardrobe storage: loads wardrobe
server.mjs - Town client → Pet companion: shows pets
app.js - Town client → Home and visits: opens homes
app.js - Home and visits → Home luxury: calculates luxury
house.mjs - HTTP server → Chat history: routes chat actions
server.mjs - Chat history → Chat records: reads and confirms
- Chat history → Donut invitations: loads pair rounds
chats/service.mjs - HTTP server → Donut invitations: handles invitations
server.mjs - Town client → Shop experience: opens shop
app.js - HTTP server → Shop inventory: handles purchases
server.mjs - Town client → Town social UI: mounts social UI
app.js - HTTP server → Social records: routes social actions
server.mjs - Social records → Upstash Redis: reads and writes
social/store.mjs - Lottery bridge → Donut invitations: reads active round
lottery/bridge.mjs - Lottery bridge → Upstash Redis: reads round records
lottery/bridge.mjs - Slack API client → Slack platform: calls API
slack/client.mjs - HTTP server → Slack API client: uses Slack API
server.mjs