niklasden / SW-Praktikum-Gruppe-1-SS2020

Hochschule der Medien - Modul Software Praktikum (335138b) - Gruppe 1 - Sommersemester 2020

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SW-Praktikum-Gruppe-1-SS2020 - Shopping App "iKaufa"

Hochschule der Medien - Modul Software Praktikum (335138b) - Gruppe 1 - Sommersemester 2020

Contributors

Pia Schmid
Pascal Illg
Kevin Eberhardt
Julius Jacobitz
Christopher Böhm
Niklas Denneler

Table of Contents

Frontend - React ⚛️

All code is located under /frontend.
As advised per the project requirements we used React & Material-UI.
To run it install the packages inside the package.json, via your package manager of choice and run it.
NodeJS comes with the Node Package Manager, which will install all missing dependencies from the package.json file

cd /frontend 
npm install 
npm start

Fake-HTTP-Backend - Just for development purposes

Testing for the frontend was done via the fake-http-backend.
This is only useful for the development purposes. Files are located inside /http-fake-backend. Install via your favourite package manager and run it afterwads. It will expose a temporary HTTP Backend @ http://localhost:8081 To change the config see config.js. To change add new routes / change current routes see the python-mockbackend-config.js inside under /server/api/

cd /frontend/http-fake-backend
npm install 
npm start

Backend - Python / Flask

We advise you to set up a python virtual envoirnment, to keep python clean.
This codes is tested under python version 3.7
All code is located under /src.
To run the application on your own device, clone the repo.
Activate your virtual envoirnment, via the activate script. Install the requirements inside requirements.txt & run the application by launching main.py

cd /src
pip install -r requirements.txt     
python main.py    

Database - MySQL

  • MySQL Community Server 8.0.20:
  • Google Cloud SQL: This requires the Google Cloud SDK & Google Cloud Proxy. See Google Documentation for install methods. Connection String for Proxy to get secure access to the Google Environment:
    ./cloud_sql_proxy -instances=sw-praktikum-gruppe-1-ss2020:europe-west3:swpraktikum-sql=tcp:3306
    
    This method will only work, if we assign you to the project team and grant you access.
  • Docker:
    • This method obviously requires Docker and Docker-compose
    • Run the docker-compose up inside the /db directory.
    • Connect to the phpmyadmin dashboard under your localhost and import the database dump
    • Change the connection parameter inside the src/mapper.py to fit your envoirnment

Depending on the configuration you chose, you need to update the connection string inside the mapper.py / ShoppingAPI.js

Deployment - Google Cloud Plattform

Our live version is hosted using the Google App Engine. For the deployment the routes need to be changed from localhost to the deployment url. (inside ShoppingAPI.js / config.js) http://ikaufa.com

Deployment on Google Cloud - Backend

Google App Engine Standard Envoirnment is on Python Version 3.7
Google Cloud SQL is on MySQL 5.7, access is provided via sqlconnector.
See .yaml for extra config.
/ Navigate to /src and run the command below
Commands of use:

gcloud app deploy

Deployment on Google Cloud - Frontend

Google App Engine Standard Envoirnment is on NodeJS Version 11
See .yaml file for extra config. React requires an extra build step to generate static files for deployment, which are located in a seperate folder.
This needs to be done after every change to the js files.

To update deployed version of the fronentd code see commands below.
Navigate to /frontend and run the commands below: Commands of use:

npm run build
gcloud app deploy

Deployment on Google Cloud - Frontend-Report

See deployment guide for Frontend.

Routing on Google Cloud

We decided to use a micro service architecture with seperate services for all applications.
This allows us to deploy changes to the services individually and we make use of the cloud native scaling capabilities Google provides us with.
Using the dispatch.yaml we redirected routing to the services on a subdomain level.
This results in the following 3 URLs:

http://ikaufa.com (hosts main frontend)
http://backend.ikaufa.com (hosts backend)
http://report.ikaufa.com (hosts report client)

About

Hochschule der Medien - Modul Software Praktikum (335138b) - Gruppe 1 - Sommersemester 2020

License:Other


Languages

Language:JavaScript 69.1%Language:Python 28.0%Language:TSQL 1.5%Language:HTML 1.0%Language:CSS 0.4%