Bulletin Tools
Go to file
Benjamin Slingo 4cfd1bad84 Add PO Box support and centralize config via API
- Add PO Box field to bulletin contact section from API config
- Replace local config files with API-based config fetching
- Add cover image upload support to bulletin-input tool
- Remove dead config.rs and config.toml files
- Unify contact info source to prevent config segregation
2025-08-26 18:09:31 -04:00
bulletin-generator Add PO Box support and centralize config via API 2025-08-26 18:09:31 -04:00
bulletin-input Add PO Box support and centralize config via API 2025-08-26 18:09:31 -04:00
bulletin-shared Add PO Box support and centralize config via API 2025-08-26 18:09:31 -04:00
data Initial commit with major improvements 2025-08-21 20:17:54 -04:00
data-upload-tools Initial commit with major improvements 2025-08-21 20:17:54 -04:00
.env.example Initial commit with major improvements 2025-08-21 20:17:54 -04:00
.gitignore Initial commit with major improvements 2025-08-21 20:17:54 -04:00
autoprintbulletin.sh Initial commit with major improvements 2025-08-21 20:17:54 -04:00
bulletin.txt Initial commit with major improvements 2025-08-21 20:17:54 -04:00
Cargo.toml Initial commit with major improvements 2025-08-21 20:17:54 -04:00
LICENSE Add MIT License with Benjamin Slingo copyright 2025-08-21 20:19:11 -04:00
README.md Initial commit with major improvements 2025-08-21 20:17:54 -04:00
SERMON_FORMAT.md Initial commit with major improvements 2025-08-21 20:17:54 -04:00

Bulletin Tools - Rust Implementation

This is a Rust rewrite of the Python church bulletin generation system. The system consists of two main binaries that work with a REST API to create and generate church bulletins.

Project Structure

  • bulletin-shared/ - Shared library containing common functionality

    • Configuration management
    • REST API client implementation
    • Data models (Bulletin, Event, Personnel)
  • bulletin-input/ - Binary for creating bulletin data entries

    • Reads CSV schedules and conference charts
    • Prompts for sermon details
    • Creates bulletin records via REST API
  • bulletin-generator/ - Binary for generating PDF bulletins

    • Fetches bulletin data from REST API
    • Renders HTML templates
    • Generates PDF using headless Chrome
    • Uploads PDF back via REST API

Data Files

The data/ directory contains:

  • Quarterly schedule2021 - 2025.csv - Personnel assignments
  • 2025 Offering and Sunset Times Chart.txt - Conference offering schedule and sunset times
  • KJV.json - King James Version Bible text for scripture lookups

Configuration

The shared configuration is in shared/config.toml:

church_name = "Your Church Name"
# Optional contact information for templates
# contact_phone = "555-123-4567"
# contact_website = "yourchurchwebsite.org"
# contact_youtube = "youtube.com/yourchurchchannel"
# contact_address = "123 Church St, Your City, ST 12345"

The system uses the REST API at https://api.rockvilletollandsda.church and requires an auth token via the BULLETIN_API_TOKEN environment variable or --auth-token parameter.

Usage

Building

cargo build --release

Bulletin Input

# Use upcoming Saturday (default)
cargo run --bin bulletin-input

# Specify a date
cargo run --bin bulletin-input -- --date 2025-06-21

# Use different location for sunset times
cargo run --bin bulletin-input -- --location "springfield"

Bulletin Generation

# Generate for upcoming Saturday
cargo run --bin bulletin-generator

# Specify a date
cargo run --bin bulletin-generator -- --date 2025-06-21

# Don't upload to PocketBase (local only)
cargo run --bin bulletin-generator -- --no-upload

# Custom output directory
cargo run --bin bulletin-generator -- --output-dir custom_output

Templates

The bulletin templates are located in bulletin-generator/templates/:

  • bulletin_template.html - Jinja2-style template for the bulletin layout
  • style.css - CSS styling for the PDF output

Dependencies

Key Rust dependencies:

  • tokio - Async runtime
  • reqwest - HTTP client for PocketBase API
  • serde - Serialization/deserialization
  • chrono - Date/time handling
  • tera - Template engine
  • headless_chrome - PDF generation
  • csv - CSV parsing
  • regex - Text parsing

Migration from Python

This Rust implementation maintains full compatibility with the original Python system:

  • Uses the new REST API backend
  • Processes the same data files
  • Generates identical bulletin layouts
  • Follows the same workflow

The main benefits of the Rust version:

  • Faster execution
  • Single binary deployment
  • Better error handling
  • Type safety
  • Reduced runtime dependencies