Git Product home page Git Product logo

mobile-carrier-bot's Introduction

mobile-carrier-bot

Build Status

A bot to access mobile carrier services, currently supports

  • Three IE
  • TIM
  • Iliad

๐Ÿšง๐Ÿšง๐Ÿšง๐Ÿšง๐Ÿšง๐Ÿšง๐Ÿšง๐Ÿšง๐Ÿšง๐Ÿšง โš ๏ธ Heavy Work in Progress โš ๏ธ ๐Ÿšง๐Ÿšง๐Ÿšง๐Ÿšง๐Ÿšง๐Ÿšง๐Ÿšง๐Ÿšง๐Ÿšง๐Ÿšง

TODO (not in order):

  • skeleton, plugins, setup
  • architecture docs and diagrams
  • healtcheck status/info/env
  • expose prometheus metrics via endpoint
  • expose JVM metrics via JMX
  • scalatest and scalacheck
  • codecov or alternatives
  • telegram client (polling)
  • slack client (webhook)
  • scrape at least 2 mobile carrier services to check balance
  • (polling) notify for low credits and expiry date
  • in-memory db with Ref
  • doobie db with PostgreSQL and H2
  • if/how store credentials in a safe way
  • authenticated endpoints as alternative to telegram/slack
  • write pure FP lib alternative to scala-scraper and jsoup (I will never do this!)
  • fix scalastyle and scalafmt
  • slate static site for api
  • gitpitch for 5@4 presentation
  • constrain all types with refined where possible
  • travis
  • travis automate publish to dockerhub
  • publish to dockerhub
  • create deployment k8s chart
  • create argocd app
  • statefulset with PostgreSQL
  • alerting with prometheus to slack
  • grafana dashboard
  • backup/restore logs and metrics even if re-create cluster
  • generate and publish scaladoc
  • fix manual Circe codecs with withSnakeCaseMemberNames config
  • add gatling stress tests
  • add integration tests
  • manage secrets in k8s

Endpoints

# healt checks
http :8080/status
http :8080/info
http :8080/env

Development

# test
sbt test -jvm-debug 5005
sbt "test:testOnly *HealthCheckEndpointsSpec"
sbt "test:testOnly *HealthCheckEndpointsSpec -- -z statusEndpoint"

# run with default
TELEGRAM_API_TOKEN=123:xyz sbt app/run

sbt aliases

  • checkFormat checks format
  • format formats sources
  • update checks outdated dependencies
  • build checks format and runs tests

Other sbt plugins

  • dependencyTree shows project dependencies

Deployment

# build image
sbt clean docker:publishLocal

# run temporary container
docker run \
  --rm \
  --name mobile-carrier-bot \
  niqdev/mobile-carrier-bot-app:0.1

# access container
docker exec -it mobile-carrier-bot bash

# publish
docker login
docker tag niqdev/mobile-carrier-bot-app:0.1 niqdev/mobile-carrier-bot-app:latest
docker push niqdev/mobile-carrier-bot-app:latest

Charts

# print chart
helm template -f charts/app/values.yaml charts/app/

# apply chart
helm template -f charts/app/values.yaml charts/app/ | kubectl apply -f -

# verify healtcheck
kubectl port-forward deployment/<DEPLOYMENT_NAME> 8888:8080
http :8888/status

# logs
kubectl logs <POD_NAME> -f

mobile-carrier-bot's People

Contributors

niqdev avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

sergiuszkierat

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.