Hochschule der Medien - Modul Software Praktikum (335138b) - Gruppe 1 - Sommersemester 2020
Pia Schmid
Pascal Illg
Kevin Eberhardt
Julius Jacobitz
Christopher Böhm
Niklas Denneler
- SW-Praktikum-Gruppe-1-SS2020 - Shopping App "iKaufa"
- Frontend - React ⚛️
- Fake-HTTP-Backend - Just for development purposes
- Backend - Python / Flask
- Database - MySQL
- Deployment - Google Cloud Plattform
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
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
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
- MySQL Community Server 8.0.20:
- Download the latest Community server for your OS from here https://dev.mysql.com/downloads/mysql/
- Setup the database and import our database dump
- 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:
This method will only work, if we assign you to the project team and grant you access.
./cloud_sql_proxy -instances=sw-praktikum-gruppe-1-ss2020:europe-west3:swpraktikum-sql=tcp:3306
- 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
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
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
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
See deployment guide for Frontend.
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)