GithubHelp home page GithubHelp logo

piotrkluch / reactive-university-project Goto Github PK

View Code? Open in Web Editor NEW

This project forked from szymonlyszkowski/reactive-university-project

0.0 1.0 0.0 332 KB

Scala 61.30% Java 12.84% CoffeeScript 4.94% CSS 4.69% HTML 13.38% Shell 2.85%

reactive-university-project's Introduction

Reactive-university-project

Running the project in a simple way

sbt run

Then navigate to (http://localhost:9000/) to see the results.

Running the project on Docker

First, you need to compile the sources and create a docker image. In shell, run:

sbt compile
sbt docker:publishLocal

Then verify that reactive-stocks:latest image was created by typing:

docker image

Finally, you can run your new image by:

docker run -p 9000:9000 reactive-stocks:latest

or just run the whole project with

docker-compose up

Then navigate to (http://localhost:9000/) to see the results. You might need to replace localhost with IP of your docker-machine/boot2docker.

Example of akka usage can be found:

Java:

app/akka/demo/HelloAkkaJava.java
test/akka/demo/HelloAkkaTest.java

Scala:

app/akka/demo/HelloAkkaScala.scala
test/akka/demo/HelloAkkaSpec.scala

Database connection

Database

Chosen database is MySQL (version used for development: 5.6.30) To configure stock-root user:

GRANT ALL PRIVILEGES ON *.* TO 'stock'@'localhost' WITH GRANT OPTION;
SET PASSWORD FOR 'stock'@'localhost' = PASSWORD("stock");

Before starting application, remember about creating database stock_exchange and table quotation

CREATE DATABASE IF NOT EXISTS `stock_exchange`;
USE `stock_exchange`;

CREATE TABLE IF NOT EXISTS `quotation` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `company_name` varchar(255) NOT NULL,
  `opening` float NOT NULL,
  `max` float NOT NULL,
  `min` float NOT NULL,
  `closing` float NOT NULL,
  `change_percentage` float NOT NULL,
  `volume` int(11) NOT NULL,
  `date` date NOT NULL,
  PRIMARY KEY (`id`)
);

Complete SQL file with inserts: stock_exchange.sql.

DB Initialisation

This is done by docker-compose when creating the DB docker image. It runs stock_exchange.sql contents on the DB. If you need to recreate your DB, just run:

docker rm reactiveuniversityproject_db_1 && docker rmi reactiveuniversityproject_db

This will remove the appropriate container and its associated image. The next time you run docker-compose up, a new image will be created.

ORM

As for ORM, [http://slick.lightbend.com/docs/] in version 1.1.0 has been chosen.

Information about connection is located in file conf/application.conf.

Demonstration

localhost:9000/quotations - presents list of 'ALIOR' quotations, allows to add new and delete existing ones

TODOs

  • Provide an Akka cluster (seed/workers)

reactive-university-project's People

Contributors

szymonlyszkowski avatar lkluss avatar

Watchers

 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.