How dezign365/grc-copilot works
GRC Copilot is a SaaS workspace for creating and reviewing IT governance, risk, and compliance materials, with framework guidance, AI assistance, and subscription management. The principal workflow is to provide requirements and framework context, generate or stream a policy/document, and review uploaded material for compliance gaps; a separate questionnaire flow can analyze spreadsheet requirements using existing policies as context. The graph includes major capabilities visible in the tree, but UI-to-API wiring and unsampled modules are not asserted where source evidence was unavailable.
Main entry points: generate/route.ts Document generation · generate-stream/route.ts Stream generation · chat/route.ts GRC chat · usage.ts Usage limits
Components 27
Workspace
- Dashboard
src/app/dashboard/page.tsx - Compliance analyzer
src/app/dashboard/ComplianceAnalyzer.tsx - Chat workspace
src/app/chat/page.tsx - Framework catalog
src/app/frameworks/page.tsx - Billing dashboard
src/components/BillingDashboard.tsx - Admin console
src/app/admin/page.tsx
GRC Intelligence
- Document generation
src/app/api/generate/route.ts - Stream generation
src/app/api/generate-stream/route.ts - Document analysis
src/app/api/analyze/route.ts - Spreadsheet questionnaire
src/app/api/analyze/questionnaire/route.ts - Question planning
src/app/api/brain/route.ts - GRC chat
src/app/api/chat/route.ts - Framework and control data
src/lib/excellogFramework.ts - GRC prompts
src/lib/grc-system-prompt.ts - LLM fallback
src/lib/fallback-llm.ts
Identity and Usage
- Auth callback
src/app/auth/callback/route.ts - Usage limits
src/lib/usage.ts
Plans and Billing
- Subscription checkout
src/app/api/checkout/route.ts - Billing portal
src/app/api/billing/route.ts - Stripe webhook
src/app/api/webhook/stripe/route.ts - Package management
src/app/api/admin/packages/route.ts
External Services
- Supabase auth and data
- Google Gemini
- Other AI providers
- Stripe
- Email service
src/lib/email.ts
Other components
- GRC user
Connections 40
- GRC user → Dashboard: uses
- GRC user → Compliance analyzer: submits document
- GRC user → Chat workspace: asks questions
- GRC user → Framework catalog: browses
- GRC user → Billing dashboard: manages plan
- GRC user → Admin console: administers
- Document analysis → Supabase auth and data: authenticates and reads profile
- Document analysis → Usage limits: checks and records usage
- Document analysis → Google Gemini: validates and analyzes
- Spreadsheet questionnaire → Supabase auth and data: authenticates and reads policies
- Spreadsheet questionnaire → Google Gemini: answers requirements
- Spreadsheet questionnaire → Other AI providers: fallback answers
- Document generation → Supabase auth and data: authenticates and reads context
- Document generation → Usage limits: checks and records usage
- Document generation → GRC prompts: uses prompt
- Document generation → Google Gemini: generates structured document
- Document generation → Other AI providers: fallback generation
- Stream generation → Supabase auth and data: authenticates and reads profile
- Stream generation → Usage limits: checks and records usage
- Stream generation → GRC prompts: uses prompt
- Stream generation → Google Gemini: streams document
- GRC chat → Supabase auth and data: authenticates and reads profile
- GRC chat → Usage limits: checks and records usage
- GRC chat → Google Gemini: streams response
- GRC chat → Other AI providers: fallback response
- Question planning → Supabase auth and data: authenticates
- Question planning → LLM fallback: requests questions
- LLM fallback → Google Gemini: tries provider
- LLM fallback → Other AI providers: tries fallback
- Auth callback → Supabase auth and data: verifies session
- Auth callback → Email service: sends welcome email
- Subscription checkout → Supabase auth and data: authenticates and reads package
- Subscription checkout → Stripe: creates checkout session
- Billing portal → Supabase auth and data: reads customer profile
- Billing portal → Stripe: creates portal session
- Stripe webhook → Stripe: retrieves subscription and invoice
- Stripe webhook → Supabase auth and data: updates billing records
- Stripe webhook → Email service: sends payment email
- Package management → Supabase auth and data: checks admin and stores packages
- Package management → Stripe: syncs products and prices