Client

Primodium Client

The Primodium client is our interface for interacting with the Primodium contract suite.

Enter Screen

Introduction

The Primodium client is available in the /packages/client (opens in a new tab) directory in the @primodiumxyz/primodium (opens in a new tab) monorepo.

This client imports all necessary packages from the rest of this monorepo to be able to render the Phaser (opens in a new tab) game, with a React (opens in a new tab) UI on top of it, interact with the contracts, and sync the state with the indexer database (or RPC updates).

Running the game

Follow the README in the root of th to install the necessary dependencies and configure the environment.

pnpm dev
# or from root, provided that the backend is running
pnpm dev:client

Then navigate to http://localhost:3000 (opens in a new tab) in your browser.

Organization

This package uses the core package (opens in a new tab) for all the logic, the engine package (opens in a new tab) for the Phaser scene management (api, creating scenes, rendering chunks), the game package (opens in a new tab) for Phaser, and the assets package (opens in a new tab) for the assets.

It is dedicated to the various UI components, hooks, and utilities.

dist - "Compiled files for distribution"
src - "Source files"
├── __tests__ - "Client tests using vitest"
├── ampli - "Amplitude analytics setup"
├── components - "All of the UI components"
│   ├── core - "Main template components"
│   ├── hud - "Components related to the game HUD"
│   ├── shared - "Components shared across various screens"
│   └── transfer - "Components related to account"
├── config - "Core and Wagmi config"
├── contractCalls - "Calls to interact with the contracts"
├── hooks - "Various hooks"
├── screens - "React screens"
├── systems - "Game systems (session account)"
└── util - "Utility functions and cheatcodes"