Skip to content

Conversation

@vaibhavcoding69
Copy link
Collaborator

This PR is related to the submission of an uptime monitor for the available models. Everything is made in pure HTML/CSS/JS. Details for the PR is added in the README.md in it.

Copilot AI and others added 24 commits October 21, 2025 07:07
Co-authored-by: vaibhavcoding69 <189115938+vaibhavcoding69@users.noreply.github.com>
Co-authored-by: vaibhavcoding69 <189115938+vaibhavcoding69@users.noreply.github.com>
Co-authored-by: vaibhavcoding69 <189115938+vaibhavcoding69@users.noreply.github.com>
Co-authored-by: vaibhavcoding69 <189115938+vaibhavcoding69@users.noreply.github.com>
Co-authored-by: vaibhavcoding69 <189115938+vaibhavcoding69@users.noreply.github.com>
Co-authored-by: vaibhavcoding69 <189115938+vaibhavcoding69@users.noreply.github.com>
…page

Add models page, apply psychedelic design theme site-wide, and center all content
Co-authored-by: vaibhavcoding69 <189115938+vaibhavcoding69@users.noreply.github.com>
Co-authored-by: vaibhavcoding69 <189115938+vaibhavcoding69@users.noreply.github.com>
…s, dark mode, comparison tool

Co-authored-by: vaibhavcoding69 <189115938+vaibhavcoding69@users.noreply.github.com>
…feature

Co-authored-by: vaibhavcoding69 <189115938+vaibhavcoding69@users.noreply.github.com>
Complete AI Models Explorer with Pre-generated Summaries & Tier-Based Filtering
Co-authored-by: vaibhavcoding69 <189115938+vaibhavcoding69@users.noreply.github.com>
Co-authored-by: vaibhavcoding69 <189115938+vaibhavcoding69@users.noreply.github.com>
Co-authored-by: vaibhavcoding69 <189115938+vaibhavcoding69@users.noreply.github.com>
Co-authored-by: vaibhavcoding69 <189115938+vaibhavcoding69@users.noreply.github.com>
Co-authored-by: vaibhavcoding69 <189115938+vaibhavcoding69@users.noreply.github.com>
…js-files

Refactor model-viewer into modular HTML/CSS/JS files, add real-time uptime monitoring, and improve mobile UX
@netlify
Copy link

netlify bot commented Oct 25, 2025

👷 Deploy request for pollinations pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 78559cf

@netlify
Copy link

netlify bot commented Oct 25, 2025

Deploy Preview for pollinations-react-hooks-docs canceled.

Name Link
🔨 Latest commit 78559cf
🔍 Latest deploy log https://app.netlify.com/projects/pollinations-react-hooks-docs/deploys/69036f91f7d68b0008cd2820

@vaibhavcoding69
Copy link
Collaborator Author

#4285

@voodoohop
Copy link
Member

voodoohop commented Oct 26, 2025

@claude can you review concisely?

@vaibhavcoding69 the nitpick from checking the files it that the README is overly wordy. I'm starting to enjoy more concise styles because AI agents write too much if not prompted otherwise

@voodoohop
Copy link
Member

@claude i think you can just clone the original branch of @vaibhavcoding69 to a fresh folder

@pollinations pollinations deleted a comment from claude bot Oct 26, 2025
@claude
Copy link
Contributor

claude bot commented Oct 26, 2025

Claude finished @voodoohop's task —— View job


Code Review Complete

README.md (hacktoberfest-2025/model-viewer/)

  • Issue: 232 lines for a simple tool - way too verbose
  • Fix: Cut to <50 lines. Keep: what it does, how to run, tech stack. Remove: repetitive feature lists, lengthy explanations

Architecture

  • Issue: Duplicates code - standalone viewer + React integration both fetch/render models
  • Fix: Extract shared logic to getModels.js, reuse in both contexts

script.js

  • Issue: 851 lines in single file, mixed concerns (API, UI, stats, charts)
  • Fix: Split into modules: api.js, ui.js, charts.js, stats.js

getModels.js

  • Issue: Hardcoded model lists should be dynamic
  • Fix: Fetch from /models endpoints instead

Integration

  • Positive: Clean React component structure in Models.jsx
  • Issue: Modified auth styles.ts unrelated to PR
  • Fix: Revert unrelated changes

Overall: Good contribution but needs refactoring for maintainability. Focus on DRY principle and conciseness per repo guidelines.

@voodoohop
Copy link
Member

@vaibhavcoding69 is uptime only measured while the tab is open? maybe it needs something in the backend?

@vaibhavcoding69
Copy link
Collaborator Author

@voodoohop the uptime is measured as a whole, meaning it will not reset when the user leaves the page, kind of like uptime monitor and other services

Also do I have to refactor the code? I'll make the readme consise once I reach home

Updated README to enhance clarity and conciseness, removing redundant sections and improving feature descriptions.
@vaibhavcoding69
Copy link
Collaborator Author

@voodoohop just made the readme conscise

@voodoohop
Copy link
Member

