Skip to content
 
 

Repository files navigation

Survev logo


Open-source recreation of 2D top-down battle royale surviv.io.

Development

Start the client dev server using pnpm dev:client and API / game servers with pnpm dev:server,
or traverse into client and server directories individually to run pnpm dev in each.

Accounts

Accounts are optional. You can set accountsEnabled to false in config.ts to disable them.
If disabled, you can skip the steps below.

First generate a private key and set encryptLoadoutSecret to it, this is used to encrypt loadouts.

openssl rand -base64 10

After installing PostgreSQL, start the service and create a database:

sudo -u postgres initdb --locale=C.UTF-8 --encoding=UTF8 -D /var/lib/postgres/data --data-checksums

systemctl enable --now postgresql.service

sudo -u postgres createuser survev
sudo -u postgres createdb survev -O survev

Then populate the database with the schema:

cd server

# Run this everytime you make changes to schema.ts.
pnpm run db:generate
pnpm run db:migrate

# Start the server
pnpm run dev
# or
# pnpm run dev:api
# pnpm run dev:game

To interact with the database through an interface:

pnpm run db:studio 

To wipe the database and start over:

# Set database permissions.
sudo -u postgres psql -c "ALTER USER survev WITH PASSWORD 'survev';"

# Wipe database.
pnpm run db:wipe

NOTE: Do not run this in production!

Caching

Caching is disabled by default. Set cachingEnabled to true in config.ts to use it.

Install Redis:

sudo apt install redis-server

Ensure Redis starts on boot and is running:

systemctl enable --now redis-server

Production

See HOSTING.md

About

Open Source Surviv.io Server

Resources

Code of conduct

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages