akka-react-cloudant
A Soccer Dashboard created by scraping EPL website using Akka backend and ReactJS frontend and IBM Cloudant for object storage
Architecture
Components
The project consists of 3 components
- Data collection using akka-actors
- REST API using akka-http
- ReactJS front end (which this blog doesn't cover)
Steps
- clone the project usig
git clone [email protected]:sanjeevghimire/akka-react-cloudant.git
- Login to IBM Bluemix account, create a IBM cloudant database and save the credentials and add those credentials in
application.conf
inakka-epl/src/main/resources/application.conf
- cd akka-epl
- Run
sbt
followed by commandscompile
andrun
. Make sure you chooseCrawlingApp.scala
as running class. This will crawl http://premierleague.com website and save data as JSON to IBM cloudant database. - In another commandline window or tab, Run
sbt
followed by commandscompile
andrun
. Make sure you chooseSoccerMainController.scala
as running class - In another command line tab,
cd soccer-epl-ui
and runnpm start
- you can now access the Dashboard in url:
http://locahost:3000
Deploying to Cloud Foundry
In order to deploy to Cloud Foundry, make sure you have an IBM Bluemix account. And you have to install the following to get started.
- Install Cloud Foundry CLI https://github.com/cloudfoundry/cli
- Login to CF using: cf login --sso and use one-time password from a given URL to login
- Create a fat jar using: sbt assembly after going to directory: /akka-epl
- You need to have manifest.yml file as in the code repository to push it to the cloud foundry app
- You can push the app using command: cf push
- For Debugging you can see the logs to make sure your app is successfully pushed or not using cf logs akka-react-cloudant --recent
- you can also ssh to the application machine using command: cf enable-ssh <app_name> and cf ssh <app_name>