Giter Site home page Giter Site logo

itzsaga / reading-plan-worker Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 2.3 MB

Cloudflare worker to serve up The Axis Church reading plan each day.

Home Page: https://reading.sethaalexander.com/

License: MIT License

TypeScript 100.00%
cloudflare-worker hacktoberfest

reading-plan-worker's Introduction

The Axis Church Reading Plan Worker

Deploy Better Uptime Badge

While attempting to keep up with the daily reading I frequently found myself without the reading cards. Even though I can download them digitally, being a developer I wanted to try out something different. This worker is the results.

Features

  • The reading info is uploaded using the wrangler cli kv:bulk functionality.
  • Defaults to reading from the KV store todays date values.
  • Accepts a query parameter to load readings from other days e.g. ?date=2021-09-01.
  • Queries the text from the ESV API and cahces the response to ensure rate limits are note exceeded and response times stay super fast.

reading-plan-worker's People

Contributors

renovate[bot] avatar itzsaga avatar dependabot[bot] avatar

Stargazers

Daniel Bodnar avatar Daniel Cress avatar

Watchers

Daniel Cress avatar  avatar  avatar

reading-plan-worker's Issues

API limits workaround

The ESV API has a limit of only allowing 500 verses or half of a full book of the Bible, whichever is less. However, with some books being 3 or less chapters the reading plan has those entire books on a single day. These books get truncated in the API response.

Need to figure out a way around this. Possible a flag on the date and merging of multiple API responses instead of the current all in one way.

UI Based Navigation

The application has the logic built in to take a date query param. Need to add forward and back buttons to allow moving sequentially through the reading plan via the UI.

CICD

Currently I'm doing wrangler publish locally to update the worker. This should be taken care of automatically by a CICD pipeline when merging to main.

Timezones ๐Ÿคฆ๐Ÿปโ€โ™‚๏ธ

The current date is based on UTC and doesn't take into account the time zone the end user is accessing the worker from. It could also be the time zone the worker is executed in. Though with the global CDN this should be close to where the end user is located.

Seed KV store

The KV will need to be seeded with the reading list. See the bulk documentation for how the file should be formatted.

Create two folders wip and submitted. After a file is bulk uploaded it should be moved into the submitted folder and have the date it was added to the KV store added in the file.

Check once added to the KV store:

  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December

Permanent KV values

The current code looks for a specific date every day. This is tedious to keep updated. The new code should disregard the year (unless in a leap year where we'll need an additional day added in). Need to think more about how this is architected but would like to remove the ttl from KV uploads and somehow "override" and look for specific leap year values during those years.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Pending Status Checks

These updates await pending status checks. To force their creation now, click the checkbox below.

  • chore(deps): update dependency eslint to v9.11.1
  • chore(deps): update dependency wrangler to v3.78.10
  • chore(deps): update dependency @cloudflare/workers-types to v4.20240925.0
  • chore(deps): update dependency miniflare to v3.20240925.0
  • chore(deps): update typescript-eslint monorepo to v8.7.0 (@typescript-eslint/eslint-plugin, @typescript-eslint/parser)

Detected dependencies

github-actions
.github/workflows/codeql-analysis.yml
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • github/codeql-action v3
  • github/codeql-action v3
  • github/codeql-action v3
.github/workflows/publish-worker.yml
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • cloudflare/wrangler-action v3.7.0
npm
package.json
  • @cloudflare/workers-types 4.20240919.0
  • @types/jest ^29.0.0
  • @typescript-eslint/eslint-plugin ^8.0.0
  • @typescript-eslint/parser ^8.0.0
  • eslint ^9.0.0
  • eslint-config-prettier ^9.0.0
  • eslint-config-typescript ^3.0.0
  • jest ^29.0.0
  • jest-environment-miniflare ^2.14.2
  • miniflare ^3.0.0
  • prettier ^3.0.0
  • ts-jest ^29.0.0
  • typescript 5.6.2
  • wrangler ^3.22.1
nvm
.nvmrc
  • node 20.17.0

  • Check this box to trigger a request for Renovate to run again on this repository

Skip deploy on irrelevant changes

The deploy CI action should only run when needed. Right now it runs on every push to main so things like README.md updates trigger a deploy for no functional reason.

CICD update KV store

Wire up CICD to automatically bulk upload new files from a /kv_files/to_upload directory then move then to /kv_files/uploaded on merge to main to facilitate anyone writing those files and opening a PR to get them added.

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.