/home/techb158/cosmic-risk.abdallabala.com/docs
NameSizeModeActions
00-design-study.md36780644editdlrm
01-uml-class-diagram.puml118690644editdlrm
02-use-case-diagram.puml37630644editdlrm
03-sequence-diagrams.puml97320644editdlrm
04-database-entity-model.mmd70510644editdlrm
05-database-schema.sql133720644editdlrm
06-diagram-preview.html50210644editdlrm
07-design-checklist.md32560644editdlrm
08-step-2-storage-layer.md53250644editdlrm
09-step-3-risk-crud-ui.md33800644editdlrm
10-step-4-mitigation-workflow.md39960644editdlrm
11-step-5-deployment-gate-workflow.md22920644editdlrm
12-step-6-multi-pm-integration.md37700644editdlrm
13-step-6-1-microsoft-planner-integration.md23350644editdlrm
14-step-7-reporting-export.md41580644editdlrm
15-step-7-1-oauth-live-connectors.md45450644editdlrm
16-step-8-user-roles-access-control.md32970644editdlrm
17-step-9-production-deployment-security.md42280644editdlrm
18-step-10-final-academic-submission.md31990644editdlrm
19-final-report-draft.md68140644editdlrm
20-instructor-submission-checklist.md36390644editdlrm
21-demo-script.md39480644editdlrm
22-traceability-matrix.md48470644editdlrm
23-testing-evidence.md29610644editdlrm
24-evaluation-rubric-mapping.md29100644editdlrm
25-final-deployment-runbook.md32140644editdlrm
26-known-limitations-and-future-work.md26320644editdlrm
27-final-qa-checklist.md28930644editdlrm
28-demo-rehearsal-script.md36180644editdlrm
29-submission-freeze-report.md27690644editdlrm
30-final-known-issues.md18760644editdlrm
31-saas-rebuild-implementation.md25730644editdlrm
application-documentation.md275150644editdlrm
conversation-log.md185030644editdlrm
dashboard-spec.md36910644editdlrm
database-guide.md378260644editdlrm
development-summary.md70700644editdlrm
github-architecture.svg62880644editdlrm
integration-pull-push-plan.md73840644editdlrm
Edit: /home/techb158/cosmic-risk.abdallabala.com/docs/31-saas-rebuild-implementation.md (2573B)
# COSMIC AI-Risk SaaS Rebuild Implementation Date: 2026-07-05 ## What was added The commercial SaaS rebuild now starts in: ```text saas-app/ ``` The frozen academic prototype remains unchanged and acts as the reference implementation. ## SaaS foundation The new app includes: - Next.js application scaffold. - PostgreSQL and Prisma schema. - Docker Compose deployment for VPS. - Organization and workspace tenancy. - User, role, membership, and invitation models. - Subscription and entitlement models for manual pilot billing and Stripe. - COSMIC risk scoring and deployment gate domain services. - Tenant-aware service layer for projects, risks, mitigations, gates, reports, and audit. - API route contracts for auth, organizations, workspaces, projects, risks, mitigations, gates, reports, integrations, and billing. - Seed importer from the current `data/database.json`. - Domain and tenant-security tests that run without external services. ## Current implementation boundary This is a SaaS foundation, not a finished production launch. Completed now: - Multi-tenant data model. - PostgreSQL migration target. - Domain logic port. - First API route layer. - First dashboard shell. - Manual billing and Stripe boundaries. - Invite-only auth contracts. - Docker/VPS deployment shape. Still required before commercial production: - Install dependencies and generate a lockfile. - Run Prisma migrations against PostgreSQL. - Complete session cookie auth and password/magic-link login. - Complete Stripe checkout, portal, and signed webhook implementation. - Add full CRUD UI screens beyond the first dashboard shell. - Add SAML/OIDC SSO. - Add production monitoring, logging, and backup automation. - Add legal pages: terms, privacy, security, data processing agreement. ## Recommended next command sequence ```bash cd saas-app cp .env.example .env npm install docker compose up -d postgres npm run db:push npm run db:seed npm test npm run dev ``` Open: ```text http://localhost:8090 ``` ## Local fallback mode If npm dependency installation times out, run the dependency-free local harness: ```bash cd saas-app npm run test:local npm run local:fallback ``` Open: ```text http://localhost:8090 ``` This mode does not replace the Next.js and PostgreSQL SaaS target. It exists so the SaaS domain workflows, seeded dashboard, core API routes, reports, gate evaluation, risk CRUD, mitigation management, integrations, billing/admin placeholders, users, invitations, and audit trail can be tested locally while npm/registry access is unavailable.