How reddit/devvit-pixelary works
Pixelary is a Reddit-community pixel-art drawing and guessing game. A player chooses a word, draws on the canvas, and submits the result as a post; community members guess it, earning points that feed progression and rewards. The server exposes gameplay through tRPC and also supports word-slate selection, tournament posts, and community post types. The README documents the gameplay and scoring stages; sampled source confirms editor submission and selected server routes. Several subsystems are represented by their exact enclosing directories because their implementations were not sampled.
Main entry points: router.ts Gameplay API · EditorRouter.tsx Editor flow · DrawStep.tsx Pixel drawing · ReviewStep.tsx Review and submit
Components 19
Drawing gameplay
- Editor flow
src/client/entries/editor/_components/EditorRouter.tsx - Word choice
src/client/entries/editor/_components/WordStep.tsx - Pixel drawing
src/client/entries/editor/_components/DrawStep.tsx - Canvas state
src/client/entries/editor/_hooks/useDrawingState.tsx - Review and submit
src/client/entries/editor/_components/ReviewStep.tsx
Word selection
- Slate bandit
src/server/services/words/slate.ts - Word dictionary
src/server/services/words/dictionary.ts
Community modes
- Drawing posts
src/server/services/posts/drawing.ts - Guessing and scoring
src/server/services/posts/drawing.ts - Community post modes
src/server/services/posts - Tournament play
src/server/services/posts/tournament/post.ts
Progression
- Points and levels
src/server/services/progression.ts - Rewards and items
src/server/services/rewards
Server platform
- Gameplay API
src/server/trpc/router.ts - HTTP server
src/server/index.ts - Redis and permissions
src/server/core/redis.ts
Other components
- Player
- Community members
- Reddit platform
Connections 18
- Player → Editor flow: starts drawing
README.md - Editor flow → Word choice: shows choice
src/client/entries/editor/_components/EditorRouter.tsx - Editor flow → Pixel drawing: shows canvas
src/client/entries/editor/_components/EditorRouter.tsx - Pixel drawing → Canvas state: uses state
src/client/entries/editor/_components/DrawStep.tsx - Editor flow → Review and submit: shows review
src/client/entries/editor/_components/EditorRouter.tsx - Review and submit → Gameplay API: submits drawing
src/client/entries/editor/_components/ReviewStep.tsx - HTTP server → Gameplay API: mounts API
src/server/index.ts - Gameplay API → Drawing posts: creates drawing
src/server/trpc/router.ts - Community members → Guessing and scoring: guess drawings
README.md - Drawing posts → Guessing and scoring: supports scoring
src/server/services/posts/drawing.ts - Gameplay API → Slate bandit: generates slate
src/server/trpc/router.ts - Gameplay API → Word dictionary: reads words
src/server/trpc/router.ts - Player → Points and levels: earns points
README.md - Points and levels → Rewards and items: uses rewards
src/server/services/progression.ts - Gameplay API → Redis and permissions: checks permissions
src/server/trpc/router.ts - Reddit platform → HTTP server: hosts game
- Player → Tournament play: joins tournament
- Player → Community post modes: views community posts