How amruta-katkar/projectidea works
1. Overall shape
- This is a small FastAPI-backed, browser-based application.
- The backend serves the UI and exposes search/idea-generation endpoints.
- The frontend is a single-page experience built with plain HTML/CSS/JavaScript.
2. Primary entry points
- main.py is the application entry point and likely defines the FastAPI app plus HTTP routes.
- idea_generator.py is the main business-logic module for turning research-paper data into project ideas.
- templates/index.html is the HTML shell rendered or served to the browser.
- static/script.js and static/style.css implement client-side behavior and presentation.
3. User interaction flow
- The user enters a keyword in the browser.
- The frontend sends that search term to the backend.
- The backend fetches research-paper data, generates project ideas, and returns results.
- The browser renders titles, abstracts, and suggested ideas, then lets the user paginate and save items.
4. Backend responsibility boundary
- The backend owns the search and idea-generation workflow.
- It likely acts as a coordinator between incoming UI requests and the paper/idea generation logic in idea_generator.py.
- Since no database layer appears in the tree, the backend is probably stateless aside from request handling.
5. Idea generation subsystem
- idea_generator.py is the domain-specific subsystem.
- Its role is to transform research-paper content into “project ideas” shown in the UI.
- Based on the README, this module likely encapsulates the logic that produces the idea text from paper metadata or abstracts.
6. Frontend subsystem
- static/script.js handles client-side search submission, rendering results, pagination, and saved-idea interactions.
- static/style.css controls layout and visual treatment.
- templates/index.html provides the page structure that the JavaScript enhances.
7. Pagination and saved ideas
- Pagination is part of the UI layer, with 5 ideas per page and Next/Previous controls.
- “Save ideas” and a separate tab strongly suggest client-side state management, likely in JavaScript.
- Because there is no persistence service or database in the repository tree, saved items are probably kept in browser memory or browser storage rather than in a backend datastore.
8. External dependency boundary
- The README states that research papers are “fetched via backend API,” implying an external paper source or API outside this repo.
- That external data source is an important architectural dependency: the app does not appear to own the paper corpus itself.
- The backend sits between the browser and that external research-paper service.
9. Runtime and framework
- The backend runs on Python with FastAPI, typically served via Uvicorn as shown in the README.
- This means the system is asynchronous HTTP API + server-rendered/static frontend, not a heavy application server with separate microservices.
10. Static asset delivery
- The static/ directory contains browser assets that are part of the app’s delivery boundary.
- The UI depends on JavaScript for dynamic behavior, so the page is not just static HTML.
- The backend likely serves these assets alongside API responses.
11. Repository-level simplicity
- There are no directories for models, persistence, jobs, queues, or authentication.
- That suggests a compact monolithic design: one Python backend, one UI page, one main logic module, and no separate data store.
- For an architecture diagram, this is best drawn as a single backend service with a frontend client and one external research-paper API dependency.
12. What to emphasize in a diagram
- Draw three main zones: browser UI, FastAPI backend, and external paper API.
- Within the backend, separate HTTP routing (main.py) from idea-generation logic (idea_generator.py).
- Within the browser, separate the page template from JavaScript-driven interactions and CSS styling.
Main entry points: main.py HTTP Routes · script.js Client Logic · idea_generator.py Idea Engine · index.html Page Shell
Components 8
Browser UI
Single-page browser experience with template, script, and styling.
- Browser App · User-facing single-page experience for search, browsing, pagination, and saves.
- Page Shell · Main HTML entry point for the browser UI.
templates/index.html - Client Logic · Handles search submission, rendering, pagination, and saved-idea interactions.
static/script.js - Styles · Controls layout and visual presentation for the page.
static/style.css
FastAPI Backend
Python service that serves the UI and handles search and idea generation.
- App Server · Application entry point and HTTP route host.
main.py - HTTP Routes · Coordinates browser requests, search flow, and responses.
main.py - Idea Engine · Transforms research-paper data into suggested project ideas.
idea_generator.py
External API
Outside research-paper source consumed by the backend.
- Paper API · Outside research-paper source used to fetch search results and metadata.
Connections 10
- Browser App → Page Shell: loads · The browser receives the page shell.
- Browser App → Client Logic: runs · Client-side JavaScript drives interaction and rendering.
- Browser App → Styles: styles · CSS shapes the UI presentation.
- Client Logic → HTTP Routes: search/save UI · Sends search terms and updates the results view.
- App Server → HTTP Routes: defines · The entry point hosts the HTTP routes.
- HTTP Routes → Idea Engine: generates ideas · Backend passes paper content into the idea-generation subsystem.
- HTTP Routes → Paper API: fetches papers · Backend retrieves research-paper data from an external source.
- Idea Engine → Paper API: uses metadata · Idea generation depends on paper abstracts or related metadata.
- HTTP Routes → Browser App: returns results · Search and idea results are sent back to the UI.
- Client Logic → Browser App: renders · JavaScript manages result display, paging, and saved items.