Skip to content
/ wyw Public

WhatYouWatched - Project for Service Oriented Software Engineering 2019/20 @UnivAQ

Notifications You must be signed in to change notification settings

elbowz/wyw

Repository files navigation

WHATYOUWATCHED - SOSE 2019/20

WYW

What it is

WYW is a very simplified version of trakt.tv.
It's been written as a playground for a scalable microservices architecture, based on choreography communication pattern.

The stack:

  • Backend: Docker(-compose), SpringBoot, SpringCloud, Eureka, Zuul, Ribbon, Feign, Hystrix, Apache CXF and MariaDB
  • Frontend: Vue.js and Bootstrap(Vue)

Install

# install need build and deploy package
$ apt-get install docker-compose maven npm
# build backend
$ mvn clean package
# build frontend
$ cd frontend
$ npm install
$ npm run build
$ cd ..
# run the containers
$ docker-compose -f docker-compose.yml [-f docker-compose.prod.yml] up [-d]

Documentation

Typically development flow

Start containers

A key for OMDB API is required if you want to obtain film ratings. Before running, export the key with:

export OMDB_API_KEY=MY_KEY

  • Normal:
    docker-compose up (-d)
  • Development (eg. JPDA):
    docker-compose -f docker-compose.yml -f docker-compose.dev.yml up

note: see docker-compose.yml for more information. Tomcat port change between 4000-4100, use docker ps to spot it

Build and Deploy

  • Whole project:
    mvn (clean) package from the project root
  • Single microservices:
    • mvn -pl microservices/person package or
    • cd microservices/<name> && mvn package

note: tomacat auto-reload the new war after a mvn package...if doesn't happen restart it (docker-compose restart <service-name>)

Container scaling

  • Scale on start:
    docker-compose up --scale person-ws=3
  • Scale after start:
    docker-compose up
    docker-compose scale person-ws=3

Services

All microservices are visible by eureka localhost:8761 and localhost:8761/eureka/apps for display what others microservices can see (xml format).

Frontend

DB Web Client (Adminer)

url: http://localhost:5000/
server: eg. person-db
user: sose
pwd: sose
db: sosedb

Utils

  • Archetype (generate a new REST web service) (readme.md)
  • Script for init the wyw DB scraping the IMDB website. (readme.md)
    utils/imdb2sql.py

Notes

All WYW users password is qwerty.
Add needed dependencies to the root pom.xml or the children ones.
Create needed services/networks to the docker-compose.yml.

Development Guidelines