Turn your ideas into complete books.
IDEA2BOOK is a Java 17 + Spring Boot + MySQL book-writing application with an HTML, CSS and JavaScript frontend served directly by Spring Boot.
Create books, generate AI-powered outlines, write chapters, edit manuscripts and export your finished books as Markdown or PDF.
- Create and manage multiple books.
- Organize books by genre and target audience.
- Generate chapter outlines using Groq AI.
- Generate chapter drafts using AI.
- Edit and save chapter content.
- View all your books in a personal library.
- Export manuscripts as Markdown (
.md). - Download complete books as PDF (
.pdf). - Store books and chapters in MySQL.
- Responsive dark-themed writing workspace.
- Java 17
- Spring Boot 3.4.10
- Spring Data JPA
- Hibernate
- MySQL 8+
- HTML5
- CSS3
- JavaScript
- Groq API
- OpenAI-compatible chat completions API
- Default model:
openai/gpt-oss-20b
- OpenPDF
IDEA2BOOK/
│
└── backend/
├── pom.xml
│
└── src/
└── main/
├── java/com/idea2book/
│ ├── Idea2BookApplication.java
│ ├── controller/
│ ├── dto/
│ ├── model/
│ ├── repository/
│ └── service/
│ ├── BookService.java
│ ├── GroqAiService.java
│ └── PdfExportService.java
│
└── resources/
├── application.properties
└── static/
├── index.html
├── css/
│ └── styles.css
└── js/
├── config.js
└── app.js
Before running IDEA2BOOK, install:
- JDK 17
- MySQL 8 or newer
- IntelliJ IDEA
- Maven support through IntelliJ
Open MySQL Workbench and execute:
CREATE DATABASE idea2book;Open:
backend/src/main/resources/application.properties
Configure your MySQL connection:
spring.datasource.url=jdbc:mysql://localhost:3306/idea2book?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC
spring.datasource.username=root
spring.datasource.password=YOUR_MYSQL_PASSWORD
spring.jpa.hibernate.ddl-auto=updateReplace YOUR_MYSQL_PASSWORD with your actual MySQL password.
AI outline and chapter generation require a valid Groq API key.
- Obtain an API key from https://console.groq.com/
- Open IntelliJ IDEA.
- Select Run → Edit Configurations.
- Open the environment variables section.
- Add:
GROQ_API_KEY=your_groq_api_key
The application uses the default model:
openai/gpt-oss-20b
Keep your API key private. Never commit it to GitHub.
- Install JDK 17 and MySQL 8+.
- Create the
idea2bookdatabase. - Configure MySQL credentials in
application.properties. - Configure
GROQ_API_KEYin IntelliJ Run Configurations. - Open the
backendfolder in IntelliJ IDEA. - Wait for Maven dependencies to download.
- Run:
com.idea2book.Idea2BookApplication
- Open your browser:
http://localhost:8080
Both frontend and backend run from the same Spring Boot application. No VS Code Live Server is required.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/books |
Get all books |
| POST | /api/books |
Create a book |
| GET | /api/books/{bookId} |
Get book details |
| POST | /api/books/{bookId}/outline |
Generate book outline |
| POST | /api/books/{bookId}/chapters/{chapterId}/generate |
Generate chapter |
| PUT | /api/books/{bookId}/chapters/{chapterId} |
Update chapter |
| GET | /api/books/{bookId}/export |
Export as Markdown |
| GET | /api/books/{bookId}/pdf |
Download as PDF |
| DELETE | /api/books/{bookId} |
Delete a book |
Download your manuscript as a .md file.
Download your book as a .pdf file using the PDF export endpoint:
http://localhost:8080/api/books/1/pdf
Replace 1 with your actual book ID.
- MySQL must be running before starting the application.
- AI generation requires a valid Groq API key.
- Book creation, editing and Markdown export work through the local backend and database.
- PDF export requires the OpenPDF dependency and
PdfExportService. - Hibernate automatically updates compatible database schema changes with
ddl-auto=update.
- EPUB export.
- Custom book cover designs.
- Table of contents and page numbering.
- Chapter word counts.
- Multiple PDF templates.
- User authentication and personal accounts.
- Book sharing and publishing.
IDEA2BOOK — Every great book begins with an idea.