Commit Graph

478 Commits

Author SHA1 Message Date
IGNY8 VPS (Salman)
0d468ef15a Phase 0: Improve ModuleEnableSettings get_queryset to filter by account
- Updated get_queryset to properly filter by account
- Ensures queryset is account-scoped before list() is called
- Prevents potential conflicts with base class behavior
2025-11-16 19:25:36 +00:00
IGNY8 VPS (Salman)
8fc483251e Phase 0: Fix ModuleEnableSettings 404 error - improve error handling
- Added proper exception handling in list() and retrieve() methods
- Use objects.get_or_create() directly instead of class method
- Added *args, **kwargs to method signatures for DRF compatibility
- Better error messages for debugging
- Fixes 404 'Setting not found' errors
2025-11-16 19:25:05 +00:00
IGNY8 VPS (Salman)
1d39f3f00a Phase 0: Fix token race condition causing logout after login
- Updated getAuthToken/getRefreshToken to read from Zustand store first (faster, no parsing delay)
- Added token existence check before making API calls in AppLayout
- Added retry mechanism with 100ms delay to wait for Zustand persist to write token
- Made 403 error handler smarter - only logout if token actually exists (prevents false logouts)
- Fixes issue where user gets logged out immediately after successful login
2025-11-16 19:22:45 +00:00
IGNY8 VPS (Salman)
b20fab8ec1 Phase 0: Fix AppLayout to only load sites when authenticated
- Added isAuthenticated check before loading active site
- Prevents 403 errors when user is not logged in
- Only loads sites when user is authenticated
- Silently handles 403 errors (expected when not authenticated)
2025-11-16 19:16:43 +00:00
IGNY8 VPS (Salman)
437b0c7516 Phase 0: Fix AppSidebar to only load module settings when authenticated
- Added isAuthenticated check before loading module enable settings
- Prevents 403 errors when user is not logged in
- Only loads settings when user is authenticated and settings aren't already loaded
2025-11-16 19:16:07 +00:00
IGNY8 VPS (Salman)
4de9128430 Phase 0: Fix ModuleEnableSettings permissions - allow read access to all authenticated users
- Changed permission_classes to get_permissions() method
- Read operations (list, retrieve) now accessible to all authenticated users
- Write operations (update, partial_update) still restricted to admins/owners
- Fixes 403 Forbidden errors when loading module settings in sidebar
2025-11-16 19:14:53 +00:00
IGNY8 VPS (Salman)
f195b6a72a Phase 0: Fix infinite loop in AppSidebar and module settings loading
- Fixed infinite loop by memoizing moduleEnabled with useCallback
- Fixed useEffect dependencies to prevent re-render loops
- Added loading check to prevent duplicate API calls
- Fixed setState calls to only update when values actually change
- Removed unused import (isModuleEnabled from modules.config)
2025-11-16 19:13:12 +00:00
IGNY8 VPS (Salman)
ab6b6cc4be Phase 0: Add credit costs display to Credits page
- Added credit costs reference table to Credits page
- Shows cost per operation type with descriptions
- Consistent with Usage page credit costs display
- Helps users understand credit consumption
2025-11-16 19:06:48 +00:00
IGNY8 VPS (Salman)
d0e6b342b5 Phase 0: Update billing pages to show credits and credit costs
- Updated Usage page to show only credits and account management limits
- Removed plan operation limit displays (planner, writer, images)
- Added credit costs reference table showing cost per operation type
- Updated limit cards to handle null limits (for current balance display)
- Improved UI to focus on credit-only system
2025-11-16 19:06:07 +00:00
IGNY8 VPS (Salman)
461f3211dd Phase 0: Add monthly credit replenishment Celery Beat task
- Created billing/tasks.py with replenish_monthly_credits task
- Task runs on first day of each month at midnight
- Adds plan.included_credits to all active accounts
- Creates CreditTransaction records for audit trail
- Configured in celery.py beat_schedule
- Handles errors gracefully and logs all operations
2025-11-16 19:02:26 +00:00
IGNY8 VPS (Salman)
abbf6dbabb Phase 0: Remove plan limit checks from billing views
- Updated limits endpoint to show only credits and account management limits
- Removed all operation limit references (keywords, clusters, content ideas, word count, images)
- Limits endpoint now focuses on credit usage by operation type
- Account management limits (users, sites) still shown
2025-11-16 18:51:40 +00:00
IGNY8 VPS (Salman)
a10e89ab08 Phase 0: Remove plan operation limit fields (credit-only system)
- Removed all operation limit fields from Plan model
- Kept account management limits (max_users, max_sites, etc.)
- Updated PlanSerializer to remove limit fields
- Updated PlanAdmin to remove limit fieldsets
- Created migration to remove limit fields from database
- Plan model now only has credits, billing, and account management fields
2025-11-16 18:50:24 +00:00
IGNY8 VPS (Salman)
5842ca2dfc Phase 0: Fix AppSidebar useEffect for module settings loading 2025-11-16 18:48:45 +00:00
IGNY8 VPS (Salman)
9b3fb25bc9 Phase 0: Add sidebar filtering and route guards for modules
- Updated AppSidebar to filter out disabled modules from navigation
- Added ModuleGuard to all module routes (planner, writer, thinker, automation)
- Modules now dynamically appear/disappear based on enable settings
- Routes are protected and redirect to settings if module is disabled
2025-11-16 18:48:23 +00:00
IGNY8 VPS (Salman)
dbe8da589f Phase 0: Add ModuleGuard component and implement Modules settings UI
- Created ModuleGuard component to protect routes based on module status
- Implemented Modules.tsx page with toggle switches for all modules
- Fixed Switch component onChange prop type
- Module enable/disable UI fully functional
2025-11-16 18:44:07 +00:00
IGNY8 VPS (Salman)
8102aa74eb Phase 0: Add frontend module config and update settings store
- Created modules.config.ts with module definitions
- Added ModuleEnableSettings API functions
- Updated settingsStore with module enable settings support
- Added isModuleEnabled helper method
2025-11-16 18:43:24 +00:00
IGNY8 VPS (Salman)
13bd7fa134 Phase 0: Add ModuleEnableSettings serializer, ViewSet, and URL routing
- Created ModuleEnableSettingsSerializer
- Created ModuleEnableSettingsViewSet with get_or_create logic
- Added URL routing for module enable settings
- One record per account, auto-created on first access
2025-11-16 18:40:10 +00:00
IGNY8 VPS (Salman)
a73b2ae22b Phase 0: Add ModuleEnableSettings model and migration
- Created ModuleEnableSettings model with enabled flags for all modules
- Added migration for ModuleEnableSettings
- Updated imports across system module files
2025-11-16 18:39:16 +00:00
IGNY8 VPS (Salman)
5b11c4001e Phase 0: Update credit costs and CreditService, add credit checks to AI Engine
- Updated CREDIT_COSTS to match Phase 0 spec (flat structure)
- Added get_credit_cost() method to CreditService
- Updated check_credits() to accept operation_type and amount
- Added deduct_credits_for_operation() convenience method
- Updated AI Engine to check credits BEFORE AI call
- Updated AI Engine to deduct credits AFTER successful execution
- Added helper methods for operation type mapping and amount calculation
2025-11-16 18:37:41 +00:00
Desktop
f84be4194f 9 phases 2025-11-16 23:15:45 +05:00
Desktop
1c8c44ebe0 b 2025-11-16 22:50:04 +05:00
IGNY8 VPS (Salman)
76a363b3d5 Organize planning documents and update README structure
- Created a new `docs/planning/` directory to better organize architecture and implementation planning documents.
- Moved existing planning documents into the new directory for improved accessibility.
- Updated `README.md` to reflect the new document structure and added references to the organized planning documents.
- Enhanced overall documentation management for easier navigation and maintenance.
2025-11-16 17:41:30 +00:00
IGNY8 VPS (Salman)
4561f73afb Enhance architecture plan with new site integration model and credit-based usage system
- Introduced a new Site Integration API structure to support multiple platforms (WordPress, Shopify).
- Added credit-based usage system, removing previous plan limits and implementing a credit cost structure for various operations.
- Updated Site model to include new fields for integration and hosting types.
- Enhanced publishing workflow to support multi-destination publishing and integration adapters.
2025-11-16 16:31:24 +00:00
IGNY8 VPS (Salman)
bca5229c61 Update Igny8-phase-2-plan.md with new project details and timelines 2025-11-16 16:02:19 +00:00
Desktop
8e9c31d905 Create Igny8-phase-2-plan.md 2025-11-16 19:56:38 +05:00
Desktop
c4c3a586ab cleanup 2025-11-16 19:51:14 +05:00
IGNY8 VPS (Salman)
8521ded923 Resolve merge conflict in authStore.ts - use dynamic import for fetchAPI 2025-11-16 13:47:37 +00:00
IGNY8 VPS (Salman)
6342e28b28 Consolidate API documentation into single unified reference
- Created docs/API-COMPLETE-REFERENCE.md as single source of truth
- Removed redundant API documentation files:
  - docs/API-DOCUMENTATION.md
  - docs/DOCUMENTATION-SUMMARY.md
  - docs/README.md
  - unified-api/API-ENDPOINTS-ANALYSIS.md
  - unified-api/API-STANDARD-v1.0.md
- Updated main README.md with API documentation section
- Updated CHANGELOG.md with documentation consolidation details
2025-11-16 13:46:34 +00:00
IGNY8 VPS (Salman)
3a41ba99bb Refactor AI framework to use IntegrationSettings exclusively for model configuration
- Removed hardcoded model defaults and the MODEL_CONFIG dictionary.
- Updated get_model_config() to require an account parameter and raise clear errors if IntegrationSettings are not configured.
- Eliminated unused helper functions: get_model(), get_max_tokens(), and get_temperature().
- Improved error handling to provide specific messages for missing account or model configurations.
- Cleaned up orphan exports in __init__.py to maintain a streamlined codebase.
2025-11-16 12:23:43 +00:00
IGNY8 VPS (Salman)
8908c11c86 Enhance error handling in AIEngine and update ResourceDebugOverlay
- Added error type handling in AIEngine for better error categorization during model configuration and execution.
- Updated _handle_error method to accept and log error types.
- Improved ResourceDebugOverlay to silently ignore 404 responses from the metrics endpoint, preventing unnecessary logging and retries.
- Refactored authStore to utilize fetchAPI for automatic token handling and improved error logging without throwing exceptions.
2025-11-16 11:44:51 +00:00
IGNY8 VPS (Salman)
a492eb3560 Enhance ImagesViewSet and Images component with site and sector filtering
- Added site_id and sector_id query parameter support in ImagesViewSet for filtering content and task-linked images.
- Implemented event listeners in the Images component to refresh data on site and sector changes.
- Updated image prompt handling to allow undefined values.
2025-11-16 10:24:46 +00:00
IGNY8 VPS (Salman)
65c7fb87fa Refactor integration settings handling and error response mapping
- Simplify request data handling in the 'IntegrationSettingsViewSet' by removing unnecessary try-except blocks and improving clarity.
- Enhance API key retrieval logic with better fallback mechanisms for account settings.
- Implement detailed error mapping for OpenAI API responses, ensuring appropriate HTTP status codes are returned based on the response received.
- Update logging for improved visibility during account and settings lookups.
2025-11-16 09:55:12 +00:00
IGNY8 VPS (Salman)
d3ec7cf2e3 Refactor authentication and integration handling
- Exclude the 'MeView' endpoint from public API documentation, marking it as an internal authenticated endpoint.
- Enhance error handling in the 'IntegrationSettingsViewSet' to gracefully manage empty request data and improve logging for account and settings lookups.
- Update API key retrieval logic to ensure fallback mechanisms are more robust and informative.
- Refactor user data fetching in the auth store to utilize a unified API system, improving error handling and data consistency.
2025-11-16 09:49:24 +00:00
IGNY8 VPS (Salman)
36b66b72f0 Step 6a & 6b: Clean up orphan code in __init__.py
- Remove orphan exports: register_function, list_functions, get_model, get_max_tokens, get_temperature, MODEL_CONFIG
- Remove unused imports: register_function, list_functions, get_model, get_max_tokens, get_temperature, MODEL_CONFIG
- Keep only actively used exports and imports
- get_function remains (used internally)
2025-11-16 09:26:03 +00:00
IGNY8 VPS (Salman)
25b1aa39b0 Step 5: Validate account_id is required and exists in tasks.py
- Make account_id parameter required (remove default None)
- Validate account_id is provided before proceeding
- Validate account exists in database
- Return proper error responses with error_type
- Update function docstring to reflect required parameter
2025-11-16 09:22:33 +00:00
IGNY8 VPS (Salman)
91d31ece31 Step 4: Validate account exists before calling get_model_config() in engine.py
- Add account validation before calling get_model_config()
- Wrap get_model_config() in try/except to handle ValueError (IntegrationSettings not configured)
- Handle other unexpected errors from get_model_config()
- Return proper error messages through _handle_error()
- Remove redundant model_from_integration code (get_model_config already handles this)
2025-11-16 09:21:24 +00:00
IGNY8 VPS (Salman)
793b64e437 Step 3: Remove _default_model and require model parameter in run_ai_request()
- Remove _default_model initialization and attribute
- Remove Django settings fallback for model (lines 89-90)
- Remove model loading from IntegrationSettings in _load_account_settings()
- Update run_ai_request() to require model parameter (not Optional)
- Add model validation at start of run_ai_request()
- Deprecate get_model() method (raises error with helpful message)
- Update error handling to use provided model (no fallback)
- Simplify debug logging (removed model_from_settings comparison)
2025-11-16 09:20:13 +00:00
IGNY8 VPS (Salman)
6044fab57d Step 2: Remove MODEL_CONFIG and update get_model_config() to use IntegrationSettings only
- Remove MODEL_CONFIG dict with hardcoded defaults
- Update get_model_config() to require account parameter
- Remove default_config fallback
- Remove unused helper functions (get_model, get_max_tokens, get_temperature)
- Fix generate_images.py to pass account to get_model_config()
- Raise ValueError with clear messages when IntegrationSettings not configured
2025-11-16 09:17:17 +00:00
IGNY8 VPS (Salman)
60ffc12e8c Add AI framework refactoring plan and orphan code audit
- Add REFACTORING-PLAN.md: Plan to remove MODEL_CONFIG and Django settings fallbacks
- Add ORPHAN-CODE-AUDIT.md: Audit of unused code and exports
- Update CHANGELOG.md: Document API Standard v1.0 completion
- Update documentation files
2025-11-16 09:15:07 +00:00
IGNY8 VPS (Salman)
7cd0e1a807 Add health check endpoint and refactor integration response handling
- Introduced a new public health check endpoint at `api/ping/` to verify API responsiveness.
- Refactored integration response handling to utilize a unified success and error response format across various methods in `IntegrationSettingsViewSet`, improving consistency and clarity in API responses.
- Updated URL patterns to include the new ping endpoint and adjusted imports accordingly.
2025-11-16 07:01:19 +00:00
IGNY8 VPS (Salman)
201bc339a8 1 2025-11-16 06:37:17 +00:00
Desktop
64b8280bce Implement security enhancements and unified response formats across API endpoints. Update permission classes for various ViewSets to ensure proper tenant isolation and compliance with API standards. Refactor authentication endpoints to utilize success and error response helpers, improving error tracking and response consistency. Complete documentation updates reflecting these changes and achieving full compliance with API Standard v1.0. 2025-11-16 11:35:47 +05:00
IGNY8 VPS (Salman)
d492b74d40 rem 2025-11-16 05:33:06 +00:00
IGNY8 VPS (Salman)
3694e40c04 Enhance API documentation and schema management by implementing explicit tag configurations for Swagger and ReDoc. Introduce postprocessing hooks to filter auto-generated tags, ensuring only defined tags are used. Update viewsets across various modules to utilize the new tagging system, improving clarity and organization in API documentation. 2025-11-16 04:48:14 +00:00
IGNY8 VPS (Salman)
dee2a36ff0 backup for restore later 2025-11-16 03:28:25 +00:00
IGNY8 VPS (Salman)
60f5d876f0 sad 2025-11-16 03:03:55 +00:00
IGNY8 VPS (Salman)
93333bd95e Add two-way synchronization support between IGNY8 and WordPress, implementing hooks for post save, publish, and status transitions. Enhance API integration with detailed examples for syncing post statuses and fetching WordPress data. Include scheduled sync functionality and comprehensive documentation for the integration flow. 2025-11-16 02:26:18 +00:00
IGNY8 VPS (Salman)
79648db07f Integrate OpenAPI/Swagger documentation using drf-spectacular, enhancing API documentation with comprehensive guides and schema generation. Add multiple documentation files covering authentication, error codes, rate limiting, and migration strategies. Update settings and URLs to support new documentation endpoints and schema configurations. 2025-11-16 02:15:37 +00:00
IGNY8 VPS (Salman)
452d065c22 Implement unified API standard v1.0 across backend and frontend, enhancing error handling, response formatting, and monitoring capabilities. Refactor viewsets for consistent CRUD operations and introduce API Monitor for endpoint health checks. Update migrations to ensure database integrity and remove obsolete constraints and fields. Comprehensive test suite created to validate new standards and functionality. 2025-11-16 01:56:16 +00:00
IGNY8 VPS (Salman)
c439073d33 debug fix 2025-11-16 01:03:54 +00:00