Skip to content

Local Development

In Idlerun’s current state, the following services have a deployed development environment:

  • Hagrid: Game Server

For any other applications or services you require, you will need to run them locally for development.

Interdependencies

In order for an application or service to operate properly, it may have dependencies on other services. These are outlined as follows:

  • DirectoryDatabase (Postgres)
    • DirectoryExodia (API)
      • DirectoryHagrid (Game Server)
        • Portal (Game Client)
      • Warden (Admin Panel)
  • Architecture (Deprecated)
  • Docs (Documentation Site)

Setting up your environment

For each application that you wish to run locally, please refer to their respective README.md files to get started. This guide provides a high-level overview to help you get going.

Exodia and Database Setup

Having a local database is first step to getting started; Idlerun uses Postgres for its database. Download and install an instance of Postgres on your machine and create an empty database and a user with all permissions.

Once you have created an empty local Postgres database, you’re ready to setup Exodia and perform the following:

  1. Clone the Exodia repository
  2. Install the necessary dependencies with npm install
  3. Follow the instructions in README.md to setup your .env.local file
  4. Generate a Prisma client for your local instance with prisma generate
  5. Seed your database using prisma db seed
  6. Run your local API using npm run start

If you’ve followed the instructions correctly and properly configured your environment variables, you should have a working local API that is pointing to your own local database which has been seeded with the necessary data to have a “clean slate” environment.

Hagrid Setup

Hagrid is the game server that handles client connections, game events, notifications, matchmaking, and more! The system runs on Colyseus and uses WebSockets as its underlying transport architecture.

Setting up Hagrid for local development is fairly straightforward:

  1. Clone the Hagrid repository
  2. Install the necessary dependencies with npm install
  3. Follow the instructions in README.md to setup your .env.local file
  4. Run your local game server using npm start

Once complete, your console will confirm the server is running and you can update your game client to point at your local server instead.