How tanishachandani/insight works
• Frontend: Represented by the “frontend” directory, it is built with Next.js and contains pages, components (Header, Footer, FlashCards, Quiz, Summary, etc.), styling files (Tailwind CSS, globals.css), and build configurations. This component is responsible for capturing user inputs, handling file uploads, and presenting the generated resources.
• Backend: Located in the “backend” folder, it is most likely a Python/Flask application (given the “backend.py” and related generator scripts for flashcards, quizzes, summaries). It coordinates the processing of input documents, calls AI modules (in files like “speech_to_text.py”, “gemini_call.py”), and handles file conversions.
• AI Modules: Notice the separate “AI” folder and the AI-specific Python scripts. These likely encapsulate certain specialized AI functionalities (e.g., advanced speech-to-text conversion) and are used by the backend.
• Database/Storage: Within the “backend/database” folder, many JSON files are stored. These files likely serve as storage for generated study material, examples, or configuration data.
• External Services: Integration with Google Cloud services (Speech-to-Text, Cloud Storage, etc.) is essential. This external dependency should be depicted as a separate component, showing that the backend interacts with these services (using credentials from a service account key).
Relationships and Data Flow
• Backend Processing: Within the backend block, include subcomponents representing:
• Resource Generators: Flashcard, Quiz, and Summary generator modules.
• Speech-to-Text Module: This might call out to both an internal script and the external Google Cloud Speech-to-Text API.
• File Processing: Components that handle document parsing and conversion (including the “gemini_call.py” utility).
• Database: Show the connection from the backend to the JSON-based database files.
• Data Storage and Export: Illustrate that the backend stores generated content (like learning resources) in the database folder and can export these as .docx files (referencing the examples and docx files scattered in the backend).
Architectural Patterns and Key Technologies
• Clearly divide the frontend and backend with a separation boundary, emphasizing the typical full-stack split.
• Usage of Node.js and npm for frontend dependency management and Python (with a virtual environment) for backend dependencies.
• Additional configuration/deployment elements like environment variable management (.env files), Google Cloud SDK setup, and local development modes.
• That the backend makes use of Flask (or a similar lightweight framework) to handle API requests and that the frontend utilizes the capabilities of Next.js for server-side rendering (as indicated by the .next directory structure).