Skip to content

FastOpp 0.4.1 - restructured core services for auth, storage, template context

Pre-release
Pre-release

Choose a tag to compare

@codetricity codetricity released this 22 Oct 19:33
· 83 commits to main since this 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 - From services/ to core/services/
  • Moved auth/ directory - From services/auth/ to core/services/auth/
  • Moved storage/ directory - From services/storage/ to core/services/storage/
  • Updated all imports - Changed from services.* to core.services.*

🔐 Unified Authentication System

  • Consolidated auth implementations - Removed duplicate auth directories from base_assets/auth/ and demo_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_context and core.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.py since 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_assets and demo_assets use the same core services
  • Consistent behavior across all applications
  • Future-proof structure - Easy to add more core services