Coder Social home page Coder Social logo

serve's Introduction

Serve

Get the schedule your favourite volleyball leagues straight to your discord channel of choice.

The outcome looks as such:

img.png

Deployment

brew install flyctl

flyctl auth login

fly launch

# set env variables
fly secrets set API_KEY=<flashscore-api-key>                                                                                                                        
fly secrets set DISCORD_URI=<full-discord-uri>

# creating the db
fly volume create servevolume -r ams -n 1
fly secrets set DSN=sqlite3:///mnt/servevolume/serve.sqlite 
fly secrets list

# see: https://community.fly.io/t/scp-a-file-into-a-persistent-volume/2729
# put the output into prod/private_key.pem
flyctl ssh issue --agent
fly ssh console -C 'mkdir /data/'  
scp prod/private_key.pem [email protected]:/data/private_key.pem
sqlite3 serve.db #exit with .quit
scp serve.db [email protected]:/data/serve.db
fly secrets set DSN=sqlite3:///data/serve.sqlite

# get the current state of the db
fly ssh console -a serve -C 'ls -l /data/'
flyctl ssh -a serve sftp get /data/serve.db \
  && flyctl ssh -a serve sftp get /data/serve.db-shm \
  && flyctl ssh -a serve sftp get /data/serve.db-wal

# run only one container to execute CRON only once
fly scale count 1

# update running app
fly deploy

Testing

There's a skipped test in discord/discord_test.go if you want to check that the discord message gets properly. formatted

TODOs

  • use "NAME_PART_1" & "NAME_PART_2" from flashscore response for country/league struct

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.