- New Postgres table schemas - Using Stored Procedures with transactions that validate business logic - User Ids now use UUID - Updated and simplified all endpoints to call the stored procedures Notes: There are still a few things missing that broke because of the migration, in particular, because we moved a lot of the business logic into the database, we now require that certain data that lived in the game-config.json to be present in the database as well, to prevent cheating and truly have a single source of truth.
729 B
729 B
#Moon Miners
Getting Started
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
Dotenv
Fill the following out:
DB_USER=
DB_PASSWORD=
DB_HOST=
DB_PORT=
DB_DATABASE=
API Endpoints
POST /user/login
check if user exists
GET /user/USER_ID/stakes
get stake event
POST /user/USER_ID/stakes/claim
claim stake
POST /user/USER_ID/stakes/start
start stake
GET /user/USER_ID/bank-account
get balance
PUT /user/USER_ID/bank-account
sell resource
GET /user/USER_ID/inventory-items
get inventory items
POST /user/USER_ID/inventory-items
buy item
GET /user/USER_ID/staking-sources
get staking sources
POST /user/USER_ID/staking-sources
create staking source