Entire Backend API with Postgres
Find a file
Benjamin Slingo f87b819abc Remove credential fallbacks and add coding standards
- Add CLAUDE.md with DRY/KISS/security guidelines
- Fix integration tests: add #[ignore], use .expect() instead of fallbacks
- Remove all unwrap_or_else patterns with hardcoded connection strings
- URL-encode special characters in credentials
2025-12-25 17:45:01 -05:00
migrations Add hymnal media support and responsive reading labels 2025-12-08 01:08:15 -05:00
src Remove credential fallbacks and add coding standards 2025-12-25 17:45:01 -05:00
tests Remove dead code leftover from DRY/KISS refactor 2025-12-06 14:43:30 -05:00
.env.example Add hymnal media support and responsive reading labels 2025-12-08 01:08:15 -05:00
.gitignore Add proper README and remove development documentation files 2025-08-19 21:01:55 -04:00
build.rs Initial commit: Church API Rust implementation 2025-08-19 20:56:41 -04:00
Cargo.toml Migrate from video_processing to church-core 2025-12-19 21:20:55 -05:00
CLAUDE.md Remove credential fallbacks and add coding standards 2025-12-25 17:45:01 -05:00
HYMNAL_FRONTEND_INTEGRATION.md Add hymnal media support and responsive reading labels 2025-12-08 01:08:15 -05:00
LICENSE Initial commit: Church API Rust implementation 2025-08-19 20:56:41 -04:00
README.md Clean up repository and update README 2025-11-29 01:49:33 -05:00

Church API

A comprehensive church management system built with Rust and Axum, providing REST APIs for bulletin management, event scheduling, media processing, and live streaming integration.

Features

  • Bulletin Management: Upload, process, and serve church bulletins with automatic format conversion
  • Event Scheduling: Create and manage church events with recurring event support
  • Media Library: Video sermons and livestream archive with smart streaming (AV1/H.264)
  • Live Streaming: Integration with Owncast for live stream management
  • Hymnal System: Full hymnal database with search and thematic lists
  • Quarterly Lessons: Sabbath School quarterly management
  • User Authentication: PASETO-based authentication with role-based access control
  • Email Notifications: SMTP integration for automated notifications
  • Automated Tasks: Scheduled bulletin printing, database backups, media scanning

Tech Stack

  • Backend: Rust with Axum web framework
  • Database: PostgreSQL with SQLx
  • Media Processing: FFmpeg/FFprobe (Intel Arc A770 QSV acceleration)
  • Authentication: PASETO v4 with bcrypt password hashing
  • Email: lettre for SMTP integration
  • Scheduling: tokio-cron-scheduler for automated tasks

Quick Start

  1. Prerequisites

    • Rust 1.70+
    • PostgreSQL 13+
    • FFmpeg with QSV support (optional, for media processing)
  2. Setup

    # Clone the repository
    git clone https://git.rockvilletollandsda.church/RTSDA/church-api.git
    cd church-api
    
    # Copy environment template
    cp .env.example .env
    # Edit .env with your configuration
    
    # Build and run
    cargo run
    
  3. Configuration

    See .env.example for all available settings including:

    • Database connection
    • PASETO secret key
    • SMTP configuration
    • Media directories
    • FFmpeg settings

API Endpoints

Public

  • GET /api/bulletins - List bulletins
  • GET /api/events - List events
  • GET /api/sermons - List sermon videos
  • GET /api/livestreams - List livestream archive
  • GET /api/hymns/search - Search hymnal
  • GET /api/quarterlies - List quarterly lessons
  • GET /api/stream/status - Live stream status

Protected (Admin)

  • POST /api/admin/bulletins - Upload bulletin
  • POST /api/admin/events - Create event
  • POST /api/admin/sermons/upload - Upload sermon video

Scheduled Tasks

  • Bulletin Printing: Saturdays at 9:00 AM Eastern
  • Database Backup: Every 24 hours
  • Media Scanning: Every 10 minutes
  • Thumbnail Generation: Every 30 minutes

Utilities

# Generate password hash
cargo run --bin hash_password -- 'your-password'

# Verify password against hash
cargo run --bin hash_password -- 'your-password' '$2b$12$...'

License

MIT License - see LICENSE file for details.

Author

Benjamin Slingo