IAV-445/Boostrapping the service
IAVIA SEO Service - Initial Implementation
API Endpoints & Controllers
- Create SeoController with 10 RESTful endpoints for article management
- Implement single article generation endpoint (POST /api/seo/articles/generate)
- Add bulk article generation for batch processing (POST /api/seo/articles/bulk-generate)
- Build semantic search endpoint with vector embeddings (POST /api/seo/articles/search)
- Create article retrieval and deletion endpoints with tenant verification
- Implement WordPress publishing endpoint (POST /api/seo/articles/{id}/publish-wordpress)
- Add WordPress drafts retrieval with pagination support
- Build AI suggestions configuration endpoints for automated generation
- Create tenant analytics endpoints for statistics and spending reports
Service Layer Implementation
- Implement SeoService interface with comprehensive business logic
- Build complete article generation workflow with context awareness
- Add semantic search using existing articles for better content quality
- Implement credit validation and automatic cost deduction
- Create WordPress publishing logic with featured image support
- Build AI suggestions configuration management with in-memory storage
- Add automatic topic generation from AI configuration
- Implement tenant statistics aggregation and spending analysis
External Integrations
- Integrate LiteLLM proxy for multi-model AI access (gpt-5-nano, gpt-5-mini, gpt-5, gpt-4o-mini)
- Build LiteLLMClient for chat completions, embeddings, and image generation
- Integrate Qdrant vector database for semantic search and article storage
- Create QdrantClient for point insertion, search, and deletion operations
- Implement Credit Service integration for billing and usage tracking
- Build CreditServiceClient with balance checking and deduction logic
- Integrate WordPress REST API for direct article publishing
- Create WordPressClient with authentication and media upload support
DTOs & Data Models
- Create request DTOs for all endpoints (Generate, BulkGenerate, Search, Publish, etc.)
- Build response DTOs with comprehensive metadata and cost tracking
- Implement ArticleResponse with full article data and usage metrics
- Add TenantStatsResponse for aggregated statistics
- Create TenantSpendingResponse for date-range spending analysis
- Build internal data models using Records for immutability (ArticlePayload)
- Add LiteLLM request/response models (ChatMessage, EmbeddingResult, etc.)
- Create Qdrant models for vector operations (QdrantPoint, QdrantSearchRequest)
Configuration & Infrastructure
- Configure LiteLLM integration with ConfigurationProperties
- Add Qdrant vector database configuration
- Implement WordPress connection settings (URL, credentials, defaults)
- Configure Credit Service endpoints and integration
- Create environment-specific configurations (application-local.yml, application-pro.yml)
- Set up Spring Security with stateless authentication
Core Features
- Implement context-aware article generation using semantic search
- Add automatic featured image generation with Gemini 2.5 Flash Image
- Build comprehensive cost tracking with token usage reporting
- Create multi-tenant architecture with tenant isolation and verification
- Implement graceful error handling and partial success in bulk operations
- Add pre-generation cost estimation based on word count and model
- Build AI suggestions framework for scheduled content generation
- Implement automatic cost conversion and credit deduction