How venkatjogi/ai-workshop works
Project type and purpose
• This is a full-stack AI study assistant (“AI-Workshop”) built with React on the frontend and Flask on the backend.
• It lets users type or speak questions, upload PDFs, calls GPT-4 to generate answers, optionally reads them aloud, and can email results.
File structure
• Top-level:
• backend/ – Flask server, exposes REST endpoints (/ask, /send-email), holds config (.env) and dependencies (requirements.txt).
• frontend/ – React single-page app with public/ (index.html) and src/ (React components, CSS).
• Components:
• ChatBox.js handles UI, speech-to-text, PDF parsing (pdfjs-dist), fetch calls to backend, and text-to-speech.
• app.py implements two POST routes: /ask (GPT-4 via OpenAI SDK) and /send-email (SMTP via smtplib).
• Build/config: package.json, requirements.txt, .env, CORS enabled for cross-origin calls.
README for additional insights
• The README details the code flow (index.html → index.js → App.js → ChatBox.js → backend endpoints → GPT-4/SMTP).
• It lists environment variables (OPENAI_API_KEY, SMTP_SENDER, SMTP_PASSWORD).
• It describes how frontend features (speech recognition, PDF upload) augment the ChatBox.