Skip to content

feat: Cookie Consent with Microservices Architecture (#462)#582

Merged
RUKAYAT-CODER merged 3 commits into
rinafcode:mainfrom
bigvictoh:feat/462-cookie-consent-microservices
May 29, 2026
Merged

feat: Cookie Consent with Microservices Architecture (#462)#582
RUKAYAT-CODER merged 3 commits into
rinafcode:mainfrom
bigvictoh:feat/462-cookie-consent-microservices

Conversation

@bigvictoh
Copy link
Copy Markdown

Summary

Implements Cookie Consent following a Microservices Architecture pattern, separating concerns into independent layers.

Changes

Domain service src/lib/consent/

  • types.ts — Zod-validated schema for consent state and granular cookie categories (necessary, analytics, functional, marketing)
  • store.ts — Zustand store with localStorage persistence, 1-year TTL, and a lightweight cookie-consent cookie for SSR/middleware reads
  • api.ts — typed client for the consent API endpoint
  • constants.ts — storage keys, cookie name, TTL

API microservice src/app/api/v1/consent/route.ts

  • Edge runtime GET / PUT / DELETE endpoint with rate limiting and Zod validation

UI layer src/components/consent/

  • CookieConsentBanner — fixed bottom bar, hidden once a valid decision exists
  • CookiePreferencesModal — granular per-category toggles using the existing accessible Modal component

Wiring

  • CookieConsentBanner added to RootProviders as a lazy dynamic import (ssr: false) to avoid blocking initial render

Acceptance Criteria

  • Cookie Consent properly implements Microservices Architecture
  • No regression in existing functionality
  • Code follows project coding standards
  • Performance impact is minimal (lazy loaded, non-blocking)
  • Accessibility guidelines followed (focus trap, ARIA roles, keyboard navigation)
  • Security considerations addressed (SameSite cookie, rate limiting, Zod validation)

Closes #462

Nonso-Eze added 3 commits May 29, 2026 16:17
…code#462)

- Add consent domain service (src/lib/consent/): types, Zustand store,
  API client, and constants with 1-year TTL and localStorage persistence
- Add dedicated consent API endpoint (src/app/api/v1/consent/route.ts):
  edge-runtime GET/PUT/DELETE with rate limiting and Zod validation
- Add CookieConsentBanner: fixed bottom bar with accept-all, reject, and
  manage-preferences actions; hidden once a valid decision exists
- Add CookiePreferencesModal: granular per-category toggles (necessary,
  analytics, functional, marketing) using the existing Modal component
- Wire CookieConsentBanner into RootProviders as a lazy dynamic import
  (ssr: false) to avoid blocking initial render
…code#462)

- Add consent domain service (src/lib/consent/): types, Zustand store,
  API client, and constants with 1-year TTL and localStorage persistence
- Add dedicated consent API endpoint (src/app/api/v1/consent/route.ts):
  edge-runtime GET/PUT/DELETE with rate limiting and Zod validation
- Add CookieConsentBanner: fixed bottom bar with accept-all, reject, and
  manage-preferences actions; hidden once a valid decision exists
- Add CookiePreferencesModal: granular per-category toggles (necessary,
  analytics, functional, marketing) using the existing Modal component
- Wire CookieConsentBanner into RootProviders as a lazy dynamic import
  (ssr: false) to avoid blocking initial render
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@bigvictoh 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 merged commit 391023f into rinafcode:main May 29, 2026
3 of 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.

performance Cookie Consent : Microservices Architecture

3 participants