An AI-powered writing platform designed for fantasy authors, combining modern web technologies with AI services to create an immersive writing experience. The platform enables authors to generate images, create audio narration, and get AI-powered summaries of their work.
The project follows a microservices architecture with the following key components:
fantasy-writer-ai/
├── backend/ # Spring Boot backend services
│ └── CoreService/ # Main backend service with business logic
├── Frontend/ # React + TypeScript frontend application
├── audio-service/ # Python-based text-to-speech service
└── Scraping/ # Data collection and processing utilities
-
User Management (PostgreSQL)
- User authentication and authorization
- Token balance tracking
- Payment transaction history
- Role-based access control
-
Content Management (MongoDB)
- Books: Main container for fantasy stories
- Chapters: Organized sections within books
- Pages: Individual content units with text
- Image Prompts: AI-generated image descriptions
-
Book Management
- CRUD operations for books
- Chapter organization
- Page management
- Ownership verification
-
User Services
- Authentication with JWT
- Token management
- Payment processing
- Usage tracking
-
AI Integration
- Text-to-Speech conversion
- Image generation from prompts
- Content summarization
- JWT-based authentication
- Role-based access control
- Secure password handling
- Token-based API access
- Initial token balance for new users
- Token usage tracking
- Payment integration for token purchase
- Usage logging and monitoring
- MinIO for audio file storage
- Image storage and retrieval
- CORS configuration for web access
- Secure file access control
- Rich text editor for fantasy story creation
- Chapter organization and management
- Real-time saving and version control
- Image Generation: Convert text descriptions into visual scenes
- Audio Narration: Transform written content into natural-sounding audio
- Secure authentication and authorization
- Role-based access control (Writer, Editor, Admin)
- User profile management
- Framework: Spring Boot (Java)
- Databases:
- PostgreSQL for user management and authentication
- MongoDB for content storage (books, chapters, pages)
- Authentication: JWT-based security
- API: RESTful architecture
- Framework: React with TypeScript
- Styling: Tailwind CSS
- Build Tool: Vite
- State Management: React Context/Hooks
- MinIO: Object storage for audio files and generated images
- S3-compatible storage solution
- Used for storing and serving media files
- Configured with CORS for web access
- MongoDB: Document database for content
- Stores books, chapters, pages, and summaries
- Handles flexible document structures
- Supports complex queries and relationships
- Audio Service: Python-based TTS implementation
- Image Generation: Integration with AI image generation APIs
- Text Processing: Natural Language Processing for summaries
- Java 21 or later
- Node.js 18+ and npm
- Python 3.8+ (for audio service)
- Docker and Docker Compose
- MongoDB 6.0+
- MinIO Server
- Navigate to the backend directory:
cd backend/CoreService
- Build and run using Maven:
./mvnw clean install
./mvnw spring-boot:run
- Navigate to the Frontend directory:
cd Frontend
- Install dependencies:
npm install
- Start the development server:
npm run dev
- Navigate to the audio-service directory:
cd audio-service
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Run the service:
python audio_service.py
- Start MongoDB and MinIO using Docker Compose:
cd backend
docker-compose up -d