How webby813/mbti_bot works
Project type and purpose
• This is a single-page, Streamlit-based, AI-powered academic advisory web application.
• Purpose:
• Let students take an MBTI style quiz
• Generate personalized course recommendations using Google Generative AI
File structure
• Top-level files:
• academyAI.py (core Streamlit app and orchestration logic)
• json_loader.py (loads and parses courses_info.json)
• courses_info.json (static course data)
• assets/ (images and UI assets)
• requirements.txt (.env configuration)
• No separate “frontend” or “backend” directories—this is a monolith using Streamlit for both UI and server logic.
README for additional insights
• Streamlit drives the UI pages: Home, Personality Assessment, Course Recommendations.
• Key modules:
• load_lottie_url → Lottie animations for UX
• create_radar_chart → Plotly radar chart generator
• create_progress_animation → Progress bars during API calls
• generate_recommendations → Calls Google Generative AI API
Main components and their interactions
a. Components
1. End-User (Web Browser)
2. Streamlit Server (academyAI.py)
• UI Layer: renders pages, forms, buttons
• Controller Logic: routes user actions to functions
3. Personality Quiz Module (built‐in forms in Streamlit)
4. Data Loader (json_loader.py + courses_info.json)
5. Visualization Module (Plotly Radar Chart + Lottie animations)
6. Progress Animation Module
7. AI Integration Layer (generate_recommendations → Google Generative AI API)
8. Static Assets Server (images under assets/)
9. Environment Config (.env → GEMINI_API_KEY)
b. Relationships & Data Flow
• User sends requests (clicks “Start Quiz”, “Get Recommendations”)
→ Streamlit Server
→ Quiz Module reads/writes user inputs
→ Controller invokes Data Loader to fetch course metadata
→ Controller invokes Visualization Module to display radar chart
→ Controller invokes Progress Animation while calling AI Integration
→ AI Integration calls Google API over HTTPS
→ API returns suggestions → Controller formats results
→ Streamlit Server returns UI updates and downloadable .txt file
c. Architectural patterns / principles
• Monolithic, event‐driven server (Streamlit handles both UI & backend logic)
• Modular function decomposition (each feature in its own function)
• Single responsibility for each module: loading data, visualizing, API calls
d. Key technologies & libraries
• Streamlit (web UI & server framework)
• Plotly (data visualization)
• Lottie (animations)
• Python standard libs + json_loader
• Google Generative AI API
• Static JSON for course catalog