Repository navigation
FastOpp 0.4.1 - restructured core services for auth, storage, template context
Pre-release
Pre-release
This release reorganizes the project structure by moving core shared services (template_context.py, auth/, and storage/) into a dedicated core/ directory, using Django best practices as a reference for FastAPI project organization. This creates a clear separation between core shared services and application-specific services, while also unifying the authentication system across all applications.
Changes Made
🏗️ New Core Services Structure
- Created
core/directory - Following Django best practices for shared utilities - Moved
template_context.py- Fromservices/tocore/services/ - Moved
auth/directory - Fromservices/auth/tocore/services/auth/ - Moved
storage/directory - Fromservices/storage/tocore/services/storage/ - Updated all imports - Changed from
services.*tocore.services.*
🔐 Unified Authentication System
- Consolidated auth implementations - Removed duplicate auth directories from
base_assets/auth/anddemo_assets/auth/ - Single source of truth - All applications now use the unified
core/services/auth/system - Eliminated code duplication - No more separate auth implementations for different asset types
- Consistent behavior - Same authentication logic across
base_assets,demo_assets, and main application
🔄 Updated Import Statements
- Main application - Updated to use
core.services.template_contextandcore.services.auth - Base assets - Updated all auth and template context imports
- Demo assets - Updated all auth and template context imports
- All route files - Updated to use new core services imports
🧹 Cleaned Up oppdemo.py
- Removed unnecessary exclusions - No longer need to skip
template_context.pysince it's moved - Simplified backup logic - Services backup now copies all files without exclusions
- Updated comments - Reflects new core services structure
Benefits
✅ Clear Separation of Concerns
- Core services - Shared across all applications (
template_context.py,auth/,storage/) - Application services - Specific to demo functionality (
chat_service.py,product_service.py, etc.) - Better organization - Follows Django's established patterns
✅ Unified Authentication
- Single auth system - No more duplicate auth implementations
- Consistent SQLAdmin integration - Same admin interface across all applications
- Unified JWT system - Same token creation and verification everywhere
- Simplified maintenance - One place to update authentication features
✅ Improved Maintainability
- Single source of truth for core authentication and template context
- Easier to add new core services - Just add to
core/services/ - Cleaner project structure - Clear distinction between shared and app-specific code
✅ Enhanced Reusability
- Both
base_assetsanddemo_assetsuse the same core services - Consistent behavior across all applications
- Future-proof structure - Easy to add more core services