Giter Site home page Giter Site logo

sentenza / cats-http4s-crypto Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 1.0 248 KB

:moneybag: A sample microservice written in Scala using Cats, HTTP4S, Doobie that implements an application to compute Crypto/Fiat currency conversion rates

License: MIT License

Scala 100.00%
cats-effect circe doobie fs2-grpc hacktoberfest http4s pureconfig scala

cats-http4s-crypto's People

Contributors

scala-steward avatar sentenza avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

scala-steward

cats-http4s-crypto's Issues

Define Kubernetes liveness and readiness HTTP probes

Readiness

Readiness probes are designed to let Kubernetes know when your app is ready to serve traffic. Kubernetes makes sure the readiness probe passes before allowing a service to send traffic to the pod. If a readiness probe starts to fail, Kubernetes stops sending traffic to the pod until it passes.

Liveness

Liveness probes let Kubernetes know if your app is alive or dead. If you app is alive, then Kubernetes leaves it alone. If your app is dead, Kubernetes removes the Pod and starts a new one to replace it.

GCP GKE Kubernetes Readiness/Liveness probes

k8s liveness probe

Routes and their definition

GET -> "/h/healthz" ==> 200 text/plain  // Liveness probe
GET -> "/h/ready"   ==> 200 text/plain  // Readiness probe
# pods/probe/http-liveness.yaml
apiVersion: v1
kind: Pod
metadata:
  labels:
    test: liveness
  name: liveness-http
spec:
  containers:
  - name: liveness
    image: k8s.gcr.io/liveness
    args:
    - /server
    livenessProbe:
      httpGet:
        path: /healthz
        port: 8080
        httpHeaders:
        - name: Custom-Header
          value: Awesome
      initialDelaySeconds: 3
      periodSeconds: 3

Add doobie and flyway support

Description

Add flyway to handle database migrations and doobie to interact with RDBMS.

Acceptance criteria

  • Check that ...
  • Check that ...

Tasks

  • H2 in-memory relational database
  • Flyway migrations
  • doobie
  • Testcontainers for test support

Dataset needed for testing

TODO: adding the schema of the first table that will describe Cryptocurrencies/USD rates

Technical & Architecture Design

Describe Cryptocurrencies

At the very least add:

  • name
  • symbol
  • exchange rate

Also map the first 15 cryptocurrencies using Enumeratum

Example of a JSON representation of a single crypto asset

{

    "id": 1,
    "name": "Bitcoin",
    "symbol": "BTC",
    "slug": "bitcoin",
    "is_active": 1,
    "is_fiat": 0,
    "circulating_supply": 17199862,
    "total_supply": 17199862,
    "max_supply": 21000000,
    "date_added": "2013-04-28T00:00:00.000Z",
    "num_market_pairs": 331,
    "cmc_rank": 1,
    "last_updated": "2018-08-09T21:56:28.000Z",
    "tags": [
        "mineable"
    ],
    "platform": null,
    "quote": {
        "USD": {
            "price": 6602.60701122,
            "volume_24h": 4314444687.5194,
            "percent_change_1h": 0.988615,
            "percent_change_24h": 4.37185,
            "percent_change_7d": -12.1352,
            "percent_change_30d": -12.1352,
            "market_cap": 852164659250.2758,
            "market_cap_dominance": 51,
            "fully_diluted_market_cap": 952835089431.14,
            "last_updated": "2018-08-09T21:56:28.000Z"
        }

Example taken from CoinMarketCap Quotes/latest API

Basic structure

  • Create the essential project structure
  • Add the missing essential documentation

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.