-
Notifications
You must be signed in to change notification settings - Fork 106
Add lego-hunter - Mino Use Case #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
|
||
| # dependencies | ||
| /node_modules | ||
| /.pnp | ||
| .pnp.* | ||
| .yarn/* | ||
| !.yarn/patches | ||
| !.yarn/plugins | ||
| !.yarn/releases | ||
| !.yarn/versions | ||
|
|
||
| # testing | ||
| /coverage | ||
|
|
||
| # next.js | ||
| /.next/ | ||
| /out/ | ||
|
|
||
| # production | ||
| /build | ||
|
|
||
| # misc | ||
| .DS_Store | ||
| *.pem | ||
|
|
||
| # debug | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
| .pnpm-debug.log* | ||
|
|
||
| # env files (can opt-in for committing if needed) | ||
| .env* | ||
|
|
||
| # vercel | ||
| .vercel | ||
|
|
||
| # typescript | ||
| *.tsbuildinfo | ||
| next-env.d.ts |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,135 @@ | ||
| # Lego Restock Hunter - Global Inventory Finder | ||
|
|
||
| ## Demo | ||
|
|
||
|  | ||
|
|
||
| **Live Demo:** https://lego-hunter.vercel.app/ | ||
|
|
||
| The Lego Restock Hunter is a powerful inventory search tool designed to find rare or sold-out Lego sets across 15+ global retailers simultaneously. It uses AI to discover the best retailers for a specific set, deploys parallel Mino browser agents to check stock and pricing, and finishes with a Gemini-powered analysis to recommend the single best deal (balancing price and shipping). | ||
|
|
||
| --- | ||
|
|
||
| --- | ||
|
|
||
| ## Demo | ||
|
|
||
| *[Demo video/screenshot to be added]* | ||
|
Comment on lines
+3
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove duplicate Demo section. There are two "## Demo" sections (lines 3-9 and lines 15-17). The second section at lines 15-17 contains placeholder text and appears redundant. Consider removing lines 13-17 (including the extra separator). Proposed fix 
**Live Demo:** https://lego-hunter.vercel.app/
The Lego Restock Hunter is a powerful inventory search tool designed to find rare or sold-out Lego sets across 15+ global retailers simultaneously. It uses AI to discover the best retailers for a specific set, deploys parallel Mino browser agents to check stock and pricing, and finishes with a Gemini-powered analysis to recommend the single best deal (balancing price and shipping).
---
----
-
-## Demo
-
-*[Demo video/screenshot to be added]*
-
----
-
## How Mino API is Used🧰 Tools🪛 markdownlint-cli2 (0.18.1)7-7: Bare URL used (MD034, no-bare-urls) 15-15: Multiple headings with the same content (MD024, no-duplicate-heading) 🤖 Prompt for AI Agents |
||
|
|
||
| --- | ||
|
|
||
| ## How Mino API is Used | ||
|
|
||
| The Mino API powers browser automation for this use case. See the code snippet below for implementation details. | ||
|
|
||
| ### Code Snippet | ||
|
|
||
| ```bash | ||
| curl -N -X POST "https://mino.ai/v1/automation/run-sse" \ | ||
| -H "X-API-Key: $MINO_API_KEY" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{ | ||
| "url": "https://www.lego.com/en-us/search?q=75192", | ||
| "goal": "Search for Millennium Falcon Lego set. Extract inStock, price, and shipping. Return JSON.", | ||
| "browser_profile": "lite" | ||
| }' | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## How to Run | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| - Node.js 18+ | ||
| - Mino API key (get from [mino.ai](https://mino.ai)) | ||
|
|
||
| ### Setup | ||
|
|
||
| 1. Clone the repository: | ||
| ```bash | ||
| git clone <repo-url> | ||
| cd lego-hunter | ||
| ``` | ||
|
|
||
| 2. Install dependencies: | ||
| ```bash | ||
| npm install | ||
| ``` | ||
|
|
||
| 3. Create `.env.local` file: | ||
| ```bash | ||
| # Add your environment variables here | ||
| MINO_API_KEY=sk-mino-... | ||
| ``` | ||
|
|
||
| 4. Run the development server: | ||
| ```bash | ||
| npm run dev | ||
| ``` | ||
|
|
||
| 5. Open [http://localhost:3000](http://localhost:3000) in your browser | ||
|
|
||
| --- | ||
|
|
||
| ## Architecture Diagram | ||
|
|
||
| ```mermaid | ||
| graph TD | ||
| subgraph Frontend [Next.js Client] | ||
| UI[User Interface - Lego Brick Style] | ||
| State[Retailer Status & Best Deal] | ||
| end | ||
|
|
||
| subgraph Backend [Next.js API Routes] | ||
| UrlGen[/api/generate-urls] | ||
| Search[/api/search-lego] | ||
| end | ||
|
|
||
| subgraph External_APIs [External Services] | ||
| Gemini[Gemini 2.0 - URL Gen & Analysis] | ||
| Mino[Mino API - Browser Automation] | ||
| end | ||
|
|
||
| %% User Interactions | ||
| UI -->|Lego Set Name| UrlGen | ||
| UrlGen -->|AI Discovery| Gemini | ||
|
|
||
| %% Scrape Phase | ||
| UrlGen -->|Return 15 URLs| UI | ||
| UI -->|Trigger Parallel Scrape| Search | ||
|
|
||
| Search -->|Deploy 15 Agents| Mino | ||
| Mino --.->|SSE Streams| UI | ||
| Mino --.->|Product JSON| Search | ||
|
|
||
| %% Final Analysis | ||
| Search -->|Analyze All Deals| Gemini | ||
| Gemini -->|Best Retailer Recommendation| Search | ||
| Search --.->|Final Best Deal Event| UI | ||
| ``` | ||
|
|
||
| ```mermaid | ||
| sequenceDiagram | ||
| participant U as User | ||
| participant S as API (/api/search-lego) | ||
| participant G as Gemini (AI) | ||
| participant M as Mino (15 Parallel Agents) | ||
|
|
||
| U->>G: Discover Retailers for "Millennium Falcon" | ||
| G-->>U: List of 15 Shop URLs | ||
|
|
||
| U->>S: POST Search (Set Name + 15 URLs) | ||
|
|
||
| par Retailer 1 to 15 (Amazon, Walmart, Lego.com, etc.) | ||
| S->>M: Scrape Retailer (Goal: Find Stock/Price) | ||
| M-->>U: SSE: Progress Step | ||
| M-->>S: JSON Result (inStock, price, shipping) | ||
| end | ||
|
|
||
| S->>G: Analyze All Results | ||
| G-->>S: Best Deal Recommendation | ||
| S->>U: Final Trophy Notification (Confetti Trigger) | ||
| ``` | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import { generateRetailerUrls } from '@/lib/gemini-client' | ||
| import type { GenerateUrlsRequest } from '@/types' | ||
|
|
||
| export async function POST(request: Request) { | ||
| try { | ||
| const body: GenerateUrlsRequest = await request.json() | ||
|
|
||
| if (!body.legoSetName) { | ||
| return Response.json({ error: 'legoSetName is required' }, { status: 400 }) | ||
| } | ||
|
|
||
| const retailers = await generateRetailerUrls(body.legoSetName) | ||
|
|
||
| return Response.json({ retailers }) | ||
| } catch (error) { | ||
| console.error('Error generating URLs:', error) | ||
| return Response.json( | ||
| { error: 'Failed to generate retailer URLs' }, | ||
| { status: 500 } | ||
| ) | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Markdown link syntax for the URL.
The bare URL should use proper Markdown link syntax for better compatibility and rendering across different Markdown processors.
Proposed fix
📝 Committable suggestion
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
7-7: Bare URL used
(MD034, no-bare-urls)
🤖 Prompt for AI Agents