- Add complete dark mode system with theme context and toggle - Implement dark mode toggle component in navigation menu - Add client-side routing with SSR-safe signal handling - Fix language selector styling for better dark mode compatibility - Add documentation system with mdBook integration - Improve navigation menu with proper external/internal link handling - Add comprehensive project documentation and configuration - Enhance theme system with localStorage persistence - Fix arena panic issues during server-side rendering - Add proper TypeScript configuration and build optimizations 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
10 KiB
Features Overview
Rustelo is built around a modular feature system that allows you to enable only the functionality you need. This approach keeps your application lean, reduces compile times, and ensures you're not carrying unnecessary dependencies.
Philosophy
The feature system is designed with these principles in mind:
- 🎯 Opt-in by Design: Start minimal and add features as needed
- 🔧 Zero Configuration: Features work out of the box with sensible defaults
- 📦 Minimal Dependencies: Each feature only includes what it absolutely needs
- 🔄 Composable: Features work together seamlessly
- 🛡️ Secure by Default: Security considerations built into every feature
Feature Categories
Core Features (Always Available)
These features are always available regardless of your configuration:
- Static File Serving: Serve static assets (CSS, JS, images)
- Routing: Client-side and server-side routing
- CSRF Protection: Cross-site request forgery protection
- Security Headers: Basic security headers
- Rate Limiting: Basic rate limiting
- Health Checks: System health monitoring endpoints
- Logging: Structured logging with tracing
Optional Features
🔐 Authentication (auth)
Default: Enabled
Complete user authentication and authorization system.
What it provides:
- JWT token-based authentication
- OAuth2 integration (Google, GitHub, etc.)
- Two-factor authentication (2FA/TOTP)
- Password hashing with Argon2
- Session management
- User registration and login
- Password reset functionality
- Role-based access control (RBAC)
Use cases:
- User portals and dashboards
- SaaS applications
- Protected content areas
- Multi-tenant applications
Dependencies:
jsonwebtoken- JWT handlingargon2- Secure password hashingoauth2- OAuth2 client implementationtotp-rs- Two-factor authenticationqrcode- QR code generationtower-sessions- Session management
📄 Content Management (content-db)
Default: Enabled
Database-driven content management with Markdown support.
What it provides:
- Markdown content rendering
- Syntax highlighting for code blocks
- YAML frontmatter support
- Content caching system
- Dynamic content loading
- Content versioning
- SEO-friendly URLs
- Full-text search capabilities
Use cases:
- Blogs and news sites
- Documentation sites
- Content management systems
- Marketing websites
- Knowledge bases
Dependencies:
pulldown-cmark- Markdown parsingsyntect- Syntax highlightingserde_yaml- YAML frontmattersqlx- Database access
🔒 TLS Support (tls)
Default: Disabled
HTTPS/TLS encryption for secure connections.
What it provides:
- HTTPS server support
- TLS certificate management
- Automatic HTTP to HTTPS redirects
- SSL/TLS configuration
- Certificate validation
- Support for Let's Encrypt certificates
Use cases:
- Production deployments
- Security-sensitive applications
- Compliance requirements
- E-commerce applications
Dependencies:
axum-server- TLS-enabled serverrustls- Pure Rust TLS implementationrustls-pemfile- Certificate file handling
📧 Email System (email)
Default: Enabled
Comprehensive email functionality with multiple providers.
What it provides:
- Multiple email providers (SMTP, SendGrid, AWS SES)
- HTML and text email templates
- Contact form handling
- Email verification
- Password reset emails
- Notification system
- Email queue management
- Bounce handling
Use cases:
- Contact forms
- User notifications
- Marketing emails
- Transactional emails
- Newsletter systems
Dependencies:
lettre- Email sendinghandlebars- Email templatingurlencoding- URL encodingasync-trait- Async trait support
Feature Combinations
Common Combinations
Minimal Static Site
cargo build --no-default-features
Perfect for:
- Marketing websites
- Landing pages
- Documentation sites
- Portfolio sites
Features included:
- Static file serving
- Basic routing
- Security headers
Secure Static Site
cargo build --no-default-features --features "tls"
Perfect for:
- Production static sites
- Security-conscious deployments
- Compliance requirements
Features included:
- All minimal features
- HTTPS/TLS support
Authentication-Only App
cargo build --no-default-features --features "auth"
Perfect for:
- User portals
- Dashboard applications
- API services with authentication
Features included:
- User management
- JWT authentication
- OAuth2 providers
- Session management
Content Management System
cargo build --no-default-features --features "content-db"
Perfect for:
- Blogs
- News sites
- Documentation platforms
- Knowledge bases
Features included:
- Markdown rendering
- Database content storage
- Content caching
Communication Site
cargo build --no-default-features --features "email"
Perfect for:
- Contact pages
- Feedback forms
- Newsletter signups
- Notification systems
Features included:
- Email sending
- Form handling
- Template system
Full-Featured Application
cargo build --features "auth,content-db,email"
# or simply: cargo build (uses defaults)
Perfect for:
- Complete web applications
- SaaS platforms
- User-generated content sites
- E-commerce applications
Features included:
- Complete user management
- Content management
- Email system
- All security features
Production-Ready
cargo build --release --features "tls,auth,content-db,email"
Perfect for:
- Production deployments
- Enterprise applications
- High-security requirements
Features included:
- All features enabled
- HTTPS/TLS security
- Optimized for performance
Configuration Matrix
| Feature | Database Required | Email Required | TLS Recommended |
|---|---|---|---|
| Static Site | ❌ | ❌ | ✅ (Production) |
| Auth | ✅ | ✅ (Password Reset) | ✅ |
| Content-DB | ✅ | ❌ | ✅ (Production) |
| ❌ | ✅ | ✅ (Production) | |
| TLS | ❌ | ❌ | N/A |
Performance Impact
Build Times
- Minimal: ~30 seconds
- Auth Only: ~45 seconds
- Content-DB Only: ~40 seconds
- Full Featured: ~60 seconds
Binary Size
- Minimal: ~2MB
- Auth Only: ~5MB
- Content-DB Only: ~4MB
- Full Featured: ~8MB
Memory Usage
- Minimal: ~10MB RAM
- Auth Only: ~25MB RAM
- Content-DB Only: ~20MB RAM
- Full Featured: ~40MB RAM
Cold Start Time
- Minimal: ~50ms
- Auth Only: ~200ms
- Content-DB Only: ~150ms
- Full Featured: ~300ms
Feature Dependencies
Database Features
Features that require database access:
auth- User accounts, sessions, OAuth tokenscontent-db- Content storage, caching, search
Email Features
Features that benefit from email:
auth- Password reset, email verificationemail- Contact forms, notifications
Security Features
Features that enhance security:
tls- HTTPS encryptionauth- User authentication- All features include basic security (CSRF, rate limiting, headers)
Development vs Production
Development Recommendations
# Fast development cycle
cargo build --features "auth,content-db,email"
# With hot reloading
cargo leptos serve --features "auth,content-db,email"
Production Recommendations
# Secure production build
cargo build --release --features "tls,auth,content-db,email"
# Minimal production (static sites)
cargo build --release --no-default-features --features "tls"
Migration Between Features
Adding Features
- Update feature flags in build command
- Add required environment variables
- Run database migrations (if applicable)
- Update frontend components
- Test thoroughly
Removing Features
- Export/backup relevant data
- Update feature flags
- Remove unused environment variables
- Clean up unused code
- Test reduced functionality
Feature Roadmap
Planned Features
- WebSocket Support: Real-time communication
- File Upload: File management system
- Admin Dashboard: Administrative interface
- API Documentation: Automatic API docs
- Metrics & Monitoring: Application metrics
- Search Engine: Full-text search
- Caching Layer: Redis integration
- Message Queue: Background job processing
Experimental Features
- GraphQL API: Alternative to REST
- Server-Side Events: Real-time updates
- Multi-tenancy: Tenant isolation
- Audit Logging: Comprehensive audit trails
Best Practices
Feature Selection
- Start Minimal: Begin with only essential features
- Add Gradually: Introduce features as requirements evolve
- Consider Dependencies: Understand feature interactions
- Test Combinations: Verify feature combinations work together
- Document Choices: Record why features were selected
Configuration
- Environment-Specific: Use different features per environment
- Feature Flags: Use runtime feature flags for A/B testing
- Graceful Degradation: Handle missing features gracefully
- Monitoring: Monitor feature usage and performance
Development
- Feature Branches: Develop features in isolation
- Integration Testing: Test feature combinations
- Documentation: Document feature usage
- Performance Testing: Measure feature impact
Next Steps
Ready to dive deeper into specific features? Check out:
- Authentication System - Complete user management
- Content Management - Database-driven content
- TLS Support - HTTPS configuration
- Email System - Communication features
- Feature Combinations - Detailed combination guide
Or explore the technical details:
- Database Overview - Database configuration
- Security Overview - Security features
- Performance Overview - Performance considerations