Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vPump — Virtual pump.fun Trading Game

Real-time virtual trading game for pump.fun tokens. Players get $1000 worth of vSOL, trade live coins via a server-authoritative bonding curve, climb the leaderboard, and earn real SOL payouts.

Architecture

Lovable (frontend)                   Home PC (backend)
  www.virtual-pump.fun                play.virtual-pump.fun
       |                                    |
       |  HTTPS API + WSS WebSocket         |
       +------- Cloudflare proxy -----------+
                                            |
                          +-----------------+----------------+
                          |                                  |
                    nginx :18080                        cloudflared
                       /api  -> rest-api :4001           (outbound tunnel)
                       /ws   -> game-ws  :4000
                          |
              +-----------+-----------+
              |                       |
        rest-api.js              game-ws.js
        (HTTP API)               (WebSocket)
              \__________  __________/
                         \/
                       Redis
                         |
                   ingestion.js
                  (pulls from Helius
                   and PumpPortal)

Stack

  • Frontend: React, Vite, hosted on Lovable
  • Backend: Node.js (Express, ws, ioredis)
  • Live data: Helius (Solana RPC + WebSocket), PumpPortal (pump.fun trades)
  • Storage: Redis
  • Edge: Cloudflare (DNS + proxy + tunnel)

Repo layout

.
├── backend/
│   ├── ingestion.js      # PumpPortal + Helius listeners → Redis
│   ├── game-ws.js        # WebSocket fanout to browser clients
│   ├── rest-api.js       # HTTP API (auth, trades, account, etc.)
│   ├── cleanup.js        # Periodic Redis cleanup
│   ├── reset-users.js    # One-shot user reset utility
│   ├── package.json
│   └── .env.example      # Template — copy to .env
├── frontend/
│   ├── src/
│   │   ├── App.jsx       # Main React app
│   │   ├── api.js        # REST API client
│   │   └── ws.js         # WebSocket client wrapper
│   └── package.json
└── infra/
    ├── nginx.conf        # Production nginx config
    └── cloudflared.yml   # Cloudflare Tunnel config (template)

Local development

# 1. Install Redis (Docker or native)
docker run -d -p 6379:6379 redis:alpine

# 2. Backend
cd backend
npm install
cp .env.example .env
# Edit .env with your Helius API key + JWT_SECRET
npm run dev   # runs ingest, ws, api concurrently

# 3. Frontend (in another terminal)
cd frontend
npm install
npm run dev
# Open http://localhost:5173

Production deployment

The production deployment runs on a Windows home PC behind Cloudflare Tunnel:

  1. Backend services run as Windows services via NSSM
  2. Redis runs in Docker Desktop with auto-start
  3. nginx routes /api/* and /ws/* to local Node services
  4. cloudflared establishes an outbound tunnel to Cloudflare → exposes play.virtual-pump.fun
  5. Frontend is hosted on Lovable at www.virtual-pump.fun

See infra/ for nginx and tunnel configs.

Useful scripts

# Backend
npm run dev              # all three services in one terminal
npm run ingest           # just ingestion.js
npm run ws               # just game-ws.js
npm run api              # just rest-api.js
npm run cleanup          # dry-run of stale-data cleanup
npm run cleanup:execute  # actually delete stale data
npm run reset-users      # dry-run user wipe
npm run reset-users:execute  # actually wipe users + leaderboard
npm run nuke-coins       # delete all coin data

Environment variables

See backend/.env.example for the full list. Required:

  • JWT_SECRET — random 64-char hex
  • HELIUS_ENHANCED_WSS — Helius transactionSubscribe URL with API key
  • ALLOWED_ORIGINS — comma-separated frontend origins
  • REDIS_URL — defaults to redis://localhost:6379

License

Private / proprietary.

About

Virtual pump.fun trading game

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages