akka-react-cloudant
akka-react-cloudant copied to clipboard
A Soccer Dashboard created by scraping EPL website using Akka backend and ReactJS frontend and IBM Cloudant for object storage. IBM Cloud Foundry is used to host both frontend and backend app.
Soccer Dashboard with Akka and ReactJS
In this code pattern, we will create a Soccer Dashboard for English Premier League. The dashboard is created by web crawling the https://www.premierleague.com/ website. The back end utilizes Akka Actor, the front end is done with ReactJS and the data storage is using IBM Cloudant. And the code is deployed on Cloud Foundry.
Flow

- Create actors for Akka
- Expose Akka rest APIs
- Crawler actor will start crawling and store information into DB
- Deploy the app into IBM Cloud Foundry
- Ready for user to interact with the app
Included components
- Akka: A reactive stream toolkit
- ReactJS: A JavaScript library for building user interfaces
- Cloudant DB: A highly scalable and performant JSON database service
- Cloud Foundry: An open source, multi cloud application platform as a service project
Steps
We will be deploying to Cloud Foundry for exposing the APIs from Akka that connects to the IBM Cloudant Database.
Deploying Locally
- clone the project using
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.confinakka-epl/src/main/resources/application.conf - cd akka-epl
- Run
sbtfollowed by commandscompileandrun. Make sure you chooseCrawlingApp.scalaas running class. This will crawl https://www.premierleague.com/ website and save data as JSON to IBM cloudant database - In another command line window or tab, run
sbtfollowed by commandscompileandrun. Make sure you chooseSoccerMainController.scalaas running class - In another command line tab,
cd soccer-epl-uiand 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
- Login to CF using:
cf login --ssoand use one-time password from a given URL to login - Create a fat jar using:
sbt assemblyafter going to directory:/akka-epl - You need to have
manifest.ymlfile 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>andcf ssh <app_name>
Sample Output
