online multiplayer implementation
This project is an unofficial realtime multiplayer implementation of the card game The Thing From The Future: http://situationlab.org/project/the-thing-from-the-future/
Up to 6 players can play together to brainstorm ideas.
- adjust server URL
frontendRoot
in the configuration filefrontend/src/environments/environment.prod.ts
- build the frontend and backend containers:
docker-compose build
- start all the containers:
docker-compose up
- (Optional) Configure reverse proxy for SSL
- adjust server URL
frontendRoot
in the configuration filefrontend/src/environments/environment.prod.ts
to match your azure Web App URL. The URL ishttps://YOUR_AZ_APP_NAME.azurewebsites.net
(make sureYOUR_AZ_APP_NAME
is available in Azure first.) - Build the frontend and backend containers and publish them to docker hub.
- For frontend inside the
frontend
directory:docker build -t YOUR_DOCKER_HUB_USERNAME/tftf-frontend .
and push withdocker push YOUR_DOCKER_HUB_USERNAME/tftf-frontend
- For backend inside the
backend
directory:docker build -t YOUR_DOCKER_HUB_USERNAME/tftf-backend .
and push withdocker push YOUR_DOCKER_HUB_USERNAME/tftf-backend
- For frontend inside the
- Adjust the
docker-compose-az.yml
to use your custom containers. - Create a Web App (App Services) from the azure portal. Choose docker container as publish type.
- Upload your
docker-compose-az.yml
file and use it to create the web app.
The app uses mongodb for storage and nestjs as a backend framework. Angular is used for the frontend.
Requirements
- Node 16 LTS
- yarn package manager
The backend uses mongodb for storage. You will need an instance for development. You can use the following docker-compose.yml
template to start a dev database:
version: "3.9" # optional since v1.27.0
services:
mongodb:
image: mongo
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: secret
ports:
- "27017:27017"
Adjust the backend config to use your local dev instance inside backend/src/app.moudule.ts
:
MongooseModule.forRoot('mongodb://root:secret@localhost', {dbName: "nest"}),
To start the backend, inside the backend
directory, install the project dependencies:
yarn install
Then start the backend with:
yarn run start:dev
To start the frontend, inside the frontend
directory, install the project dependencies:
yarn install
Then start the frontend with:
yarn run start
Then access the game on http://localhost:4200