SRA is an enterprise-grade, AI-orchestrated ecosystem designed to formalize the software requirements engineering lifecycle. By combining Large Language Model (LLM) reasoning with rigorous architectural standards, SRA transforms fragmented project visions into high-fidelity, production-ready technical specifications (IEEE-830).
| Resource | URL | Description |
|---|---|---|
| Live Application | sra-xi.vercel.app | Production frontend deployment |
| Architecture Guide | ARCHITECTURE.md | System architecture & design |
| Operations Manual | OPERATIONS.md | Deployment, backup & DR procedures |
| Contributing | CONTRIBUTING.md | Development setup & guidelines |
Industry research, including PMI and other studies, indicates that a significant portion of project failures, often estimated between 30% and 50%, can be traced back to poor requirements engineering, including unclear documentation, semantic ambiguity, and stakeholder misalignment. SRA mitigates this risk by providing an automated, multi-layered validation and synthesis engine.
- Zero-Ambiguity Intake: Standardizes raw stakeholder descriptions into structured architectural models.
- AI-Driven Governance: Real-time logic checking to identify contradictions, missing logic, and technical gaps.
- High-Fidelity Visuals: Automated generation of multi-level Data Flow Diagrams (DFD) and system-level Mermaid diagrams.
- Semantic Intelligence: Leverages vector-based knowledge retrieval (RAG) and Graph-Hybrid Search to ensure consistency across complex project portfolios.
- Intelligent Requirement Recycling: Proactively suggests high-quality requirement fragments from past "Gold Standard" projects to accelerate new SRS drafting.
- Objective Quality Auditing: Real-time scoring against the 6Cs of Requirements Quality (Clarity, Completeness, etc.).
- Industry Benchmarking: Integrated RAG evaluation for Faithfulness and Answer Relevancy.
SRA operates on a proprietary 5-layer pipeline that ensures every requirement is processed through a rigid quality-control sequence.
graph TD
subgraph "Cloud Analysis Layer (SRA Platform)"
L1[<b>Layer 1: Strategic Intake</b><br/>Unstructured Input Mapping]
L2[<b>Layer 2: MAS Analysis</b><br/>PO, Architect, & Dev Agents]
L3[<b>Layer 3: Objective Review</b><br/>6Cs Audit & RAG Evaluation]
L4[<b>Layer 4: Refinement Hub</b><br/>Live Workspace & Diff Tracking]
L5[<b>Layer 5: Knowledge Persistence</b><br/>Semantic Indexing & Hybrid Search]
Reliability[(<b>Reliability Layer</b><br/>360s Timeout & Jittered Retries)]
L2 & L3 -.-> Reliability
end
subgraph "Local Execution Layer (CLI Toolkit)"
CLI["SRA CLI (@sra-srs/sra-cli)"] -->|Auth/Sync| L1
CLI -->|Verify| Code[(Local Source Code)]
Code -->|Verification Data| CLI
CLI -->|Push Audit Trail| L4
end
Stakeholder((Stakeholder)) -->|Raw Vision| L1
L1 --> L2
L2 --> L3
L3 -->|FAIL: Poor Score| L2
L3 -->|PASS| L4
L4 -->|Export| Artifacts[IEEE SRS, PDF, DFD, API Spec]
L4 --> L5
π Click to Expand Layer Details
- Strategic Intake: Translates free-text into a mapped JSON model aligned with IEEE section hierarchies.
- Multi-Agent Analysis: Orchestrates specialized AI agents (Product Owner, Architect, Developer) using the v1.1.0 Gold Standard prompt registry.
- Objective Review: Automated auditing of SRS content against the 6Cs and RAG evaluation for contextual faithfulness.
- Iterative Refinement: A modular Workspace UI for manual adjustments, version branching, and intelligent diagram repair.
- Knowledge Persistence: Finalized requirements are "shredded" and indexed into a PostgreSQL + pgvector graph for cross-project intelligence.
- IEEE-830 v1.1.0 Compliance: Automated generation with strict identifier governance and academic prose discipline.
- 6Cs Quality Audit: Automated scoring for Clarity, Completeness, Conciseness, Consistency, Correctness, and Context.
- RAG Benchmarking: Real-time evaluation of LLM Faithfulness and Answer Relevancy.
- User Story Evolution: Generates "Jira-Ready" user stories with granular acceptance criteria.
- Multi-Level DFDs: Generates Level 0 (Context) and Level 1 (Functional Decomposition) Gane-Sarson diagrams.
- Interactive Explorer: Powered by
@xyflow/reactwith support for high-fidelity PNG Export.
- Self-Healing Diagrams: Integrated Mermaid Repair Engine that identifies and fixes syntax errors in generated UML.
- Proactive PII Redaction: Automated sanitization of user intent (Emails, Phone, CC) before processing by external AI providers.
- RBAC Architecture: Secure access control with JWT integration and social OAuth (Google/GitHub).
- Revision History: Complete versioning system with visual diff tracking between requirement updates.
- Audit-Ready Exports: One-click professional PDF generation with table of contents and revision logs.
- Spec-to-Code Traceability: Direct link between cloud requirements and local source code implementations.
- Local Compliance Engine: Run
sra checklocally to verify that your code matches the official specification. - Automated Sync: One-command synchronization of requirements into your developer workspace.
- System Diagnostics: Professional
sra doctorutility for environment validation and connectivity troubleshooting. - Reverse Engineering: Beta support for generating requirements directly from existing codebases.
SRA is engineered for stability, security, and enterprise-grade performance.
- Multi-Stage Docker Builds: Minimized production images using separate build/runtime environments.
- Non-Root Execution: Containers run as unprivileged users (
nodejs/nextjs) to mitigate security risks. - Dependency Pinning: Strict versioning of core dependencies (e.g., Next.js 16.1.6) to ensure environment parity.
- Hardened CSP: Strict Content Security Policy injected via Next.js and Express security headers.
- HSTS & Frame Protection: Production-grade
Strict-Transport-SecurityandX-Frame-Options(DENY/SAMEORIGIN) enforcement. - Secure Session Management: JWT-based authentication with secure cookie handling.
- Privacy Sanitization: Integrated
sanitizer.jslayer to prevent data leakage to LLM providers. - Distributed Rate Limiting: Redis-backed throttling ensures global protection across all server instances.
- AI Reliability Layer: Implemented a standardized
BaseAgentwith a 6-minute timeout, jittered retries, and high-fidelity JSON parsing logs for stable long-form document generation. - Frontend Code Splitting: Transitioned to an "Archive-First" dynamic loading strategy using
next/dynamic. Components likeResultsTabsand their individual sub-tabs are lazy-loaded to minimize initial JS payload and improve TBT. - Redis Caching: High-traffic endpoints (Dashboard) cached via Upstash for sub-millisecond retrieval.
- Automated SEO: Dynamic
sitemap.xmlandrobots.txtgeneration for search engine discoverability. - Graceful Shutdown: Native handling of
SIGTERM/SIGINTto ensure zero-downtime deployments. - Standalone Mode: Next.js optimized standalone output.
- Smart Data Fetching: SWR-based caching and background revalidation.
- Automated Encrypted Backups: Weekly automated database backups with AES-256-GCM encryption.
- Point-in-Time Recovery: 7-day PITR via Supabase for granular data restoration.
- CLI Backup Management: Command-line tools for manual backup creation, restoration, and verification.
- Multi-Location Storage: Backups stored locally, in GitHub Artifacts, and Supabase snapshots.
- Integrity Verification: SHA-256 checksums ensure backup file integrity.
- Comprehensive Audit Logging: Tracks all sensitive operations (create, delete, export) with full metadata.
- Threat Detection: Real-time monitoring for brute force attempts, mass deletions, and unusual access patterns.
- Field-Level Encryption: PII data encrypted at rest using AES-256-GCM.
- Daily Security Audits: Automated dependency scanning, secret leak detection, and security header validation.
- Compliance Ready: Audit trails and security reports for regulatory compliance.
SRA leverages professional GitHub Actions for continuous quality assurance and operational excellence.
- Automated Docker Builds: Multi-stage Docker builds triggered on every push to
main, publishing optimized images to GHCR. - Bundle Size Monitoring: Tracks and reports JavaScript bundle size changes for the Next.js frontend, preventing performance regressions.
- Linting & Formatting: Enforces consistent code style and catches potential errors early in the development cycle.
- Scheduled Health Checks: Hourly automated uptime verification of the entire SRA pipeline.
- Real-time Observability: Dedicated
/api/healthendpoint for deep system diagnostics (DB, AI Provider). - Docker Healthchecks: Infrastructure-aware readiness probes ensure the frontend only serves traffic once the backend is fully initialized.
- CodeQL Security Scans: Proactive identification of security vulnerabilities and common coding errors.
- Dependency Vulnerability Checks: Scans for known vulnerabilities in project dependencies.
- Automated Backup Verification: Weekly encrypted database backups with integrity validation.
- Daily Security Audits: Comprehensive security posture checks including secret leak detection and permission audits.
π οΈ Click to Expand
| Component | Technology | Rationale |
|---|---|---|
| Frontend | Next.js 16.1.6 | App Router with standalone output for enterprise scalability. |
| Styling | Tailwind CSS v4 | Next-gen JIT engine for high-performance, responsive UI. |
| Backend | Node.js 20 / Prisma 7 | Type-safe ORM for robust asynchronous data orchestration. |
| Database | PostgreSQL 16+ | High-concurrency persistence with pgvector RAG support. |
| Orchestration | Upstash QStash | Serverless job queue for reliable, long-running AI tasks. |
| LLM Engine | Gemini 2.5 Flash | Advanced reasoning and context window for complex architectural mapping. |
SRA uses Terraform to manage cloud infrastructure declaratively, ensuring reproducibility, disaster recovery, and version-controlled infrastructure changes.
π οΈ Click to Expand Terraform Details
All infrastructure configuration is defined in the terraform/ directory:
terraform/
βββ main.tf # Provider & backend configuration
βββ variables.tf # Variable definitions
βββ vercel.tf # Vercel project resources
βββ outputs.tf # Output values
βββ terraform.tfvars.example # Configuration template
βββ README.md # Detailed usage guideTerraform manages the following infrastructure:
- β
Vercel Projects: Monorepo with frontend (
sra) and backend (sra-backend) - β Build Configuration: Build/install commands and framework settings
- β Git Integration: Repository connections and deployment triggers
Note: Environment variables are managed directly in Vercel dashboard to avoid storing secrets in Terraform state.
# Navigate to terraform directory
cd terraform
# Initialize Terraform
terraform init
# Preview infrastructure changes
terraform plan
# Apply changes (when ready)
terraform apply- π Version Control: Infrastructure changes tracked in git
- π‘οΈ Disaster Recovery: Rebuild entire infrastructure with one command
- π Documentation: Infrastructure is self-documenting code
- π Audit Trail: Complete history of infrastructure changes
- π€ Collaboration: Team members can propose infrastructure changes via PRs
For detailed Terraform usage, see terraform/README.md.
οΏ½οΈ Click to Expand Environment & Deployment
Ensure the following variables are defined in your infrastructure (see .env.example files in backend/ and frontend/ for details):
| Group | Key | Required | Description |
|---|---|---|---|
| Database | DATABASE_URL |
Yes | Postgres connection string with pooling. |
| Database | DIRECT_URL |
Yes | Direct connection string for Prisma migrations. |
| Database | REDIS_URL |
Optional | Redis connection string for rate limiting/caching. |
| AI (Gemini) | GEMINI_API_KEY |
Yes | API key for Google Gemini 2.5 Flash (Primary). |
| AI (OpenAI) | OPENAI_API_KEY |
Optional | API key for OpenAI (Secondary/Internal). |
| Async | QSTASH_TOKEN |
Yes | Bearer token for Upstash QStash job publishing. |
| Async | QSTASH_SIGNING_KEYS |
Yes | Signing keys for verifying QStash webhooks. |
| Auth | JWT_SECRET |
Yes | Secret key for signing authorization tokens. |
| Auth | COOKIE_SECRET |
Yes | Secret key for signed cookies. |
| Security | JWT_SECRET |
Yes | Secret key for JWT signing. |
| Backup | BACKUP_ENCRYPTION_KEY |
Yes | AES-256 key for encrypting database backups. |
| Backup | ENCRYPTION_KEY |
Yes | Master key for field-level data encryption. |
| Backup | ENCRYPTION_SALT |
Yes | Unique salt string for field-level encryption. |
| Backup | BACKUP_ENCRYPTION_SALT |
Yes | Unique salt string for backup encryption. |
| Backup | BACKUP_DIR |
Optional | Directory for backup storage (default: ./backups). |
| Backup | BACKUP_RETENTION_DAYS |
Optional | Backup retention period in days (default: 30). |
| Social Auth | GOOGLE_CLIENT_ID |
Optional | Google OAuth 2.0 Client ID. |
| Social Auth | GITHUB_CLIENT_ID |
Optional | GitHub OAuth App Client ID. |
SRA is fully containerized for cloud-agnostic deployment. Our CI pipeline automatically publishes production-ready images to GitHub Container Registry (GHCR).
# Pull and run the latest images via Compose
docker compose up --build -d- API Service:
http://localhost:3000(Optimized Multi-stage Build) - Application UI:
http://localhost:3001(Next.js Standalone Build)
The SRA toolkit operates cross-workspace for unified project control.
npm install -g @sra-srs/sra-cli
sra initSRA uses standard npm workspaces for monorepo management.
# Install dependencies across all workspaces
npm install
# Initialize Identity & Data
npm run dev:backend
# Or run everything concurrently
npm run dev:allSRA leverages professional GitHub Actions for continuous quality assurance:
- Publish Docker: Automated image pushes to GHCR.
- Bundle Size: Continuous monitoring of Next.js JS payloads on every branch.
- Health Checks: Hourly automated uptime verification of the entire pipeline.
- Security Scans: Integrated CodeQL and dependency vulnerability checks.
π Click to Expand Directory Tree
SRA/
βββ .github/ # CI/CD Workflows (Lint, CodeQL, Stale)
βββ .agent/ # Agent workflows and skill definitions
βββ backend/ # API Engine & Node.js orchestration workspace
β βββ prisma/ # Schema & Migrations
β βββ src/ # Services, controllers, and core AI logic
βββ frontend/ # Next.js 16 Application workspace
β βββ app/ # Server-driven App Router
β βββ components/ # High-fidelity React components
βββ cli/ # SRA Toolkit npm workspace
βββ model/ # AI Model and testing workspace
βββ terraform/ # Infrastructure as Code (Platform config)
βββ docs/ # Documentation & Security policies
βββ package.json # Root monorepo workspace definition- v2.0: Strategic 5-Layer Pipeline Implementation.
- v2.1: Interactive DFD Explorer & PNG Export.
- v2.2: GitHub CI/CD & Agentic Automation.
- v3.0: SWR Data Fetching & Backup Automation.
- v3.0: Enterprise Security Monitoring & Audit Logging.
- v3.1: Distributed Rate Limiting & Load Balancing.
- v3.2: Industry Benchmarking & MAS Refinement.
- v4.0: Full CLI Toolkit & Spec-to-Code Traceability.
- v4.5: Collaborative Real-time Multi-User Editing.
- v5.0: Custom Model Fine-tuning (MLOps integration).
We welcome contributions from the community. Please review our Contribution Guidelines and Governance Policy for architectural context and coding standards.
To report vulnerabilities, please contact the security team via the repository's security advisory tab.
This project is licensed under the Apache License 2.0. See the LICENSE file for the full legal text.