Go to file
Bence Pőcze 18ddaa1da4
All checks were successful
mapguesser/pipeline/head This commit looks good
mapguesser/pipeline/tag This commit looks good
Merge pull request 'feature/update-to-ubuntu-2204' (!83) from feature/update-to-ubuntu-2204 into develop
Reviewed-on: #83
2023-09-27 22:21:33 +02:00
.vscode MAPG-203 add debugger config for NodeJS 2021-03-20 19:44:48 +01:00
cache MAPG-89 add cache folder that can hold cache files 2020-06-27 00:44:38 +02:00
database delete orphaned data migration 2023-09-26 00:11:09 +02:00
docker update ubuntu to 22.04 and php to 8.1 2023-09-27 22:12:49 +02:00
mail MAPG-185 consolidation of email templates 2020-07-05 17:37:02 +02:00
multi update package-lock.json to new format 2023-09-27 00:31:23 +02:00
public links should look good in footer 2023-09-26 00:48:05 +02:00
scripts remove deprecated scripts 2023-09-17 00:03:20 +02:00
src check email/username syntax before sending it to db 2023-09-26 00:43:14 +02:00
tests/Util add usernamegenerator 2023-09-25 19:56:57 +02:00
views add link to git repo to footer 2023-09-26 00:48:05 +02:00
.env.example MAPG-243 replace and adapt to soko-web 2023-04-07 21:10:14 +02:00
.gitattributes MAPG-81 update .gitattributes to store PNG files with Git LFS 2020-05-30 23:16:31 +02:00
.gitignore MAPG-203 add node_modules to gitignore 2021-03-17 23:09:07 +01:00
bitbucket-pipelines.yml MAPG-2020 run PHPStan with 1G memory limit 2021-01-01 22:34:32 +01:00
composer.json update soko-web 2023-09-27 22:12:49 +02:00
composer.lock update soko-web 2023-09-27 22:12:49 +02:00
docker-compose.yml update docker-compose 2023-09-17 00:04:16 +02:00
Jenkinsfile build docker image for multi arch 2023-09-26 22:20:49 +02:00
LICENSE.md MAPG-78 change license to AGPL and include the license 2020-05-30 01:42:14 +02:00
main.php use IRouteCollection in app container 2023-04-20 00:39:10 +02:00
mapg MAPG-243 replace and adapt to soko-web 2023-04-07 21:10:14 +02:00
phpstan.neon MAPG-199 add static code analysis step to pipeline 2020-07-05 22:51:36 +02:00
README.md fix cli user creation usage 2023-09-25 21:27:19 +02:00
USED_SOFTWARE MAPG-73 add license of Boostrap Icons 2020-05-30 17:39:45 +02:00
web.php error reporting should always be E_ALL 2023-09-26 23:49:36 +02:00

MapGuesser

Build Status

This is the MapGuesser Application project. This is a game about guessing where you are based on a street view panorama - inspired by existing applications.

Installation

Set environment variables

The .env file contains several environment variables that are needed by the application to work properly. These should be configured for your environment. Check .env.example for reference.

Important: DEV should NOT be set for production! See section Development if you want to use the application in development mode.

API keys

You should set the API keys that enable playing the game. Without these API keys the application cannot work well. To get Google API keys visit this page: https://console.developers.google.com/

Required Google APIs:

  • Maps JavaScript API: for the interactive maps and street views
  • Maps Static API: for the static map images
  • Street View Static API: for the backend metadata requests

Required API keys:

  • GOOGLE_MAPS_SERVER_API_KEY: this it used by the backend and should have access to Street View Static API
  • GOOGLE_MAPS_JS_API_KEY: this is used by the frontend and should have access to Maps JavaScript API and Maps Static API

Additionally, a tile provider is also needed for map editor. This should be configured by LEAFLET_TILESERVER_URL, LEAFLET_TILESERVER_SUBDOMAINS and LEAFLET_TILESERVER_ATTRIBUTION. You can find some providers here: https://wiki.openstreetmap.org/wiki/Tile_servers. OpenStreetMap's tile server is fine for testing. Example:

LEAFLET_TILESERVER_URL=https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png
LEAFLET_TILESERVER_SUBDOMAINS=abc
LEAFLET_TILESERVER_ATTRIBUTION="&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors"

Docker Compose

Create a docker-compose.yml file. The example code below assumes that .env is placed in the same folder.

version: '3'
services:
    app:
        image: git.esoko.eu/esoko/mapguesser:latest
        depends_on:
            mariadb:
                condition: service_healthy
        ports:
            - 80:80
            - 8090:8090
        volumes:
            - .env:/var/www/mapguesser/.env
    mariadb:
        image: mariadb:10.3
        volumes:
            - mysql:/var/lib/mysql
        environment:
            MYSQL_ROOT_PASSWORD: 'root'
            MYSQL_DATABASE: 'mapguesser'
            MYSQL_USER: 'mapguesser'
            MYSQL_PASSWORD: 'mapguesser'
        healthcheck:
            test: ["CMD-SHELL", "mysqladmin -u $$MYSQL_USER -p$$MYSQL_PASSWORD ping -h localhost || exit 1"]
            start_period: 5s
            start_interval: 1s
            interval: 5s
            timeout: 5s
            retries: 5
volumes:
    mysql:

Execute the following command:

docker compose up -d

And you are done! The application is ready to use. You can create the first administrative user with the following command after attaching to the app container:

./mapg user:add EMAIL USERNAME PASSWORD admin

Development

Set environment variables

.env.example should be copied to .env into the repo root. Only the variables for external dependencies (API keys, map attribution, etc.) should be adapted in. All other variables (for DB connection, static root, mailing, multiplayer, etc.) are fine with the default value. DEV=1 should be set for development!

Docker Compose

Execute the following command from the repo root:

docker compose up -d

And you are done! You can reach the application on http://localhost. The mails that are sent by the application can be found on http://localhost:8080. If needed, the database server can be directly reached on localhost:3306, or you can use Adminer web interface on http://localhost:9090

You might have to attach to the app container, e.g. for creating users, composer update, etc.


License: GNU AGPL 3.0. Full license text can be found in file LICENSE.