# amruta-katkar/projectidea architecture

> Architecture diagram of the GitHub repository amruta-katkar/projectidea, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/amruta-katkar/projectidea
- Repository: https://github.com/amruta-katkar/projectidea

## Overview

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`](https://github.com/amruta-katkar/projectidea/blob/main/main.py) (HTTP Routes), [`static/script.js`](https://github.com/amruta-katkar/projectidea/blob/main/static/script.js) (Client Logic), [`idea_generator.py`](https://github.com/amruta-katkar/projectidea/blob/main/idea_generator.py) (Idea Engine), [`templates/index.html`](https://github.com/amruta-katkar/projectidea/blob/main/templates/index.html) (Page Shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Browser UI"]
  node_browser(("Browser App<br/>client"))
  node_index_html["Page Shell<br/>html template<br/>[index.html]"]
  node_script_js["Client Logic<br/>JavaScript UI<br/>[script.js]"]
  node_style_css["Styles<br/>CSS<br/>[style.css]"]
end

subgraph group_backend["FastAPI Backend"]
  node_main_py["App Server<br/>FastAPI app<br/>[main.py]"]
  node_routes["HTTP Routes<br/>request handling<br/>[main.py]"]
  node_idea_generator["Idea Engine<br/>domain logic<br/>[idea_generator.py]"]
end

subgraph group_external["External API"]
  node_paper_api[("Paper API<br/>external data source")]
end

node_browser -->|"loads"| node_index_html
node_browser -->|"runs"| node_script_js
node_browser -->|"styles"| node_style_css
node_script_js -->|"search/save UI"| node_routes
node_main_py -->|"defines"| node_routes
node_routes -->|"generates ideas"| node_idea_generator
node_routes -->|"fetches papers"| node_paper_api
node_idea_generator -.->|"uses metadata"| node_paper_api
node_routes -->|"returns results"| node_browser
node_script_js -->|"renders"| node_browser

click node_index_html "https://github.com/amruta-katkar/projectidea/blob/main/templates/index.html"
click node_script_js "https://github.com/amruta-katkar/projectidea/blob/main/static/script.js"
click node_style_css "https://github.com/amruta-katkar/projectidea/blob/main/static/style.css"
click node_main_py "https://github.com/amruta-katkar/projectidea/blob/main/main.py"
click node_routes "https://github.com/amruta-katkar/projectidea/blob/main/main.py"
click node_idea_generator "https://github.com/amruta-katkar/projectidea/blob/main/idea_generator.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_browser,node_index_html,node_script_js,node_style_css toneBlue
class node_main_py,node_routes,node_idea_generator toneAmber
class node_paper_api toneMint
```

## Components

### Browser UI

Single-page browser experience with template, script, and styling.

- **Browser App**: client · User-facing single-page experience for search, browsing, pagination, and saves.
- [Page Shell](https://github.com/amruta-katkar/projectidea/blob/main/templates/index.html): html template · Main HTML entry point for the browser UI. · `templates/index.html`
- [Client Logic](https://github.com/amruta-katkar/projectidea/blob/main/static/script.js): JavaScript UI · Handles search submission, rendering, pagination, and saved-idea interactions. · `static/script.js`
- [Styles](https://github.com/amruta-katkar/projectidea/blob/main/static/style.css): CSS · 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](https://github.com/amruta-katkar/projectidea/blob/main/main.py): FastAPI app · Application entry point and HTTP route host. · `main.py`
- [HTTP Routes](https://github.com/amruta-katkar/projectidea/blob/main/main.py): request handling · Coordinates browser requests, search flow, and responses. · `main.py`
- [Idea Engine](https://github.com/amruta-katkar/projectidea/blob/main/idea_generator.py): domain logic · Transforms research-paper data into suggested project ideas. · `idea_generator.py`

### External API

Outside research-paper source consumed by the backend.

- **Paper API**: external data source · Outside research-paper source used to fetch search results and metadata.

## Connections

- 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.
