Commit Graph

3 Commits

Author SHA1 Message Date
55fcce9a38 fix: Resolve IPv4/IPv6 connection issues in News Engine Console
- Backend: Downgrade Pydantic from v2 to v1.10.13 for compatibility
- Backend: Fix ObjectId to string conversion in user service
- Backend: Update config to use pydantic BaseSettings (v1 import)
- Frontend: Downgrade ESLint packages for compatibility
- Frontend: Configure Vite proxy to use 127.0.0.1 instead of localhost
- Frontend: Set API client to use direct backend URL (127.0.0.1:8101)
- Frontend: Add package-lock.json for dependency locking

This resolves MongoDB connection issues and frontend-backend
communication problems caused by localhost resolving to IPv6.
Verified: Login and dashboard functionality working correctly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-04 21:39:32 +09:00
1d461a7ded test: Fix Pydantic v2 compatibility and comprehensive API testing
This commit migrates all models to Pydantic v2 and adds comprehensive
testing infrastructure for the news-engine-console backend.

Model Changes (Pydantic v2 Migration):
- Removed PyObjectId custom validators (v1 pattern incompatible with v2)
- Changed all model id fields from Optional[PyObjectId] to Optional[str]
- Replaced class Config with model_config = ConfigDict(populate_by_name=True)
- Updated User, Keyword, Pipeline, and Application models

Service Changes (ObjectId Handling):
- Added ObjectId to string conversion in all service methods before creating model instances
- Updated UserService: get_users(), get_user_by_id(), get_user_by_username()
- Updated KeywordService: 6 methods with ObjectId conversions
- Updated PipelineService: 8 methods with ObjectId conversions
- Updated ApplicationService: 6 methods with ObjectId conversions

Testing Infrastructure:
- Created comprehensive test_api.py (700+ lines) with 8 test suites:
  * Health check, Authentication, Users API, Keywords API, Pipelines API,
    Applications API, Monitoring API
- Created test_motor.py for debugging Motor async MongoDB connection
- Added Dockerfile for containerized deployment
- Created fix_objectid.py helper script for automated ObjectId conversion

Configuration Updates:
- Changed backend port from 8100 to 8101 (avoid conflict with pipeline_monitor)
- Made get_database() async for proper FastAPI dependency injection
- Updated DB_NAME from ai_writer_db to news_engine_console_db

Bug Fixes:
- Fixed environment variable override issue (system env > .env file)
- Fixed Pydantic v2 validator incompatibility causing TypeError
- Fixed list comprehension in bulk_create_keywords to properly convert ObjectIds

Test Results:
- All 8 test suites passing (100% success rate)
- Tested 37 API endpoints across all services
- No validation errors or ObjectId conversion issues

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-04 17:17:54 +09:00
7649844023 feat: Initialize News Engine Console project
Create comprehensive news pipeline management and monitoring system
with backend API structure and detailed implementation roadmap.

Core Features (7):
1. Keyword Management - Pipeline keyword CRUD and control
2. Pipeline Monitoring - Processing stats and utilization metrics
3. Pipeline Control - Step-wise start/stop and scheduling
4. Logging System - Pipeline status logs and error tracking
5. User Management - User CRUD with role-based access (Admin/Editor/Viewer)
6. Application Management - OAuth2/JWT-based Application CRUD
7. System Monitoring - Service health checks and resource monitoring

Technology Stack:
- Backend: FastAPI + Motor (MongoDB async) + Redis
- Frontend: React 18 + TypeScript + Material-UI v7 (planned)
- Auth: JWT + OAuth2
- Infrastructure: Docker + Kubernetes

Project Structure:
- backend/app/api/ - 5 API routers (keywords, pipelines, users, applications, monitoring)
- backend/app/core/ - Core configurations (config, database, auth)
- backend/app/models/ - Data models (planned)
- backend/app/services/ - Business logic (planned)
- backend/app/schemas/ - Pydantic schemas (planned)
- frontend/ - React application (planned)
- k8s/ - Kubernetes manifests (planned)

Documentation:
- README.md - Project overview, current status, API endpoints, DB schema
- TODO.md - Detailed implementation plan for next sessions

Current Status:
 Project structure initialized
 Backend basic configuration (config, database, auth)
 API router skeletons (5 routers)
 Requirements and environment setup
🚧 Models, services, and schemas pending
📋 Frontend implementation pending
📋 Docker and Kubernetes deployment pending

Next Steps (See TODO.md):
1. MongoDB schema and indexes
2. Pydantic schemas with validation
3. Service layer implementation
4. Redis integration
5. Login/authentication API
6. Frontend basic setup

This provides a solid foundation for building a comprehensive
news pipeline management console system.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-04 16:16:09 +09:00