Giter Club home page Giter Club logo

bfh-pcws's Introduction

PrintCodeWebService (PC-WS)

Main service for the BFH AppTrans exercise.

Live demo (with mock external systems) at https://bfh-pcws-mock.herokuapp.com/swagger-ui/index.html

See also https://github.com/SamuelBucheliZ/bfh-apptrans-exercise/blob/master/README.md

Versions

PC-WS is known to work with the following versions

  • Java: 11
  • Tomcat: 9
  • PostgreSQL: 10

Installation

The relevant artifacts can be found here https://github.com/SamuelBucheliZ/bfh-pcws/releases/tag/latest-war

  1. Set up database using setup_db.sql.
  2. Set up cronjob to run transfer_logs.sh every minute.
  3. Deploy pcws.war in Tomcat.

Note: PC-WS provides a "mock" configuration (see below) which allows to run it in a demo mode without need for a database or external systems. This can be used to initially test the Tomcat setup, i.e., to directly start with step 3 above.

Configuration

The PrintCode-WebService can be configured using the following environment variables

  • SPRING_PROFILES_ACTIVE: Either real (to use the actual external services and database) or mock (to use mocked services). For the exercise, eventually, the real configuration must be used.
  • PCWS_DATALOG_DIRECTORY: Absolute path to the directory the service should write the datalogs into, e.g., /datalogDirectory.
  • PCWS_ACCOUNT_SERVICE_URL: URL of the account service, you can use https://bfh-paketblitz-account-service.herokuapp.com.
  • PCWS_DATASOURCE_JDBC_URL: JDBC URL of the database, this has the form jdbc:postgresql://<hostname>:<port>/<database-name>.
  • PCWS_DATASOURCE_USERNAME and PCWS_DATASOURCE_PASSWORD: Credentials to access the database.

The shell script to transfer the logs can be configured using the following environment variables

  • PCWS_DATALOG_DIRECTORY: Location of the datalog files to send.
  • PCWS_DATALOG_SERVICE_URL: URL of the datalog service, you can use https://bfh-paketblitz-datalog-service.herokuapp.com.

How to build

Build war for Tomcat deployment (for the exercise)

mvn clean package -Pwar

Build standalone jar (for demo on Heroku)

mvn clean package -Pjar

bfh-pcws's People

Contributors

samuelbucheliz avatar

Stargazers

Aires Marques avatar

Watchers

James Cloos avatar

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.