Entire Backend API with Postgres
- 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 |
||
|---|---|---|
| migrations | ||
| src | ||
| tests | ||
| .env.example | ||
| .gitignore | ||
| build.rs | ||
| Cargo.toml | ||
| CLAUDE.md | ||
| HYMNAL_FRONTEND_INTEGRATION.md | ||
| LICENSE | ||
| README.md | ||
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
-
Prerequisites
- Rust 1.70+
- PostgreSQL 13+
- FFmpeg with QSV support (optional, for media processing)
-
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 -
Configuration
See
.env.examplefor all available settings including:- Database connection
- PASETO secret key
- SMTP configuration
- Media directories
- FFmpeg settings
API Endpoints
Public
GET /api/bulletins- List bulletinsGET /api/events- List eventsGET /api/sermons- List sermon videosGET /api/livestreams- List livestream archiveGET /api/hymns/search- Search hymnalGET /api/quarterlies- List quarterly lessonsGET /api/stream/status- Live stream status
Protected (Admin)
POST /api/admin/bulletins- Upload bulletinPOST /api/admin/events- Create eventPOST /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