Florian abc894869f Unified logging behaviour and added exponential backoff
- Logger doesn't start with log level DEBUG by default, instead reads a environment variable
- Secret handler raises exceptions instead of using the module os to exit
- Added extensive debug logging
- Added detailed function descriptions
- Added exponential backoff when parsing the RSS feed
2025-10-17 15:12:02 +02:00
2025-10-09 20:30:48 +02:00
2025-10-11 17:57:10 +02:00
2025-10-11 17:57:10 +02:00

Service: Royalroad Chapters

Overview

service-royalroad-chapters is a FastAPI-based webserver that monitors Royalroad stories for new chapters and sends notifications data to backend-api-internal.

Features

  • Fetches the latest chapters from Royalroad RSS feeds.

  • Updates the database when new chapters are released.

  • Sends push notifications for new chapters.

  • Prometheus metrics integrated for monitoring request counts.

Endpoints

GET /royalroad

  • Checks for new chapters for all active stories in the database.
  • Updates the lastChapter field in the database.
  • Sends notifications if a new chapter is found.
  • Response:
{
  "status": "checked"
}

Requirements

  • Python 3.12+

  • MySQL database

  • Python packages from requirements.txt

Configuration

Environment variables:

  • LOG_LEVEL (DEBUG, INFO, WARNING, ERROR, CRITICAL)

  • Database credentials: MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE

  • API_KEY_INTERNAL

  • BACKEND_API_URL

Metrics

Metrics are exposed on port 9000 for Prometheus

Running the Service

  • Inside the src folder python main.py
Description
Fetches new RR chapter data
Readme 102 KiB
Languages
Python 96.2%
Dockerfile 3.8%