Skip to content

subham9898/12-day-Springboot-challenge-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

# 🩸 Blood Report AI Analyzer

A Java Spring Boot + n8n + MySQL web app that:
- Takes a PDF blood report from the user
- Extracts text (OCR if scanned)
- Analyzes it using an AI model (OpenAI / Gemini)
- Returns a structured + human-readable report

Inspired by tools like SmallPDF, but built for **learning** and **automation-ready workflows**.

---

## πŸ“Œ Features
- PDF upload (supports scanned and digital)
- Text extraction with Apache PDFBox / Tesseract OCR
- AI analysis of blood parameters (status, causes, recommendations)
- Structured table + narrative report
- Optional PDF export of results
- MySQL storage for history
- n8n integration for AI calls or PDF generation

---

## πŸ—“ 5-Day Build Roadmap

### **Day 1 – Project Setup & File Upload**
**Goals:**
- Create Spring Boot web app (Maven)
- Enable PDF upload (Multipart)
- Store uploaded file temporarily

**Steps:**
- Setup dependencies:

spring-boot-starter-web spring-boot-starter-thymeleaf (or JSP) spring-boot-starter-data-jpa mysql-connector-j commons-fileupload pdfbox

- Folder structure:

/controller /service /model /repository /resources/templates (or JSP)

- File upload form (Thymeleaf/JSP)
- Controller to handle `MultipartFile` uploads

**AI Shortcut:**  
Ask GitHub Copilot:  
*"Generate Spring Boot controller to handle PDF file upload and save to local folder."*

---

### **Day 2 – PDF Text Extraction**
**Goals:**
- Extract text from PDF (digital or scanned)

**Steps:**
- For digital PDFs β†’ **Apache PDFBox**
- For scanned PDFs β†’ Convert to images + OCR with **Tesseract (tess4j)**
- Optional: Store extracted text in MySQL

**AI Shortcut:**  
Use n8n **PDF Extract Node** or **Google Cloud Vision API**.

---

### **Day 3 – AI Analysis Pipeline**
**Goals:**
- Send extracted text to AI model
- Receive structured & narrative analysis

**Options:**
- **In Spring Boot:** Call OpenAI/Gemini API with Java HTTP requests
- **In n8n:** Send extracted text to a webhook β†’ AI Node β†’ Return JSON

**Prompt Example:**

Analyze the following blood report data and give:

  1. All parameter values
  2. Status: Low / Normal / High
  3. Possible causes
  4. Suggestions Report text: {{EXTRACTED_TEXT}}

---

### **Day 4 – Display Results**
**Goals:**
- Show table + summary in UI
- Enable PDF download

**Steps:**
- HTML table for: Parameter | Value | Normal Range | Status
- Summary section for recommendations
- Export as PDF with **iText/OpenPDF** or n8n HTML→PDF node

---

### **Day 5 – Polish & Deploy**
**Goals:**
- Clean UI
- Store history in MySQL
- Deploy to cloud

**Steps:**
- MySQL Table:
  ```sql
  CREATE TABLE reports (
      id BIGINT PRIMARY KEY AUTO_INCREMENT,
      filename VARCHAR(255),
      extracted_text TEXT,
      analysis TEXT,
      created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
  );
  • History page listing all reports
  • Deploy to Render / Railway / other hosting

πŸ“Œ Automation vs Learning Mode

Task Learn Mode (Manual) AI Shortcut (Automation)
File upload Write controller code Copilot scaffold
PDF extraction Apache PDFBox + Tesseract n8n PDF Extract Node
AI call Java HTTP request to API n8n OpenAI/Gemini Node
Formatting Java parsing + HTML table AI returns JSON β†’ render directly
PDF export iText/OpenPDF n8n HTML→PDF Node

πŸ›  Extended 12-Day Learning Plan

(For mastering Spring Boot + AI integration)

Day 1: Java OOP basics & BloodReport class Day 2: Spring Boot setup & /hello endpoint Day 3: REST APIs with @RestController Day 4: MySQL + JPA setup Day 5: AI analysis service (Hemoglobin) Day 6: Add WBC analysis Day 7: n8n webhook integration Day 8: Validation with @Valid Day 9: CRUD endpoints for reports Day 10: JUnit testing + Postman tests Day 11: Deploy to Render / Railway Day 12: Final bugfix & demo


πŸ“š Resources


πŸš€ Quick Start

  1. Clone repo:

    git clone https://github.com/yourusername/blood-report-ai.git
    cd blood-report-ai
  2. Add API keys in .env or application.properties

  3. Run:

    mvn spring-boot:run
  4. Open browser at http://localhost:8080


πŸ’‘ Tip

For faster progress, build core upload + AI integration first. Enhance with OCR, MySQL history, and PDF export after you get a working MVP.


---

Do you want me to also make a **workflow diagram** for this so your README has visuals?  
That would make it look more like a real SaaS project page.

About

12-Day Spring Boot Challenge πŸš€ I'm taking on a 12-day challenge to master Spring Boot from scratch and build an AI Blood Report Generator! πŸ’»πŸ©Ί Goal: Learn Java, Spring Boot, MySQL, and N8N to create a real-world API that analyzes blood reports with AI. Plan: 5 hours/day of coding, debugging, and deploying. Follow my journey for daily updates! 🌟

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages