This is a medical text translation application that converts German medical texts into "Leichte Sprache" (Easy Language) using Googles's Gemini 2.5 API. The application is designed to make complex medical information accessible to people with learning difficulties or limited German language skills. It features a Flask-based web interface where users can input medical text and receive simplified translations following strict Leichte Sprache guidelines.
Preferred communication style: Simple, everyday language.
- Technology: HTML5, Bootstrap 5, vanilla JavaScript
- Design Pattern: Single-page application with responsive design
- UI Components: Two-column layout with input/output cards, character counter, loading states
- Accessibility: Medical-themed styling with clear visual hierarchy and user feedback
- Framework: Flask web framework with SQLAlchemy ORM
- Application Structure: Modular design with separated concerns:
app.py: Application factory and configurationroutes.py: Request handling and API endpointsmodels.py: Database modelsgemini_service.py: External AI service integration
- Database: SQLite for development with configurable DATABASE_URL for production
- Session Management: Flask sessions with configurable secret key
- Primary Database: SQLite (development) with PostgreSQL support via environment configuration
- ORM: SQLAlchemy with DeclarativeBase pattern
- Schema: Simple Translation model storing original text, translated text, and timestamps
- Connection Pooling: Configured with pool recycling and pre-ping for reliability
- Current State: No authentication implemented
- Session Security: Configurable session secret key via environment variables
- Security Middleware: ProxyFix for handling reverse proxy headers
- Endpoints:
GET /: Main application interfacePOST /translate: Text translation processingGET /history: Translation history retrieval
- Data Format: JSON for API communication
- Error Handling: Structured error responses with user-friendly messages
- Input Validation: Text length limits (5000 characters) and content validation
- Google Gemini API: Gemini-2.5-flash model for text translation
- Configuration: API key via GEMINI_API_KEY environment variable
- Usage: Complex prompt engineering for Leichte Sprache conversion with specific linguistic rules
- Benefits: Generous free tier, reliable performance for German medical text translation
- Bootstrap 5: UI framework for responsive design
- Font Awesome 6: Icon library for visual elements
- CDN Delivery: External CSS/JS resources loaded via CDN
- Flask: Web framework
- Flask-SQLAlchemy: Database ORM integration
- google-genai: Official Google Gemini Python client
- Werkzeug: WSGI utilities and middleware
- WSGI: ProxyFix middleware for deployment behind reverse proxies
- Environment Configuration: Database URL and API keys via environment variables
- Logging: Python logging module for debugging and error tracking
- Database: SQLite for local development
- Debug Mode: Flask debug mode enabled for development
- Hot Reload: Development server with auto-restart capabilities