Welcome to the Pray1209 project monorepo. This repository contains the source code for the entire Pray1209 ecosystem, including the frontend, backend services, and smart contracts.
The project is organized into the following workspaces:
frontend/: The React-based web application (Vite + Tailwind CSS).backend/: The main Game Server and Relayer service (NestJS). Handles game logic, inventory, and blockchain transactions.pray-backend/: The Indexer and Data Service (NestJS + Prisma). Indexes blockchain events and provides data APIs.contracts/: Smart Contracts (Hardhat). Solidity contracts for the game economy.
- Node.js (v18+)
- npm (v9+) or pnpm
Install dependencies for all workspaces from the root:
npm installYou can run individual services using the root scripts:
-
Smart Contracts (Local Node)
cd contracts npx hardhat node # In a new terminal, deploy contracts: npx hardhat run scripts/deploy.ts --network localhost
-
Frontend
npm run dev:frontend
Access at
http://localhost:5173 -
Game Server (Backend)
npm run dev:backend
Access API at
http://localhost:3000 -
Indexer Service
npm run dev:indexer
Access API at
http://localhost:3001
Built with React, Vite, Tailwind CSS, and RainbowKit/Wagmi for Web3 integration.
- Location:
./frontend
Built with NestJS. Handles off-chain game logic (spirit system, drop rates) and relays transactions for gasless experiences.
- Location:
./backend - Database: SQLite (local dev) / PostgreSQL (prod)
Built with NestJS and Prisma. Indexes events from the blockchain to provide fast queries for user inventory and history.
- Location:
./pray-backend - Database: SQLite (local dev)
Hardhat project containing the Solidity smart contracts: GraceToken, SacredItems, HolyRelics, etc.
- Location:
./contracts
- Monorepo: This project uses npm workspaces. Dependencies are hoisted to the root
node_moduleswhere possible. - Environment: Check
.envfiles in each workspace for configuration.