This repository contains the MongoDB Leafsteroids
demo.
Follow the instructions in this README to run a clone of your own to get your MongoDB development jump started.
The demo and repository consist of the following parts:
- Game Client (Unity3D, .NET, C#)
- Game Server (ASP.NET Web API, .NET, C#)
- Website (Blazor Server Application, .NET, C#)
- Create a new Atlas project
- Create a new cluster (M0)
- Create a new database
Leafsteroids
:- Create a collection
config
and add thedeployment/templates/config.template
document to it. - Create a collection
events
and add thedeployment/templates/event.template
document to it.
- Create a collection
You can adjust the config to change how the game behaves and add more events to have several to choose from.
To get started, it is recommended to use those default documents.
- Switch into the
rest_service
folder. - Make a copy of the
.env.template
file and call it.env
. - Grab the connection string for your Atlas cluster and
exchange it in the
.env
file in therest_service
folder. - Also replace the
DATABASE_NAME
in the.env
file with the database name you created earlier.
dotnet run --urls "http://0.0.0.0:8000"
Open http://127.0.0.1:8000/ to verify the REST service is running.
- Switch into the
website
folder. - Make a copy of the
.env.template
file and call it.env
. - Grab the connection string for your Atlas cluster and
exchange it in the
.env
file in thewebsite
folder. - Also replace the
DATABASE_NAME
in the.env
file with the database name you created earlier.
dotnet run --urls "http://0.0.0.0:8001"
Open http://127.0.0.1:8001/ to verify the website is running.
- Switch into the
game_client
folder. - In the
Assets
folder, make a copy of the.env.template
file and call it.env
. - Adjust the IP in the
.env
folder to yourrest_service
. Leave as is when running locally. - Run the game.