Skip to content

[Feature] Add portfolio cache management, validation schemas, and views tracking#113

Merged
Gautam25Raj merged 3 commits into
masterfrom
feat/portfolio-cache-validation-and-views-tracking
May 31, 2026
Merged

[Feature] Add portfolio cache management, validation schemas, and views tracking#113
Gautam25Raj merged 3 commits into
masterfrom
feat/portfolio-cache-validation-and-views-tracking

Conversation

@Gautam25Raj
Copy link
Copy Markdown
Collaborator

Summary

This PR introduces portfolio cache management utilities, expands validation coverage across billing and portfolio workflows, and adds scalable views tracking infrastructure for portfolios and share links.

The update also improves database performance configuration and strengthens platform-level data integrity.

Features

Portfolio Cache Management

  • Added invalidatePublicPortfolioCaches utility
  • Added revalidatePublicPortfolios utility
  • Improved public portfolio cache invalidation workflows
  • Enhanced cache consistency for published portfolio content

Portfolio Validation

  • Added portfolio validation schemas for:
    • Portfolio content
    • Portfolio drafts
  • Improved data integrity and validation coverage
  • Enhanced validation consistency across portfolio workflows

Billing Validation

  • Added Zod validation schemas for:
    • Checkout requests
    • Billing webhook events
  • Improved validation reliability for billing-related operations

Views Tracking System

  • Implemented views tracking for:
    • Public portfolios
    • Share links
  • Added Redis-backed buffering and flushing workflows
  • Improved scalability and tracking efficiency for analytics events

Improvements

Database Performance

  • Enhanced Prisma database connection configuration
  • Improved connection handling and performance characteristics
  • Optimized database interaction reliability

Slug Validation

  • Updated slug validation rules
  • Added additional reserved usernames
  • Improved protection against routing and namespace conflicts

Testing

  • Added test coverage for:
    • API key validation
    • Flexible authentication middleware
    • Billing webhook processing
    • Portfolio validation workflows
  • Improved reliability and maintainability across core systems

Notes

  • No breaking changes
  • Focused on validation reliability, analytics infrastructure, and portfolio platform performance

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📝 Documentation update
  • 🧪 Tests (adding or updating tests)

Checklist

  • I have read the CONTRIBUTING.md document.
  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • Any dependent changes have been merged and published in downstream modules.

- Implemented `invalidatePublicPortfolioCaches` and `revalidatePublicPortfolios` functions for managing portfolio cache.
- Enhanced Prisma database connection settings for improved performance.
- Updated slug validation to include additional reserved usernames.
- Created billing-related validation schemas using Zod for checkout and webhook events.
- Developed portfolio validation schemas for content and drafts, ensuring data integrity.
- Added tests for API key validation, flexible authentication middleware, billing webhook processing, and portfolio validation.
- Implemented views tracking for portfolios and share links, including buffering and flushing logic with Redis.
@Gautam25Raj Gautam25Raj added enhancement New feature or request backend server-side logic api API-related changes or issues performance Performance improvements security Security concerns or fixes labels May 31, 2026
Gautam25Raj and others added 2 commits May 31, 2026 18:56
…nagement

- Introduced new tables: Subscription, PortfolioPublication, BillingWebhookEvent, PortfolioAsset, and PortfolioViewDaily.
- Added columns for cloud sync and user management in existing tables.
- Implemented unique and regular indexes to optimize query performance across various tables.
- Updated the ApiKey model to include user ownership and enforce relational integrity.
- Added slug functionality for share links and documents to improve user experience.
- Enhanced the schema with new enums for subscription and portfolio statuses.
- Implemented migrations to ensure database structure aligns with the updated Prisma schema.
@Gautam25Raj Gautam25Raj merged commit ee621e9 into master May 31, 2026
1 check passed
@Gautam25Raj Gautam25Raj deleted the feat/portfolio-cache-validation-and-views-tracking branch June 2, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api API-related changes or issues backend server-side logic enhancement New feature or request performance Performance improvements security Security concerns or fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant