# Installation

To install Destroyer2, start by cloning the code:

git clone https://github.com/umcconnell/destroyer2.git
cd destroyer2

REQUIREMENTS

If you are planning to deploy or develop Destroyer2 with Docker™ containers, make sure you have docker and docker-compose installed on your machine. Check out the Docker™ docs (opens new window) for installation instructions.

To deploy or develop Destroyer2 without Docker™, you'll need node with npm and redis installed on your machine. Check out the Node.js™ (opens new window) and Redis™ (opens new window) docs respectively for installation instructions.

# Production

If you are using Docker™ containers to deploy Destroyer2, you are done! Head over to the Docker instructions to quickly deploy.

For a plain installation with npm, run this command to install all production dependencies:

npm install --only=production

Assuming you have Redis™ installed, you can now start the database in a different shell:

cd path/to/destroyer2/db/
redis-server
# If you have a redis configuration file, instead run:
# redis-server redis.conf

Head back to your first shell and start the Node.js™ server:

npm run start

Open http://localhost:8080 (opens new window) in your browser to start playing 🚀

# Development

To develop Destroyer2 you must install all dependencies, including the developer dependencies:

npm install

Head over to a new shell to start the database:

cd path/to/destroyer2/db/
redis-server
# If you have a redis configuration file, instead run:
# redis-server redis.conf

Back in the first shell, you can then start the game server:

npm run dev

Navigate to http://localhost:8080 (opens new window) to get started!

# Docs

All docs are contained in the docs/ folder. To improve the docs, first install all required dependencies in the folder:

cd docs/
npm install

Then, run the Vuepress dev server. This command can also be run from the project root once all dependencies have been installed:

npm run docs:dev

No need to reload while writing as Vuepress offers hot reloading 😄

Visit http://localhost:8000 (opens new window) to see the docs.