Rugplay
A fake, multiplayer crypto simulator. Create coins, trade with liquidity pools, bet on prediction questions, gamble it all, and climb the leaderboards!
Install / Use
/learn @outpoot/RugplayREADME
<img style="width: 128px; height: 128px" src="website/static/favicon.svg" /><h1 style="font-size: 48px"><a href="https://rugplay.com">Rugplay.com</a> - the fake crypto simulator.</h1>
Privacy Policy | Terms of Service | License | YouTube video
About
Rugplay is a realistic cryptocurrency trading simulator that lets you experience the risks and mechanics of decentralized exchanges without real financial consequences. Create coins, trade with liquidity pools, and learn about "rug pulls" in a... relatively safe environment :)
Features
- 🪙 Create coins
- 🟢 Buy coins
- 🔴 Sell coins
- ⚖️ Predict on questions (similar to Polymarket)
- 🎲 Play arcade games
- 📊 View a Treemap graph of the entire market
- 🏆 Compete on leaderboards

Development Setup
Prerequisites
Before you begin, make sure you have the following installed:
- Node.js (LTS version recommended)
- Bun (for websocket server)
- Docker (for running Redis and PostgreSQL)
Getting Started
-
Clone the repository
git clone https://github.com/outpoot/rugplay.git cd rugplay -
Set up Redis
Create a Redis Docker container:
docker run -d --name rugplay-redis -p 6379:6379 -v rugplay_redisdata:/data --restart unless-stopped redis:8-alpine redis-server --save 60 1Alternative: You can also download and install Redis directly for your operating system, or use a managed Redis service such as Redis Cloud.
-
Set up PostgreSQL
You have two main options for your Postgres database:
-
Run Postgres locally with Docker:
docker run -d --name rugplay-postgres -e POSTGRES_USER=pguser -e POSTGRES_PASSWORD=pgpass -e POSTGRES_DB=rugplay -p 5432:5432 -v rugplay_pgdata:/var/lib/postgresql/data --restart unless-stopped pgvector/pgvector:pg16 -
Use a managed cloud Postgres provider: Services like Supabase, Neon, or others let you create a Postgres database online, often with a free tier. Simply grab your connection details (host, user, password, database name) from your provider.
After your database is running, update your
DATABASE_URLin the.envfile to point to your Postgres instance.If you are running Postgres locally, you can seed the database with:
docker exec -it rugplay-postgres psql -d rugplay -U pguserThen, copy and paste the SQL from the migration files (e.g.
website/drizzle/0000_crazy_bloodstrike.sql). -
-
Configure Google OAuth
- Go to Google Auth Platform dashboard
- Create a new client:
- Application type: "Web application"
- Name: Your choice
- Authorized JavaScript origins: Can be left empty
- Authorized redirect URIs:
- http://localhost:3002/api/auth/callback/google
- http://localhost:5173/api/auth/callback/google
- Production URL
-
Configure Environment Variables
cd website cp .env.example .envEdit
.envwith your values. Example:# --- Database --- DATABASE_URL=postgres://pguser:pgpass@localhost:5432/rugplay # PostgreSQL connection string POSTGRES_USER=pguser # PostgreSQL username (should match Docker config) POSTGRES_PASSWORD=pgpass # PostgreSQL password (should match Docker config) POSTGRES_DB=rugplay # PostgreSQL database name (should match Docker config) # --- Redis --- REDIS_URL=redis://localhost:6379 # Redis connection string # --- Auth --- PRIVATE_BETTER_AUTH_SECRET=your_secret_here # Any alphanumeric string for session encryption PUBLIC_BETTER_AUTH_URL=http://localhost:5173 # For development, use http://localhost:5173. For production, use http://localhost:3002 # --- Google OAuth --- GOOGLE_CLIENT_ID=your_google_client_id GOOGLE_CLIENT_SECRET=your_google_client_secret # --- Websocket --- PUBLIC_WEBSOCKET_URL=ws://localhost:8080 # URL of the websocket server # --- Optional: AWS (for additional features) --- AWS_ACCESS_KEY_ID=your_aws_access_key AWS_SECRET_ACCESS_KEY=your_aws_secret_key AWS_REGION=us-east-1 # --- Optional: Polar.sh (for gem purchases / payments) --- POLAR_ACCESS_TOKEN=your_polar_access_token # API token from Polar.sh dashboard POLAR_WEBHOOK_SECRET=your_polar_webhook_secret # Webhook secret from Polar.sh PUBLIC_POLAR_PRODUCT_GEMS_500=your_product_id_500 # Polar product ID for 500 gems PUBLIC_POLAR_PRODUCT_GEMS_1300=your_product_id_1300 # Polar product ID for 1300 gems PUBLIC_POLAR_PRODUCT_GEMS_2800=your_product_id_2800 # Polar product ID for 2800 gems PUBLIC_POLAR_PRODUCT_GEMS_8000=your_product_id_8000 # Polar product ID for 8000 gems # --- Optional: OpenRouter (for AI features) --- OPENROUTER_API_KEY=your_openrouter_api_keyNotes:
- For production, change
PUBLIC_BETTER_AUTH_URLtohttp://localhost:3002or your deployed domain. - The
DATABASE_URLshould match your Postgres Docker container settings. - The
REDIS_URLshould match your Redis Docker container settings. - Polar.sh variables are optional and only needed for the gem shop (in-app purchases). Get your access token and product IDs from the Polar.sh dashboard.
- AWS and OpenRouter variables are optional and only needed for advanced features.
- For production, change
-
Install Dependencies
Set up the websocket server:
cd website/websocket bun installSet up the main website:
cd ../ npm install --include=dev
Running the Application
-
Start the websocket server
cd website/websocket bun run src/main.ts -
Start the main website (Development Mode)
In a new terminal:
cd website npm run devThe development server will be available at http://localhost:5173
Production Deployment
Using Docker (Recommended)
-
Build and start with Docker:
./build.shThis will automatically start all required services, including the Database, Redis and the websocket server, as Docker containers. You do not need to run the websocket server manually when using Docker Compose for deployment.
-
The app will be available at http://localhost:3002
Manual Deployment
-
Build the website:
cd website npm run build npm run preview -
Start the websocket server:
cd website/websocket bun run src/main.ts
License
This project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License (CC BY-NC 4.0). See the LICENSE file for details.
