Get Started
Simplest approach: We'll walk you through how to get started developing with the Godot app and plug into the Mirror Official server (our deployed mirror-web-server
). This gives you access to your full accounts, assets, Spaces, etc. In The Mirror (our web app). With it, you can start developing without needing to run the full stack locally.
- Git clone the repository:
git clone https://github.com/the-mirror-gdp/the-mirror.git
(you do not need to clone with submodules; they are optional) - Download the precompiled Mirror fork of Godot engine (required to use)
- Windows: Download
- Mac: Download Note: very buggy; taking contributions for fixes :) On Mac you will see a zip file; extract it and open the editor binary with CMD + Right-Click then select the Open option.
- Linux: Download
- Open the Godot editor (The Mirror fork you downloaded in step 2), click import, and choose the
project.godot
from the/mirror-godot-app
folder. - Hit play once it loads!
Docker Approach
You don't need Docker if you're only running mirror-godot-app
locally. You can still hit our deployed Mirror Official server instance via the top-right environment dropdown (select official
; see pic below) and login with your Mirror account to manage assets, saved data, etc. The Docker approach is for running the full stack yourself (including mirror-web-server
locally, not just the mirror-godot-app
).
Docker isn't required, but is recommended for ease to run the web server and other dependencies in a consistent environment across different hardware.
How to Run the Full Stack with Docker (Windows)
- Install Docker for Windows and git bash, which comes with
git
or WSL (git bash is easier)
Download and proceed with instructions from: https://docs.docker.com/desktop/install/windows-install/ Setup was tested with WSL2 (defualt for not Professional versions of Windows)
-
Clone the main repo:
git clone git@github.com:the-mirror-gdp/the-mirror.git
. -
Configure your
./mirror-web-server/.env
by duplicating your.env.example
file and renaming it to.env
. Use the defaults where needed and plug in your own env variables where necessary. -
Create a new Firebase project and download your service account JSON file and replace the contents of file
/mirror-web-server/firebase-creds-example.json
with the contents of the downloaded file , which will plug themirror-web-server
into your own Firebase instance. This is required if you're runningmirror-web-server
locally sincemirror-web-server
requires admin permissions. -
From git bash or WSL, from
YOUR_PROJECT_DIR/mirror-web-server/
, rundocker compose up
If you run into an error like this:
ERROR: for the_mirror_server Cannot start service mirror-server: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "./auto-migrate.sh": permission denied: unknown
Try running chmod +x auto-migrate.sh
from the mirror-web-server
directory.
-
Use your godot-app with
local
preset in top right corner of Godot editor. -
Localhost Space should load with terrain and environment
Troubleshooting
1. I messed up & I can't login
Probably issue with mirror-server configuration files
Remember to run docker compose build
after every change to the .env configs! The updates to .env
won't apply otherwise.
2. My localhost space is empty (not even a terrrain and environment)
Something went wrong with your migration of DB. After fixes to your dump file, make sure to remove the container running mongodb (otherwise init script restoring dump will not launch)
3. My database is not empty even though it should be.
Your mongo container maybe stopped but it is not removed. Try docker rm mongo_container_id
. If this does not help try docker system prune
Other
Connection String for MongoDB Compass (the GUI for MongoDB):
mongodb://root:example@localhost:27017/themirror?retryWrites=true&w=majority&authSource=admin
Download MongoDB Compass here.
Creating a New Dump of the Database
- Find container ID for Mongo:
docker ps
- Enter the container bash:
docker exec -it CONATAINER_ID /bin/bash
- Inside container:
cd / && mongordump --uri="mongodb://root:example@localhost:27017/themirror?retryWrites=true&w=majority&authSource=admin" -d themirror --archive=/database_dump/dump.archive
- Now we have a dump but it's inside a container. Run in other WSL shell:
docker cp CONTAINER_ID:dump.archive .
Your dump should be in current dir called dump.archive
- Connecting to different localhost space in godot-app
In the main folder of godot-app find project.godot
and edit:
[editor]
run/main_run_args="%command% --server --space NEW_SPACE_ID --mode edit --uuid localhost"
You can also edit it using godot editor. Go to Project
-> Project Settings
. Enable Advanced Settings
Checkbox.
Go to Editor
-> Run
Category and change Space ID in Main Run Args
field.