Skip to content

feat(api): persist notes, bookmarks, approvals, analytics to PostgreSQL#809

Merged
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
zeemscript:feat/749-persist-to-postgres
Jul 1, 2026
Merged

feat(api): persist notes, bookmarks, approvals, analytics to PostgreSQL#809
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
zeemscript:feat/749-persist-to-postgres

Conversation

@zeemscript

Copy link
Copy Markdown
Contributor

Summary

  • Replace in-memory Map storage with PostgreSQL database persistence for notes, bookmarks, approvals, and video-analytics API routes
  • Add SQL migrations for 4 new tables: notes, bookmarks, content_approvals, video_events
  • Create repository layer with parameterized SQL queries for type-safe database operations

Changes

  • Migrations: 4 SQL files in src/lib/db/migrations/ defining table schemas with indexes
  • Repositories: 4 new repository modules in src/lib/db/repositories/ with CRUD operations
  • Route handlers: Updated to use repositories instead of Maps, removed edge runtime
  • Tests: Integration tests with mocked database queries for all 4 routes

Test plan

  • Run migrations against PostgreSQL database
  • Verify CRUD operations work for notes, bookmarks, approvals, analytics
  • Confirm data persists across server restarts
  • Run npx vitest run src/app/api/notes/__tests__ src/app/api/bookmarks/__tests__ src/app/api/approvals/__tests__ src/app/api/video-analytics/__tests__

Closes #749

@drips-wave

drips-wave Bot commented Jun 28, 2026

Copy link
Copy Markdown

@zeemscript Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@RUKAYAT-CODER

RUKAYAT-CODER commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Great job so far

There’s are just two blockers — the workflow is failing and a merge conflict. Could you take a look and fix it so all checks pass?

Happy to review again once that’s done.
You can pull from the main first before pushing. The workflow should pass

Replaces in-memory Map storage with PostgreSQL database persistence
for the notes, bookmarks, approvals, and video-analytics API routes.

Changes:
- Add SQL migrations for notes, bookmarks, content_approvals, video_events tables
- Create repository layer with parameterized SQL queries
- Update route handlers to use repositories instead of Maps
- Remove edge runtime (using Node.js runtime for pg driver compatibility)
- Add integration tests with mocked database queries

Closes rinafcode#749
@zeemscript zeemscript force-pushed the feat/749-persist-to-postgres branch from 112d4c9 to 8544650 Compare July 1, 2026 16:09
@zeemscript

Copy link
Copy Markdown
Contributor Author

@RUKAYAT-CODER i pushed the fix, Thanks

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Thank you for contributing to the project.

@RUKAYAT-CODER RUKAYAT-CODER merged commit e101f05 into rinafcode:main Jul 1, 2026
6 checks passed
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.

[Tech-debt] Notes, bookmarks, approvals, and video-analytics use in-memory Maps instead of a database

2 participants