# 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 Processing**: Handle video uploads with transcoding and thumbnail generation - **Live Streaming**: Integration with Owncast for live stream management - **User Authentication**: JWT-based authentication with role-based access control - **Email Notifications**: SMTP integration for automated notifications - **Database Management**: PostgreSQL with automated migrations ## Tech Stack - **Backend**: Rust with Axum web framework - **Database**: PostgreSQL with SQLx - **Media Processing**: GStreamer for video transcoding - **Authentication**: JWT with bcrypt password hashing - **Email**: lettre for SMTP integration ## Quick Start 1. **Prerequisites** - Rust 1.70+ - PostgreSQL 13+ - GStreamer development libraries 2. **Setup** ```bash # Clone the repository git clone ssh://rockvilleav@git.rockvilletollandsda.church:10443/RTSDA/church-api.git cd church-api # Copy environment template cp .env.example .env # Edit .env with your configuration # Run database migrations sqlx migrate run # Build and run cargo run ``` 3. **Configuration** Edit `.env` with your settings: - Database URL - JWT secret - SMTP configuration - Upload directories ## API Endpoints - `POST /api/auth/login` - User authentication - `GET /api/bulletins` - List bulletins - `POST /api/bulletins` - Upload bulletin - `GET /api/events` - List events - `POST /api/events` - Create event - `POST /api/media/upload` - Upload media files - `GET /api/stream/status` - Live stream status ## Development ```bash # Run tests cargo test # Check code cargo check # Format code cargo fmt ``` ## License MIT License - see LICENSE file for details. ## Author Benjamin Slingo