A Reddit Devvit application where users can stick virtual gum to a shared wall. This is a migration of the original client-side GumWall game to the Reddit Devvit platform.
- Interactive Gum Placement: Users can stick colorful gum wads to a shared brick wall
- Police System: Random police patrols that arrest users caught placing gum
- Lifeline System: Users have 5 lifelines per day; getting caught reduces lifelines
- Jail & Day Ban: Users get jailed for short periods or day-banned if they run out of lifelines
- Persistent Data: All game data is stored in Redis and persists across sessions
- Real-time Updates: Police state and game data update in real-time
- Reddit Integration: Uses authenticated Reddit users instead of anonymous players
- Click "Stick Gum" to enter placement mode
- Click "Place Here" to place your gum at a random location
- Each gum wad has a unique color and shape
- Gum placement is tracked per Reddit user
- Police warnings appear randomly every 30 seconds to 2 minutes
- After a 5-second warning, police patrol for 3 seconds
- Getting caught during patrol reduces your lifelines
- Police state is managed server-side for fairness
- Each user starts with 5 lifelines per day
- Lifelines reset at midnight
- Getting arrested reduces lifelines by 1
- Jail time increases with each arrest: 5s, 10s, 15s, 20s, 25s
- Running out of lifelines results in a day ban until midnight
Data Persistence:
- Migrated from
localStorageto Redis - GumWads stored as Redis hashes
- User states stored per Reddit user ID
- Unique chewers tracked in Redis sets
Execution Context:
- Police system logic moved to server-side functions
- User lifeline management handled server-side
- Prevents client-side manipulation
User Identity:
- Transitioned from anonymous users to authenticated Reddit users
- Uses Reddit's built-in user context
- User data tied to Reddit user IDs
API Layer:
- Server-side functions serve as API endpoints
- Client-side React components call server functions
- Real-time state synchronization
project/
├── src/
│ ├── main.tsx # Main Devvit entry point
│ ├── types/
│ │ └── game.ts # Game type definitions
│ └── components/ # Original React components (preserved)
├── server/
│ ├── gameState.server.ts # Game state management
│ ├── policeSystem.server.ts # Police system logic
│ └── gumActions.server.ts # Gum placement actions
├── devvit.json # Devvit configuration
└── package.json # Dependencies and scripts
- Node.js 18+
- Reddit Developer Account
- Devvit CLI
- Install dependencies:
npm install - Build the application:
npm run build - Test locally:
npx devvit playtest
- Upload to Reddit:
npx devvit upload - Install in a subreddit via Reddit's app directory
- A moderator installs the app in their subreddit
- Create a game post using the "Create GumWall Game" menu item
- Users interact with the game post to place gum and avoid police
- Game state persists across all user sessions
This application follows Reddit's Devvit guidelines:
- Transparent user actions
- Secure server-side logic
- Proper Redis data management
- User authentication via Reddit
This is a migration of the original GumWall game, preserving the core gameplay mechanics and visual design while adapting to the Reddit Devvit platform's architecture and capabilities.