How sofianechehboune/-greenboost---analyse-par-google-gemini works
Project Type and Purpose
• This is a single‐page/multi‐page interactive Streamlit application (“GreenBoost Gemini App”) that leverages Google’s Generative AI (Gemini) to perform text summarization, keyword extraction, and related‐prompt generation. Users interact via a web UI, the app calls AI services, processes results, and renders them back in dashboards and visualisations.
File Structure Analysis
• Top‐Level Files
• streamlit_app.py: main entry point launching the Streamlit server and routing to pages.
• header.py, style.css: global UI elements and styling.
• requirements.txt, .gitignore: dependencies and ignore rules.
• .devcontainer/, .streamlit/: development configuration (VS Code dev container, Streamlit theming via config.toml).
• Directories
• modules/: core logic and helper classes
– gemini_utils.py: API wrappers for Google Gemini
– prompt_templates.py: prompt‐engineering templates
– analysis_tools.py: post‐processing, text analysis functions
– ui_components.py: custom Streamlit UI widgets
• pages/: Streamlit pages
– 🎨 Visualisations.py
– 📊 Tableau de bord.py
• assets/: static images or resources
Key README Insights
• Features: Summaries, keyword extraction, prompt generation, theming, secure API key (.env).
• Tech Stack: Streamlit (web UI), Google Generative AI, Pandas, Pillow, python‐dotenv.
• Deployment: Streamlit Cloud; must include requirements.txt, config.toml, set GOOGLE_API_KEY.
a. Main Components
1. Client Browser / User
2. Streamlit Server (streamlit_app.py + pages + header + style)
3. UI Components Layer (ui_components.py, header.py)
4. Business Logic Layer (modules/analysis_tools.py, prompt_templates.py)
5. API Wrapper Layer (modules/gemini_utils.py)
6. External Service: Google Gemini Generative AI API
7. Configuration & Secrets (.env, .streamlit/config.toml)
8. Assets (assets folder)
b. Relationships & Data Flow
• User enters text in UI → Streamlit server forwards to UI components → Business logic transforms input → Prompt templates assemble requests → API wrapper calls Google Gemini → Results returned → Analysis tools post‐process output → UI components render summaries/keywords/dashboards → Browser displays results.
• Configuration is loaded at startup (API keys, theme settings).
c. Architectural Patterns & Principles
• Layered Architecture (Presentation → Application Logic → API Integration → External Service)
• Separation of Concerns: UI code vs. prompt engineering vs. API calls vs. data processing
• Modular Design: each module focused on a single responsibility
d. Technologies & Frameworks
• Python & Streamlit for UI
• Google Generative AI (Gemini) for NLP tasks
• Pandas & Pillow for data/image handling
• python‐dotenv for secret management