@vaibhavcoding69 - i think it needs a backend to be useful. ideally using cloudflare workers but can also use another host if you prefer. i dont think we should depend on the frontend having a page open to monitor uptime. also try not to hard-code models but fetch the list from the models endpoint

@vaibhavcoding69
Copy link
Collaborator Author

@voodoohop yeah i think that's better than caching for the user, can I put some of the content outside the hacktoberfest folder in order to properly maintain it?

@voodoohop
Copy link
Member

@vaibhavcoding69 whatever makes sense. although i think you can also create backend code in the hacktoberfest folder

Copilot AI and others added 2 commits October 28, 2025 20:50
* Initial plan

* Add backend-based uptime monitoring system

Co-authored-by: vaibhavcoding69 <189115938+vaibhavcoding69@users.noreply.github.com>

* Add documentation for backend-based uptime monitoring

Co-authored-by: vaibhavcoding69 <189115938+vaibhavcoding69@users.noreply.github.com>

* Fix prototype pollution vulnerabilities in uptime monitor

Co-authored-by: vaibhavcoding69 <189115938+vaibhavcoding69@users.noreply.github.com>

* Refactor uptime monitoring to use independent backend service

- Created standalone uptime-backend.js that runs independently (no frontend required)
- Backend fetches models dynamically from Pollinations APIs (not hard-coded)
- Frontend simplified to only display uptime data from backend
- Backend checks all models every 5 minutes automatically
- All changes kept in model-viewer folder
- Removed excessive documentation
- Can be deployed to Cloudflare Workers, Railway, Render, etc.

Co-authored-by: vaibhavcoding69 <189115938+vaibhavcoding69@users.noreply.github.com>

* Add Cloudflare Workers implementation and update screenshots

- Created worker.js: Cloudflare Workers-compatible backend with scheduled cron
- Uses Cloudflare KV for data persistence (replaces file storage)
- Runs every 5 minutes via cron trigger (no frontend dependency)
- Added wrangler.toml configuration for deployment
- Updated README with Cloudflare Workers deployment instructions
- Updated package.json with wrangler scripts
- Updated screenshots showing uptime monitoring UI (light & dark mode)

Co-authored-by: vaibhavcoding69 <189115938+vaibhavcoding69@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: vaibhavcoding69 <189115938+vaibhavcoding69@users.noreply.github.com>
@vaibhavcoding69
Copy link
Collaborator Author

@voodoohop i have done the changes needed, please review them

@CloudCompile CloudCompile self-requested a review October 28, 2025 16:21
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe update the current fallback model list?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and update it on this too?

Copy link
Collaborator

@CloudCompile CloudCompile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should add the current model fallback list

@vaibhavcoding69
Copy link
Collaborator Author

I think you should add the current model fallback list

Alright I'll do this in the morning 🙏🏻

@voodoohop
Copy link
Member

@vaibhavcoding69 will check

@vaibhavcoding69
Copy link
Collaborator Author

@voodoohop any updates?

@voodoohop
Copy link
Member

@vaibhavcoding69

Review from Claude. Looking at the backend code, I think it's pretty good but has some issues:

What's Good

1. Clean Structure

  • Clear separation: scheduled checks vs API endpoints
  • Good CORS handling
  • Proper validation (prototype pollution prevention)

2. Simple Data Model
@/Users/thomash/Documents/GitHub/pollinations/hacktoberfest-2025/model-viewer/worker.js#74:96
Straightforward history tracking with automatic cleanup (288 entries = 24 hours)

3. Dynamic Model Discovery
@/Users/thomash/Documents/GitHub/pollinations/hacktoberfest-2025/model-viewer/worker.js#28:44
Fetches models from live APIs instead of hardcoding - smart!

⚠️ Issues

1. Uptime Check Logic is Flawed
@/Users/thomash/Documents/GitHub/pollinations/hacktoberfest-2025/model-viewer/worker.js#46:72

For text models: Just checks if model exists in API response - doesn't actually test if it works
For image models: Uses HEAD request - doesn't verify the model can actually generate images

This will show models as "up" even if they're broken!

2. Sequential Checking = Slow
@/Users/thomash/Documents/GitHub/pollinations/hacktoberfest-2025/model-viewer/worker.js#111:119
Checks models one-by-one with await in loops. With 17+ models, this could take 30+ seconds and might hit worker timeout limits.

3. No Error Handling for KV Operations
KV writes could fail silently - no try/catch around storage operations.

🔧 How to Make it Better

Make checks parallel:

await Promise.all([
    ...textModels.map(m => checkAndRecordModel(env, m.name, 'text')),
    ...imageModels.map(m => checkAndRecordModel(env, m.name, 'image'))
]);

Actually test the models:

  • Text: Send a simple test message and verify response
  • Image: Actually generate a tiny 64x64 image and check if it succeeds

Add error handling:
Wrap KV operations in try/catch

🎯 Verdict

It's simple and readable but not quite "to the point" - the uptime checks don't actually verify models work, just that endpoints respond. For a real uptime monitor, you'd want to test actual functionality. But for a Hacktoberfest demo, it's a decent start! 🌸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To Do

Development

Successfully merging this pull request may close these issues.

3 participants