# fiction-creation-service **Repository Path**: luo_pc/fiction-creation-service ## Basic Information - **Project Name**: fiction-creation-service - **Description**: No description available - **Primary Language**: TypeScript - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-10-01 - **Last Updated**: 2025-10-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Fiction Creation Service A comprehensive AI-powered novel generation system with dual UI implementations: JavaFX desktop application and React web application. ## Project Structure ``` fiction-creation-service/ ├── fiction-core/ # Core business logic and domain models ├── fiction-api/ # Spring Boot REST API ├── fiction-desktop/ # JavaFX desktop application ├── fiction-web/ # React web frontend └── pom.xml # Maven parent POM ``` ## Features - **AI-Powered Generation**: Support for multiple LLM providers (OpenAI, DeepSeek, Gemini, etc.) - **Novel Architecture**: Automated generation of complete novel structures using snowflake method - **Chapter Management**: Intelligent chapter generation with consistency checking - **Vector Knowledge Base**: ChromaDB integration for context-aware generation - **Dual UI**: Both desktop (JavaFX) and web (React) interfaces - **Multi-Provider Support**: Flexible LLM provider configuration ## Technology Stack ### Backend - **Java 17+** - **Spring Boot 3.2** (REST API) - **LangChain4j** (LLM integration) - **Qdrant/ChromaDB** (Vector database) - **Maven** (Build tool) ### Desktop UI - **JavaFX 21** - **Scene Builder** (FXML) - **Jackson** (JSON processing) ### Web UI - **React 18** with TypeScript - **Ant Design** (UI components) - **Zustand** (State management) - **Tailwind CSS** (Styling) - **Axios** (HTTP client) ## Quick Start ### Prerequisites - Java 17 or higher - Maven 3.8+ - Node.js 18+ (for web UI) ### Build All Modules ```bash mvn clean install ``` ### Run Desktop Application ```bash cd fiction-desktop mvn javafx:run ``` ### Run API Server ```bash cd fiction-api mvn spring-boot:run ``` ### Run Web Frontend ```bash cd fiction-web npm install npm start ``` ## Configuration ### LLM Configuration The system supports multiple LLM providers: ```json { "apiKey": "your-api-key", "baseUrl": "https://api.openai.com/v1", "modelName": "gpt-4o-mini", "interfaceFormat": "OPENAI", "temperature": 0.7, "maxTokens": 4096, "timeout": 600 } ``` ### Novel Configuration ```json { "topic": "Your novel theme", "genre": "Fantasy", "numberOfChapters": 10, "wordCountPerChapter": 3000, "filePath": "/path/to/output", "userGuidance": "Optional guidance" } ``` ## API Endpoints ### Novel Generation - `POST /api/v1/novel/architecture/generate` - Generate novel architecture - `POST /api/v1/novel/blueprint/generate` - Generate chapter blueprint - `POST /api/v1/novel/llm/test` - Test LLM connection ### API Documentation When running the API server, visit: - Swagger UI: http://localhost:8080/swagger-ui.html - OpenAPI Spec: http://localhost:8080/api-docs ## Development ### Project Standards - Java 17+ features and best practices - Spring Boot 3.x conventions - React functional components with hooks - TypeScript for type safety - Comprehensive error handling - Logging with SLF4J/Logback ### Testing ```bash # Run all tests mvn test # Run specific module tests mvn test -pl fiction-core ``` ### Building ```bash # Build all modules mvn clean package # Build specific module mvn clean package -pl fiction-api ``` ## Deployment ### Desktop Application ```bash cd fiction-desktop mvn clean package # Executable JAR in target/ ``` ### Web Application ```bash # Build API cd fiction-api mvn clean package # Build Frontend cd fiction-web npm run build # Combined deployment java -jar fiction-api/target/fiction-api-1.0.0.jar ``` ## Docker Deployment ### API + Web ```bash # Build the application mvn clean package # Run with Docker Compose docker-compose up ``` ## Architecture ### Core Domain Models - `NovelConfiguration` - Novel parameters and settings - `Chapter` - Individual chapter data and metadata - `LLMConfiguration` - AI model configuration - `ChapterStatus` - Chapter workflow states ### Service Layer - `NovelGenerationService` - Core generation logic - `PromptTemplateService` - AI prompt management - `ConsistencyCheckService` - Content validation ### Integration Layer - `LLMAdapter` - Abstract LLM interface - Multiple provider implementations (OpenAI, DeepSeek, etc.) - Vector database integration ## Contributing 1. Fork the repository 2. Create a feature branch 3. Follow coding standards 4. Add comprehensive tests 5. Submit a pull request ## License This project is licensed under the MIT License - see the LICENSE file for details. ## Support For issues and questions: - Create an issue on GitHub - Check the documentation - Review the API docs at `/swagger-ui.html`