Giter Club home page Giter Club logo

empathygame's Introduction

Deployment to SAP Cloud Platform

Test the latest running deployment: https://empathygame.cfapps.eu10.hana.ondemand.com/

One-time preparation

  1. Install Cloud Foundry CLI.
  2. Install MultiApps CLI plugin for CF.
  3. Install Cloud MTA Build Tool.
  4. Log on to our Cloud Foundry Environment through the CLI Source:

Compound deployment

Note: Does not yet work. It seems as the MTA build tool currently does not have a Python builder.

  1. Note: Only do this, if the GitHub repo here does not already contain a requirements.txt. Create a requirements.txt from the Pipfile through pipenv run pip freeze > requirements.txt.
  2. Download all the requirements to a vendor folder through pip download -d vendor -r requirements.txt --platform manylinux1_x86_64 --only-binary=:all: Note: The requirements.txt above might contain unrequired dependencies that lead to errors when downloading. Those dependencies can be removed with no harm.
  3. Create the mtar file by executing mbt build.
  4. Deploy the mtar file to HCP through cf deploy mta_archives/...mtar.

API deployment

  1. Note: Only do this, if the GitHub repo here does not already contain a requirements.txt. Create a requirements.txt from the Pipfile through pipenv lock --keep-outdated -d -r > requirements.txt`.
  2. Download all the requirements to a vendor folder through pip download -d vendor -r requirements.txt --platform manylinux1_x86_64 --only-binary=:all: Note: The requirements.txt above might contain unrequired dependencies that lead to errors when downloading. Those dependencies can be removed with no harm.
  3. Run cf push which uses the manifest.yml, runtime.txt and the requirements.txt. Note cf push uploads all files from the directory where it is executed from. It inspects .cfignore for files that are excluded from uploading.

UI deployment

  1. Create the mtar file by executing mbt build.
  2. Deploy the mtar file to HCP through cf deploy mta_archives/...mtar.

Local development

If you are developing on a Windows machine and have installed all dependencies, please use script run_windows_local.ps1 to start you local development environment.

Service layer (Python API backend)

  1. Create new Python project with your favourite IDE.
  2. Use Pipenv for dependency management.
  3. Clone the Github repo https://github.com/simachri/empathygame.
  4. Run pipenv install to install the dependencies locally.
  5. If you are using Windows and for example Powershell you need to set the environment variable:
# Set environment variable
$Env:PORT = "8080"

# Start python server
py ./api/main.py
  1. This is an example launch configuration from PyCharm: PyCharm run configuration

UI layer

For the first time, add @sap to you npm and install all dependencies:

# Add @sap to your npm
npm config set @sap:registry https://npm.sap.com // Only the first time
# Install all dependencies
npm install

After preparation you can start the application router by:

# Go to web folder
cd web
# Start development server
npm run dev

The service is reachable on localhost:3000 where the api is accessable on localhost:3000/api and the ui is accessable on localhost:3000/ui.

Knowledge Documentation

All findings during this projects are documented. Please visit

Topic Documentation
UI5 UI5 Knowledge

empathygame's People

Contributors

cloudweg avatar simachri avatar simonaas avatar

Watchers

 avatar

empathygame's Issues

Role assignments lost on rejoin

When rejoining an existing games, the assigned roles are not visible anymore for that player.
Steps to reproduce:

  1. Create a new game.
  2. Join the game as other player.
  3. Host: Assign the roles. Roles are visible now, also for the other player.
  4. Other player: Click on the home Icon to return to the main menu.
  5. Other player: Open the webapp again an click on "Resume".
  6. Other player: Assigned roles are not visible anymore.

GET service for /scenarios/{id}

Create an API GET service for ressource /scenarios/{id} according to the specification:

{
  "id": integer,
  "titel": string,
  "descr": "<markdown string>",
  "background_info": "<markdown string>",
  "decision_options": Array[
     {
       "id": integer,
       "titel": string,
       "descr": "<markdown string>"
     }
   ],
  "personas": Array[
    {
        "id": integer, 
        "name": string,
        "mandatory": boolean,
        "descr": "<markdown string>"
    }
  ]
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.