Skip to content

feat: Add grant source management with CRUD operations (Phase 2.2)#23

Open
Datakult0r wants to merge 9 commits into
devin/1768448452-session9-pages-datafrom
devin/1768934970-grant-sources
Open

feat: Add grant source management with CRUD operations (Phase 2.2)#23
Datakult0r wants to merge 9 commits into
devin/1768448452-session9-pages-datafrom
devin/1768934970-grant-sources

Conversation

@Datakult0r
Copy link
Copy Markdown
Owner

Summary

This PR implements Phase 2.2 of the PRD - Grant Source Management. It adds full CRUD functionality for managing grant discovery sources, allowing users to configure which sources to scrape and at what frequency.

Backend changes:

  • Added PATCH endpoint to update source status, scrape_frequency, name, and URL
  • Added DELETE endpoint to remove sources
  • Added GET /stats endpoint returning total/active/inactive counts and last crawled date
  • Enhanced POST to support scrape_frequency parameter
  • Sources now ordered by created_at descending

Database schema:

  • Added scrape_frequency column (hourly/daily/weekly/monthly, defaults to 'daily')
  • Added created_at timestamp column
  • Includes ALTER TABLE statements for existing databases

Frontend changes:

  • Complete rewrite of AdminGrantSources component using TypeScript and Svelte 5 runes
  • Stats cards showing total, active, inactive sources and last crawled date
  • Enable/disable toggle for each source
  • Scrape frequency dropdown (hourly/daily/weekly/monthly)
  • Delete source with confirmation dialog
  • Loading states and visual feedback during operations

Review & Testing Checklist for Human

  • Test full CRUD flow: Navigate to /admin/sources, add a new source, toggle its status, change frequency, then delete it
  • Verify database migration: If you have an existing database, run the schema.sql and confirm the ALTER TABLE statements don't error
  • Check stats accuracy: Add/remove sources and verify the stats cards update correctly
  • Test error handling: Stop the backend and verify the frontend shows appropriate error states (currently only logs to console)
  • Mobile responsiveness: The stats grid uses grid-cols-4 which may not work well on smaller screens

Recommended test plan:

  1. Start backend and frontend locally
  2. Navigate to /admin/sources
  3. Add a test source (e.g., https://grants.gov/search)
  4. Toggle the source active/inactive and verify the stats update
  5. Change the scrape frequency and refresh to confirm persistence
  6. Delete the source and verify it's removed

Notes

Link to Devin run: https://app.devin.ai/sessions/9573820f0f6d41dab1cff8a61c26c981
Requested by: @Datakult0r

- Added Dockerfile for containerized deployment
- Added fly.toml with Fly.io configuration
- Added .dockerignore to exclude unnecessary files
- Added comprehensive DEPLOYMENT.md guide
- Enhanced backend admin sources API with PATCH, DELETE, and stats endpoints
- Added scrape_frequency configuration (hourly/daily/weekly/monthly)
- Enhanced AdminGrantSources component with:
  - Stats cards showing total/active/inactive sources
  - Enable/disable toggle for each source
  - Scrape frequency dropdown
  - Delete source functionality
  - Loading states and visual feedback
- Updated database schema with scrape_frequency column
- Improved admin sources page styling
@devin-ai-integration
Copy link
Copy Markdown
Contributor

Original prompt from Datakult
https://github.com/Datakult0r/ai-grant-crawler-a2a-pro
index this

@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
ai-grant-crawler-a2a-pro Error Error Jan 25, 2026 8:58pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 20, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

…s-data

feat: Session 9 - Remaining Pages Data Integration
…vements

docs: Add PRD, deployment config, and fix README merge conflict
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant