jtojnar / pengu

MIT License
2 stars 1 forks source link

pengu

pengu is lightweight web chat built with HTML 5 resembling Club Penguin.

Prerequisites

The project uses npm to install dependencies and Node.js to run. Download them by running Nix’s nix-shell command, using your system’s package manager or from their website.

Optionally, you will also need PostgreSQL database server if you want Pengu to remember player inventories across restarts.

Installation

  1. Create the following table in PostgreSQL database and set DATABASE_URL to correct connection string.
CREATE TABLE "penguin" (
    "name" character varying NOT NULL PRIMARY KEY,
    "closet" json DEFAULT '{}' NOT NULL,
    "clothing" json DEFAULT '[]' NOT NULL,
    "registered" timestamptz DEFAULT current_timestamp NOT NULL,
    "banned" boolean DEFAULT false NOT NULL,
    "group" character varying DEFAULT 'basic' NOT NULL
);
  1. Run npm install.
  2. Compile assets using npm run build.
  3. Start with npm start, the game will run on port set by PORT env variable.

Configuration

pengu uses the following environment variables for configuration:

Development

The front-end of Pengu is stored in the assets/ directory and needs to be rebuilt when it is changed. You can use npm run build command to do that, or npm run dev if you want it to rebuild automatically on changes. Its build artefacts end up in the client/ directory, from where the server will serve them.

License

pengu source code is made available under MIT license.