A centralized "Bank and Identity" layer for game backends with secure ledger, lock-and-settle contracts, and lobby matchmaking.
- Node.js 20+
- PostgreSQL
- Firebase Project (for authentication)
- Install dependencies
npm install- Configure environment
cp .env.example .env
# Edit .env with your credentials- Setup database
npm run db:generate
npm run db:push- Start development server
npm run devThis is a monorepo with the following packages:
| Package | Description |
|---|---|
@pluto/gateway |
Orchestration layer, routing, caching |
@pluto/bank |
Ledger, contracts, balance management |
@pluto/lobby |
Matchmaking with SSE broadcasting |
@pluto/identity |
Firebase auth, display names |
@pluto/dice-royale |
Sample game for testing |
@pluto/shared |
Common types, errors, utilities |
All packages are deployed as a single Node.js instance on Railway.
See docs/api.md for complete API documentation.
Import postman/pluto-hub.postman_collection.json into Postman for testing.
pluto-project/
├── packages/
│ ├── shared/ # Common utilities
│ ├── gateway/ # API gateway
│ ├── bank/ # Financial operations
│ ├── lobby/ # Matchmaking
│ ├── identity/ # Authentication
│ └── dice-royale/ # Sample game
├── prisma/
│ └── schema.prisma # Database schema
├── src/
│ └── main.ts # Entry point
├── docs/
│ └── api.md # API documentation
├── postman/
│ └── pluto-hub.postman_collection.json
└── devops/ # Configuration files
├── firebase.json
└── postgress.json
# Run development server
npm run dev
# Run tests
npm test
# Generate Prisma client
npm run db:generate
# Push schema to database
npm run db:push
# Open Prisma Studio
npm run db:studio- Create a new Railway project
- Add PostgreSQL plugin
- Connect your GitHub repository
- Set environment variables:
DATABASE_URL(from PostgreSQL plugin)FIREBASE_SERVICE_ACCOUNT=<content-of-your-firebase-json>JWT_SECRET=<your-secret>HMAC_SECRET=<your-secret>
MIT