Skip to content

peregin/velocorner.com

Repository files navigation

CircleCI Maintainability License: MIT Issues Swagger Validator Docker Pulls StackShare Scala Steward badge

velocorner.com

The web application provides metrics for cycling and running (or for other kind of sports) activities. The statistics page compares yearly aggregated data, such as distance, hours ridden, elevation gained and shows year to date series as well. The yearly data is presented as a heatmap, so it is easy to compare the efforts for a given period of the year. Athletes' data feed is collected via the Strava API. It helps you find the best component prices via the product aggregator page.

Tech Stack

Building the cycling platform provides a good opportunity to experiment and learn new technologies or languages in a "live" environment. The infrastructure is built following the "Infra as code" principle, the FE is written in React, web gateway in Scala with the Play Framework exposing the contract with Swagger. Services are communicating via http with each other, exploring various languages and technologies:

  • web-app with Scala and Play Framework, ZIO
  • web-front with React
  • crawler-service with Scala, http4s, cats-effect, circe (Typelevel stack)
  • exchange-rate-service with Rust (extracted in a separate repository)
  • data-provider with various database support postgresql, orientdb, rethinkdb, etc
  • data-search - with zinc-search a lightweight replacement for elasticsearch
  • user-service - with Java and Spring Boot
  • weather-service - with Kotlin
  • health-check-service - with Go

logo Visit the page at http://velocorner.com, I'd love to hear your feedback!

CI/CD Flow

CI/CD

Infrastructure

Follows the infrastructure as code approach, see more details in this repo .

Infrastructure

Local Setup

Mirror Infrastructure

Start local infrastructure and deploy the stack

Individual Services

Start database

# start and import database
./script/start_psql.sh
./script/import_psql.sh ~/Downloads/velo/velocorner/backup/psql-202008031826.sql.gz

# start web application
sbt -Xms512M \
    -Xmx2048M \
    -Xss1M \
    -XX:+CMSClassUnloadingEnabled \
    -Dhttp.port=9001 \
    -Dconfig.file=/Users/levi/Downloads/velo/velocorner/local.conf \
  "project web-app" run

Code

Some useful plugins

sbt unusedCode
sbt "scalafix WarnUnusedCode"