Sari la conținut

Requirements Specification

Overview

BioCoursesGenerator aims to provide educators with an intuitive tool for converting scanned curriculum documents into structured, comprehensive course materials using AI-powered content processing.

Functional Requirements

FR-001: Document Upload and Validation

Priority: High User Story: As an educator, I want to upload scanned curriculum documents so that I can process them into course materials.

Requirements: - Support PDF, JPEG, PNG file formats - Maximum file size: 50MB - File type validation with user feedback - Progress indication during upload - Drag-and-drop interface - File browser integration

FR-002: Optical Character Recognition (OCR)

Priority: High User Story: As a user, I want the system to extract text from scanned documents so that curriculum content can be processed.

Requirements: - Tesseract OCR integration - Romanian language support - Text cleaning and normalization - Table structure preservation - Hierarchical numbering recognition - Error rate monitoring and reporting

FR-003: LLM Content Structuring

Priority: High User Story: As an educator, I want the extracted curriculum to be analyzed and structured by AI so that it generates comprehensive course content.

Requirements: - Integration with LLM API endpoint /gpt_generate_book_toc_with_prompts - Context-aware content processing - Hierarchical TOC generation - Content prompts for each section - Romanian language output - Error handling for API timeouts/failures

FR-004: PDF Generation

Priority: High User Story: As a user, I want structured content to be compiled into a downloadable PDF course book.

Requirements: - Integration with PDF generation API /gpt_toc_to_pdf - Direct download link provision - File storage in /outputs/ directory - Generation status monitoring - Error handling and retry logic

FR-005: Progress Monitoring

Priority: Medium User Story: As a user, I want to see processing progress so that I can understand what's happening during long operations.

Requirements: - Real-time progress updates - Stage-by-stage visualization (OCR → LLM → PDF) - Time estimates and remaining duration - Cancel capability during processing - Status messages and error notifications

FR-006: File Management

Priority: Medium User Story: As a system administrator, I want proper file handling so that storage is managed efficiently.

Requirements: - Temporary file cleanup after processing - Organized directory structure - File retention policies (30 days) - Naming conventions for generated files - Storage quota management

FR-007: OCR Text Editing (Nice-to-Have)

Priority: Low User Story: As a user, I want to edit OCR-extracted text before processing so that I can correct errors and optimize content.

Requirements: - Text preview interface - Basic editing capabilities (text area) - Syntax highlighting for structure keywords - Save/cancel functionality - Recovery from OCR failures

FR-008: TOC Editing Interface (Nice-to-Have)

Priority: Low User Story: As an educator, I want to modify generated TOC structure so that I can customize course organization.

Requirements: - Tree view of course structure - Add/remove sections and subsections - Edit titles and content prompts - Reorganize hierarchy (drag & drop) - Preview changes before PDF generation

Non-Functional Requirements

Performance

NFR-001: Processing Time - OCR: Maximum 60 seconds per page - LLM Processing: Maximum 5 minutes for typical curriculum - PDF Generation: Maximum 3 minutes for standard content - Total workflow: Maximum 10 minutes for 50MB documents

NFR-002: Responsiveness - UI response time: < 200ms for local operations - API timeouts: Configurable, default 10 minutes - Concurrent users: Minimum support for 3 simultaneous uploads - Memory usage: Maximum 4GB during intensive operations

Scalability

NFR-003: File Size Handling - Graceful degradation for large files - Chunked processing for content exceeding memory limits - Memory-efficient algorithms for OCR and text processing

NFR-004: Load Handling - Single-threaded processing acceptable for initial version - Future support for concurrent processing - Resource monitoring and automatic throttling

Reliability

NFR-005: Uptime Requirements - System available during scheduled processing hours - Graceful error recovery - Data integrity during processing failures

NFR-006: Error Recovery - Automatic retry for transient failures (max 3 attempts) - Detailed error logging and reporting - Fallback options for failed operations

Security

NFR-007: Data Protection - No permanent storage of input documents - Automatic cleanup of temporary files - Secure API communication (HTTPS) - File type validation and malware scanning

NFR-008: Privacy - Opt-out for any data collection - No user tracking beyond system logs - GDPR compliance for personal information

Usability

NFR-009: User Experience - Intuitive workflow with minimal steps - Clear progress and status feedback - Accessible error messages with actionable guidance - Consistent terminology throughout interface

NFR-010: Accessibility - WCAG 2.1 AA compliance where feasible - Keyboard navigation support - Screen reader compatibility - Clear visual hierarchy

Maintainability

NFR-011: Code Quality - Modular architecture with clear separation of concerns - Comprehensive documentation - Unit tests for core functionality - Logging for debugging and monitoring

NFR-012: Extensibility - Plugin architecture for future OCR engines - API abstraction for LLM providers - Configuration-driven feature toggles

Compatibility

NFR-013: Browser Support - Chrome/Edge: Latest 2 versions - Firefox: Latest 2 versions - Safari: Latest 2 versions - Progressive enhancement for older browsers

NFR-014: Operating System - Linux (Ubuntu 20.04+, CentOS 8+) - Windows 10/11 with WSL - macOS 11+ with Rosetta 2

Technical Constraints

Dependency Requirements

  • Python 3.9+
  • Streamlit 1.28+
  • Tesseract OCR with Romanian language pack
  • Network connectivity to LLM API server

Integration Constraints

  • Fixed API endpoints and request/response formats
  • No control over external API availability
  • Must work with provided file storage mechanisms

Assumptions

User Assumptions

  • Users have basic computer literacy
  • Documents are primarily in Romanian
  • Curriculum content follows academic formatting conventions
  • High-quality scans are provided for optimal results

Technical Assumptions

  • LLM API remains stable and available
  • File storage server supports provided format
  • Network bandwidth sufficient for file transfers
  • Local system has adequate resources for OCR processing

Dependencies and Risks

External Dependencies

  • Open-source OCR engines (Tesseract)
  • Streamlit framework stability
  • External LLM API reliability
  • File storage service availability

Project Risks

  • API service downtime affects core functionality
  • OCR accuracy depends on document quality
  • Processing time varies with document complexity
  • Romanian language support in OCR engines

Acceptance Criteria

Minimum Viable Product (MVP)

  • [ ] Upload and validate curriculum documents
  • [ ] Perform OCR text extraction
  • [ ] Generate TOC via LLM API
  • [ ] Create and download PDF course books
  • [ ] Provide progress feedback during processing
  • [ ] Basic error handling and user feedback

Enhanced Features

  • [ ] OCR text preview and editing
  • [ ] TOC editing interface
  • [ ] Advanced progress tracking
  • [ ] Batch processing capabilities
  • [ ] Enhanced error recovery