# Sojorn Platform Documentation ## πŸš€ Production-Ready Social Platform **Version**: 3.0 (MVP Complete) **Last Updated**: February 17, 2026 **Status**: βœ… **LAUNCH READY** --- ## πŸ“‹ Quick Start ### 🎯 What is Sojorn? Sojorn is a next-generation social platform focused on **positive engagement**, **local community**, and **privacy-first** communication. Built with modern technology and designed for meaningful connections. ### πŸ—οΈ Architecture Overview ``` β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Flutter App β”‚ β”‚ Go Backend β”‚ β”‚ PostgreSQL β”‚ β”‚ │◄──►│ │◄──►│ β”‚ β”‚ β€’ Mobile/Web β”‚ β”‚ β€’ REST API β”‚ β”‚ β€’ User Data β”‚ β”‚ β€’ Riverpod β”‚ β”‚ β€’ Business Logicβ”‚ β”‚ β€’ Posts β”‚ β”‚ β€’ Material UI β”‚ β”‚ β€’ E2EE Chat β”‚ β”‚ β€’ Groups β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”‚ β–Ό β–Ό β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Cloudflare R2 β”‚ β”‚ Nginx Proxy β”‚ β”‚ OpenAI API β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β€’ Media Storage β”‚ β”‚ β€’ SSL/TLS β”‚ β”‚ β€’ AI Moderation β”‚ β”‚ β€’ CDN β”‚ β”‚ β€’ Load Balance β”‚ β”‚ β€’ Content Safetyβ”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` --- ## 🎨 Core Features (All Completed) ### 🎬 **Quips Video System** - TikTok-Level Recording - βœ… Multi-segment recording with pause/resume - βœ… Speed control (0.5x, 1x, 2x, 3x) - βœ… Real-time filters and effects - βœ… Text overlays with positioning - βœ… Music/audio overlay from library - βœ… Advanced video processing with FFmpeg **Files**: `sojorn_app/lib/screens/quips/create/enhanced_quip_recorder_screen.dart` ### πŸ“ **Beacon System** - Local Safety & Community - βœ… Map view with clustered pins - βœ… 5 beacon categories (Safety, Community Need, Lost & Found, Events, Mutual Aid) - βœ… Verified/official source badges - βœ… "How to help" action items - βœ… Neighborhood/radius filtering - βœ… Confidence scoring system **Files**: `sojorn_app/lib/screens/beacon/enhanced_beacon_detail_screen.dart` ### 🎨 **Profile Widgets** - Modular Customization - βœ… Draggable widget grid system - βœ… 10 widget types (Pinned Posts, Music, Photos, Social Links, etc.) - βœ… 6 theme options with accent colors - βœ… JSON layout storage - βœ… Size constraints and design boundaries **Files**: `sojorn_app/lib/widgets/profile/draggable_widget_grid.dart` ### 🚫 **Blocking System 2.0** - Cross-Platform Compatibility - βœ… Import/Export block lists (JSON, CSV) - βœ… Platform compatibility (Twitter/X, Mastodon) - βœ… Bulk block operations - βœ… Validation and deduplication - βœ… Statistics dashboard **Files**: `sojorn_app/lib/services/blocking_service.dart` ### πŸ”„ **Feed Amplification** - Smart Content Discovery - βœ… 4 repost types (Standard, Quote, Boost, Amplify) - βœ… Weighted engagement algorithm - βœ… Real-time analytics dashboard - βœ… Trending content discovery - βœ… User boost limits and controls **Files**: `sojorn_app/lib/services/repost_service.dart` ### 🧠 **Algorithm Overhaul** - Positive Engagement Weighting - βœ… 5-factor scoring system (Engagement, Quality, Recency, Network, Personalization) - βœ… Weighted engagement metrics - βœ… Content quality analysis - βœ… Time decay algorithm - βœ… Personalization engine **Files**: `go-backend/internal/services/feed_algorithm_service.go` ### πŸ” **E2EE Chat System** - Device Sync & Security - βœ… QR code device verification - βœ… Cross-device key synchronization - βœ… RSA key pair generation - βœ… Device management interface - βœ… Message encryption/decryption **Files**: `sojorn_app/lib/services/e2ee_device_sync_service.dart` ### πŸ€– **AI Moderation** - Content Safety - βœ… OpenAI Vision API integration - βœ… FFmpeg video frame extraction - βœ… Real-time content analysis - βœ… Three Poisons scoring system - βœ… Automated flagging and appeals **Files**: `go-backend/internal/services/azure_openai_service.go` --- ## πŸ“š Documentation Structure ### 🎯 **Core Guides** #### **[DEVELOPMENT_COMPREHENSIVE.md](./DEVELOPMENT_COMPREHENSIVE.md)** Complete development setup, architecture patterns, and coding standards. #### **[DEPLOYMENT_COMPREHENSIVE.md](./DEPLOYMENT_COMPREHENSIVE.md)** Production deployment, monitoring, and maintenance procedures. #### **[E2EE_COMPREHENSIVE_GUIDE.md](./E2EE_COMPREHENSIVE_GUIDE.md)** End-to-end encryption implementation and security architecture. #### **[AI_MODERATION_IMPLEMENTATION.md](./AI_MODERATION_IMPLEMENTATION.md)** AI-powered content moderation system with OpenAI integration. #### **[TROUBLESHOOTING_COMPREHENSIVE.md](./TROUBLESHOOTING_COMPREHENSIVE.md)** Comprehensive troubleshooting guide for all platform features. ### πŸ“ **Organized Documentation** #### **πŸš€ Deployment** (`deployment/`) - `QUICK_START.md` - New developer onboarding - `SETUP.md` - Complete environment setup - `VPS_SETUP_GUIDE.md` - Server infrastructure - `SEEDING_SETUP.md` - Database seeding - `R2_CUSTOM_DOMAIN_SETUP.md` - Media storage - `DEPLOYMENT.md` - Production deployment - `DEPLOYMENT_STEPS.md` - Step-by-step guide #### **🎨 Features** (`features/`) - `IMAGE_UPLOAD_IMPLEMENTATION.md` - Media upload system - `notifications-troubleshooting.md` - Push notifications - `posting-and-appreciate-fix.md` - Post interactions - `QUIPS_VIDEO_SYSTEM.md` - Video recording system - `BEACON_SYSTEM.md` - Local safety features - `PROFILE_WIDGETS.md` - Modular profiles - `BLOCKING_SYSTEM.md` - User blocking - `FEED_AMPLIFICATION.md` - Content discovery - `ALGORITHM_SYSTEM.md` - Feed ranking - `E2EE_CHAT_SYSTEM.md` - Encrypted messaging #### **πŸ—οΈ Architecture** (`design/`) - `DESIGN_SYSTEM.md` - UI/UX guidelines - `CLIENT_README.md` - Flutter architecture - `database_architecture.md` - Database schema - `API_DESIGN.md` - REST API patterns #### **πŸ“– Reference** (`reference/`) - `PROJECT_STATUS.md` - Current development status - `NEXT_STEPS.md` - Planned improvements - `SUMMARY.md` - Platform overview - `API_REFERENCE.md` - Complete API documentation #### **πŸ’­ Philosophy** (`philosophy/`) - `CORE_VALUES.md` - Platform principles - `UX_GUIDE.md` - User experience guidelines - `FOURTEEN_PRECEPTS.md` - Development precepts - `ALGORITHM_PHILOSOPHY.md` - Feed ranking principles --- ## πŸ”§ Development Setup ### Prerequisites - **Go**: 1.21+ (Backend) - **Flutter**: 3.16+ (Frontend) - **PostgreSQL**: 15+ (Database) - **Docker**: 20+ (Optional deployment) ### Quick Start ```bash # Clone repository git clone https://git.mp.ls/patrick/sojorn.git cd sojorn # Backend setup cd go-backend cp .env.example .env # Configure database and API keys go mod download go run cmd/api/main.go # Frontend setup cd ../sojorn_app flutter pub get flutter run ``` ### Environment Variables ```bash # Database DATABASE_URL=postgresql://user:pass@localhost:5432/sojorn # APIs OPENAI_API_KEY=sk-... AZURE_OPENAI_KEY=... CLOUDFLARE_R2_TOKEN=... # Security JWT_SECRET=your-secret-key ENCRYPTION_KEY=your-encryption-key ``` --- ## πŸš€ Production Deployment ### Infrastructure Requirements - **Server**: Ubuntu 22.04 LTS (4GB+ RAM) - **Database**: PostgreSQL 15+ with PostGIS - **Web Server**: Nginx with SSL/TLS - **Storage**: Cloudflare R2 (or S3-compatible) ### Deployment Steps 1. **Server Setup**: Follow `deployment/VPS_SETUP_GUIDE.md` 2. **Database Setup**: Install PostgreSQL and run migrations 3. **Application Deploy**: Use `deployment/DEPLOYMENT.md` 4. **Monitoring**: Set up health checks and alerts 5. **SSL/TLS**: Configure certificates with Certbot ### Health Checks - **API Health**: `GET /health` - **Readiness**: `GET /ready` - **Liveness**: `GET /live` - **Metrics**: `GET /metrics` --- ## πŸ”’ Security Features ### Authentication & Authorization - βœ… JWT-based authentication with refresh tokens - βœ… Role-based access control - βœ… Rate limiting and DDoS protection - βœ… Secure password hashing (bcrypt) ### Data Protection - βœ… End-to-end encryption for chat (X3DH) - βœ… Encrypted data storage - βœ… Secure key management - βœ… GDPR compliance features ### Content Safety - βœ… AI-powered content moderation - βœ… NSFW content filtering - βœ… User reporting system - βœ… Admin moderation queue --- ## πŸ“± Platform Support ### Web Browsers - βœ… Chrome 90+ - βœ… Firefox 88+ - βœ… Safari 14+ - βœ… Edge 90+ ### Mobile Platforms - βœ… Android 8.0+ (API 26+) - 🚧 iOS 14+ (In Development) ### Features by Platform | Feature | Web | Android | iOS | |---------|------|---------|-----| | Core Feed | βœ… | βœ… | 🚧 | | E2EE Chat | βœ… | βœ… | 🚧 | | Video Recording | βœ… | βœ… | 🚧 | | Push Notifications | βœ… | βœ… | 🚧 | | Local Beacons | βœ… | βœ… | 🚧 | --- ## πŸ“Š Performance Metrics ### API Performance - **Response Time**: < 200ms (95th percentile) - **Throughput**: 1000+ requests/second - **Uptime**: 99.9% SLA - **Database**: < 50ms query time ### Mobile Performance - **App Load**: < 3 seconds cold start - **Memory Usage**: < 200MB average - **Battery**: Optimized for background tasks - **Network**: Efficient data sync ### Monitoring & Alerts - **Health Checks**: Real-time system monitoring - **Error Tracking**: Comprehensive error logging - **Performance**: APM integration ready - **Security**: Threat detection and alerts --- ## 🀝 Contributing ### Development Workflow 1. **Fork** the repository 2. **Branch**: `feature/your-feature-name` 3. **Code**: Follow development standards 4. **Test**: Include unit and integration tests 5. **PR**: Submit with description and testing ### Code Standards - **Go**: Follow Go conventions and golangci-lint - **Flutter**: Follow Dart style guide and flutter_lints - **Database**: Use migrations for schema changes - **Documentation**: Update docs for new features ### Testing Requirements - **Unit Tests**: 80%+ coverage - **Integration Tests**: Critical path coverage - **E2E Tests**: User journey validation - **Performance**: Load testing for APIs --- ## πŸ“ž Support & Community ### Getting Help - **Documentation**: Check relevant guides first - **Issues**: Create GitHub issue with details - **Discussions**: Use GitHub Discussions for questions - **Security**: Report to security@sojorn.app ### Community Resources - **Discord**: [Join our Discord](https://discord.gg/sojorn) - **Twitter**: @sojorn_platform - **Blog**: [sojorn.app/blog](https://sojorn.app/blog) - **Newsletter**: Monthly updates and features --- ## πŸ“œ License & Legal ### License - **Code**: MIT License - **Documentation**: Creative Commons BY-SA - **Assets**: Proprietary (see asset license) ### Privacy Policy - **Data Collection**: Minimal and transparent - **User Rights**: GDPR and CCPA compliant - **Data Retention**: 30 days for deleted accounts - **International**: Data residency options ### Terms of Service - **Content Policy**: Community guidelines - **Prohibited Content**: Clear rules and enforcement - **Intellectual Property**: User-owned content - **Dispute Resolution**: Fair and transparent process --- ## πŸ—ΊοΈ Roadmap ### βœ… Completed (v3.0) - All core features implemented - Production-ready deployment - Comprehensive testing suite - Security audit completed ### 🚧 In Progress (v3.1) - iOS mobile application - Advanced analytics dashboard - Enhanced moderation tools - Performance optimizations ### πŸ“‹ Planned (v4.0) - Real-time collaboration features - Advanced E2EE capabilities - Multi-language support - Enterprise features --- **πŸŽ‰ Sojorn is ready for production deployment!** For specific implementation details, see the comprehensive guides in the respective directories.