Skip to content
rajattiwariindPublic

About

An AI-powered book writing platform built with Java, Spring Boot, MySQL, and HTML, CSS & JavaScript. Create books, generate chapter outlines and content using Groq AI, edit chapters, and export your books as Markdown or PDF.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IDEA2BOOK

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.

Features

  • 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.

Technology Stack

Backend

  • Java 17
  • Spring Boot 3.4.10
  • Spring Data JPA
  • Hibernate
  • MySQL 8+

Frontend

  • HTML5
  • CSS3
  • JavaScript

AI Integration

  • Groq API
  • OpenAI-compatible chat completions API
  • Default model: openai/gpt-oss-20b

PDF Export

  • OpenPDF

Project Structure

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

Requirements

Before running IDEA2BOOK, install:

  1. JDK 17
  2. MySQL 8 or newer
  3. IntelliJ IDEA
  4. Maven support through IntelliJ

Database Setup

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=update

Replace YOUR_MYSQL_PASSWORD with your actual MySQL password.

Groq API Configuration

AI outline and chapter generation require a valid Groq API key.

  1. Obtain an API key from https://console.groq.com/
  2. Open IntelliJ IDEA.
  3. Select Run → Edit Configurations.
  4. Open the environment variables section.
  5. 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.

Run in IntelliJ IDEA

  1. Install JDK 17 and MySQL 8+.
  2. Create the idea2book database.
  3. Configure MySQL credentials in application.properties.
  4. Configure GROQ_API_KEY in IntelliJ Run Configurations.
  5. Open the backend folder in IntelliJ IDEA.
  6. Wait for Maven dependencies to download.
  7. Run:
com.idea2book.Idea2BookApplication
  1. Open your browser:
http://localhost:8080

Both frontend and backend run from the same Spring Boot application. No VS Code Live Server is required.

API Endpoints

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

Export Formats

Markdown

Download your manuscript as a .md file.

PDF

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.

Important Notes

  • 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.

Future Improvements

  • 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.

About

An AI-powered book writing platform built with Java, Spring Boot, MySQL, and HTML, CSS & JavaScript. Create books, generate chapter outlines and content using Groq AI, edit chapters, and export your books as Markdown or PDF.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages