forked from
smokesignal.events/smokesignal
i18n+filtering fork - fluent-templates v2
1//! # Smokesignal
2//!
3//! An event and RSVP management system built on the AT Protocol (atproto) with modern web technologies.
4//!
5//! ## Overview
6//!
7//! Smokesignal is a comprehensive event management platform that enables users to create, discover, and
8//! respond to events using the decentralized AT Protocol infrastructure. The application features a modern
9//! web interface built with HTMX and Bulma CSS, comprehensive internationalization support, and OAuth-based
10//! authentication.
11//!
12//! ## Architecture
13//!
14//! The application is built with a modular architecture organized into several key areas:
15//!
16//! ### Core Components
17//!
18//! - **[`http`]** - Web server implementation using Axum framework with HTMX support
19//! - **[`storage`]** - Database operations and data models using PostgreSQL and SQLx
20//! - **[`atproto`]** - AT Protocol client implementation and lexicon definitions
21//! - **[`oauth`]** - OAuth authentication and session management with Redis/Valkey
22//! - **[`i18n`]** - Internationalization system using fluent-templates
23//!
24//! ### Utilities and Support
25//!
26//! - **[`config`]** - Application configuration management and validation
27//! - **[`filtering`]** - Event filtering and search functionality
28//! - **[`jose`]** - JSON Web Signature (JWS) implementation for security
29//! - **[`encoding`]** - Data encoding and decoding utilities
30//! - **[`validation`]** - Input validation and sanitization
31//! - **[`resolve`]** - DID resolution and handle management
32//! - **[`errors`]** - Centralized error handling and reporting
33//!
34//! ## Features
35//!
36//! ### Event Management
37//! - Create, edit, and manage events with rich metadata
38//! - Support for multiple event types (in-person, virtual, hybrid)
39//! - Event status tracking (planned, scheduled, cancelled, etc.)
40//! - Location and link management
41//!
42//! ### RSVP System
43//! - User responses with multiple status options (going, interested, not going)
44//! - Real-time RSVP counts and attendee lists
45//! - Migration support for legacy events
46//!
47//! ### Internationalization
48//! - Full i18n support with fluent-templates
49//! - Gender-aware translations (particularly for French Canadian)
50//! - Automatic locale detection and fallback
51//! - Compile-time translation loading for performance
52//!
53//! ### Modern Web Interface
54//! - HTMX-powered dynamic interactions without JavaScript frameworks
55//! - Responsive design with Bulma CSS
56//! - Progressive enhancement for accessibility
57//! - Real-time updates and partial page rendering
58//!
59//! ### Authentication & Security
60//! - OAuth 2.0 based authentication
61//! - Secure session management with Redis
62//! - JSON Web Signature (JWS) for data integrity
63//! - DID-based identity management
64//!
65//! ## Getting Started
66//!
67//! ```rust,no_run
68//! use smokesignal::config::Config;
69//! use smokesignal::http::server;
70//!
71//! #[tokio::main]
72//! async fn main() -> anyhow::Result<()> {
73//! // Load configuration from environment
74//! let config = Config::from_env().await?;
75//!
76//! // Start the web server
77//! server::run(config).await?;
78//!
79//! Ok(())
80//! }
81//! ```
82//!
83//! ## Technology Stack
84//!
85//! - **Backend**: Rust with Axum web framework
86//! - **Database**: PostgreSQL with SQLx for type-safe queries
87//! - **Cache**: Redis/Valkey for session and cache management
88//! - **Templates**: Minijinja with fluent-templates for i18n
89//! - **Frontend**: HTMX + Bulma CSS for modern interactivity
90//! - **Protocol**: AT Protocol for decentralized social networking
91//! - **Containerization**: Docker with devcontainer support
92//!
93//! ## Module Organization
94//!
95//! The crate is organized into logical modules that separate concerns:
96//!
97//! ```text
98//! smokesignal/
99//! ├── atproto/ # AT Protocol implementation
100//! ├── config/ # Configuration management
101//! ├── http/ # Web server and request handling
102//! ├── storage/ # Database operations and models
103//! ├── oauth/ # Authentication and sessions
104//! ├── i18n/ # Internationalization
105//! ├── filtering/ # Event search and filtering
106//! ├── jose/ # JSON Web Signatures
107//! ├── encoding/ # Data encoding utilities
108//! ├── validation/ # Input validation
109//! ├── resolve/ # DID and handle resolution
110//! └── errors/ # Error handling
111//! ```
112
113pub mod atproto;
114pub mod config;
115pub mod config_errors;
116pub mod did;
117pub mod encoding;
118pub mod encoding_errors;
119pub mod errors;
120pub mod filtering;
121pub mod http;
122pub mod i18n;
123// Keeping old i18n module for compatibility during migration
124pub mod i18n_old;
125pub mod jose;
126pub mod jose_errors;
127pub mod oauth;
128pub mod oauth_client_errors;
129pub mod oauth_errors;
130pub mod refresh_tokens_errors;
131pub mod resolve;
132pub mod storage;
133// Removing storage_oauth_errors, consolidated with storage/oauth_model_errors
134pub mod task_refresh_tokens;
135pub mod validation;