A comprehensive web-based requirements and test management system built with Rust, Rocket, and PostgreSQL. The primary UI is a React 19 + Vite + TypeScript SPA (Tailwind CSS; React Flow for traceability), talking to a JSON API under /api. Legacy client assets remain under frontend/static/ for gradual migration (@static in Vite). This software supports hierarchical requirements, tests (verifications), traceability matrices, baselines, reports, and exports.
Documentation index (by audience): docs/README.md
Installation (operations): host packages, Docker, database, CI parity β see INSTALL.md.
- Multi-Project Support: Manage multiple projects with isolated data
- Requirements Management: Create, edit, and organize hierarchical requirements
- Test Management: Manage tests with status tracking and source documentation
- Traceability Matrix: Visual mapping between requirements and tests; requirement detail page lists all linked tests per requirement (βVerified byβ section with links to test pages)
- User Management: Assign authors and reviewers to requirements with authentication
- Project reviewers: Per-project list of members who may change requirement status, verification status, and version approval (draft / reviewed / approved); configured in the SPA Settings or via
GET/PUT /api/projects/<id>/reviewers
- Requirement comments: Comment threads on requirements and optional requirement versions; author, timestamp, optional version reference; chronological list; immutable after creation. UI panel on requirement/version detail pages; approved versions can be locked from new comments (
LOCK_APPROVED_VERSION_COMMENTS). Comments in audit logs and in Excel/ReqIF exports. - Requirement version diff: Compare two requirement versions or a baseline snapshot vs current; API returns structured diff (metadata, verification, text) with optional labels (e.g. Status βDraftβ, verification method titles) in addition to IDs; UI diff modal shows these labels for easier reading
- Categories: User-defined categories for organizing requirements (project-specific)
- Applicability: Define product lines, system types, or project scopes (project-specific)
- Status Tracking: Track requirement status (Draft, Accepted, Rejected, etc.)
- Verification Methods: Specify verification types (Test, Analysis, Review, etc.)
- Authentication: Secure login system with password management
- Project Isolation: Data separation between different projects
- Excel Export: Export requirements with all fields to Excel format; includes a Comments sheet (requirement_id, version_id, author, created_at, body)
- Matrix Export: Export traceability matrix to Excel
- ReqIF 1.2: Import and export requirements as ReqIF XML; export current project or an immutable baseline; comments included as Remarks attribute per requirement when present
- Comprehensive Data: All metadata included in exports (categories, applicability, dates, comments, etc.)
- Project Baselines: Create point-in-time snapshots of all requirement versions and traceability
- Immutable: Baselines and their contents cannot be updated or deleted (enforced at DB and API level)
- Version Snapshot: Each baseline stores which
requirement_versionwas current per requirement, plus the traceability matrix at creation time - Export from Baseline: ReqIF and UI support exporting a specific baseline for audits or releases
- API & UI: Create/list/view baselines via REST API and web UI (project Baselines section, nav, requirements export dropdown)
- Baseline detail page: View baseline metadata, requirements table, and full traceability list; requirement and test references (e.g. REQ-PWR-001, TEST-PWR-001) are shown instead of raw IDs, with one row per (requirement, test) link
- Diff vs current: From a baseline view, compare a requirementβs snapshot to the current version in a diff modal; the βDiff vs currentβ action is hidden when the requirement is unchanged (same version as current)
- Stack: React 19, Vite 6, TypeScript, Tailwind CSS; light/dark theming and shared design tokens
- Routing: Login, project-scoped requirements and verification views, requirement editor, traceability graph β see frontend/README.md
- Responsive: Layout tuned for desktop and smaller viewports
- Same-origin API: Session cookies and CSRF work when the SPA and
/apishare an origin (Docker nginx or Vite dev proxy); details in docs/developer/http-api-contract.md
- RESTful API: Complete programmatic access to all data
- JSON Format: Standard JSON responses for integration
- CRUD Operations: Full Create, Read, Update, Delete support
- Project-Scoped: All API operations respect project boundaries; project-scoped routes support both session and Bearer token auth (e.g. for MCP)
- API tokens: Bearer token auth for headless clients (e.g. MCP); tokens can be scoped to a project (see MCP Setup)
- MCP server: Optional TypeScript MCP server in
mcp-server/that exposes a subset of the REST API as MCP tools for AI assistants (Cursor, Claude, etc.). Bearer token; project-scoped. Full parity matrix: MCP Setup. - Core read (default):
MARREQ_MODE=read_onlyβ requirements, trace, coverage, baselines (get + diff). - Extended read:
MARREQ_MODE=read_extended(ordraft_write) β verifications, baseline list, audit activity, comments, matrix read, catalog, baseline-vs-current diff. - Draft write:
MARREQ_MODE=draft_writeβ create/patch requirement, approvals, baselines, requirement comments. - Trace write:
MARREQ_TRACE_WRITE=trueβ replace verification matrix links, clear suspect flags. - Audit: Every tool call is logged to Marreq (
POST /api/mcp/audit).
- Detail page: Approval badge (draft / reviewed / approved), metadata (approved by, date), and contextual actions: Mark as Reviewed and Approve Requirement for users in the project reviewers list (or administrators). Confirmation modals before each transition.
- Edit when approved: Clicking Edit on an approved requirement shows a warning that editing creates a new Draft version; user can cancel or proceed.
- Version history: Each version shows its approval state; list and detail show approval consistently.
- List view: Approval column and filters (Approved only / Not approved). Approval state is read-only once set; transitions are explicit and audit-friendly.
- Hierarchy for
- Requirements
- Tests
- Better webpage
- Use templates (based on hbs)
- Modern CSS design system
- Responsive layout
- Reports generator
- Excel export for requirements
- Excel export for traceability matrix
- Latex template
- PDF document
- Categories management
- CRUD operations
- API endpoints
- Applicability management
- CRUD operations
- API endpoints
- REST API (comprehensive)
- Requirements endpoints
- Tests endpoints
- Categories endpoints
- Applicability endpoints
- Matrix endpoints
- Operations logging
- Parsers for requirements
- Latex files (Write a command)
- Word files (Write a macro)
- Excel files
- Parsers for tests
- Doxygen documentation
- ...
- Multiple projects
- Optimize DB access
- Reduce SQL queries
- DB pool
- Security
- Use https
- users/admin
- Snapshots
- Immutable project baselines (requirement versions + traceability)
- Configuration management
- Better error management
- Remove unwrap/expect in production paths (guards, routes, DB init, Excel export)
- Result-based DB pool init; clear startup failure message
- try_repo_read/try_repo_write for non-panicking lock in request path
- PostgreSQL: Database backend (provided via Docker)
- Docker & Docker Compose: For database containerization
- Rust: Programming language
- clang / libclang-dev: Required by
xlsxwriter
For a fully initialized database with pre-configured users and sample data, use the helper scripts described in the scripts README, in particular db_setup.sh (optionally followed by db_seed.sh).
Typical flow:
- Start database:
docker compose -f docker/docker-compose.yml up -d db - Initialize DB schema:
./marreq-core/scripts/db_setup.sh - Load sample data (optional):
./marreq-core/scripts/db_seed.sh - Start API (self-hosted mode):
cargo run -p marreq-serverβ serves http://127.0.0.1:8000 with JSON under/api.
For the full browser UI locally, run the SPA against that API:
cd frontend
npm install
npm run dev # http://localhost:5173 β proxies /api β http://127.0.0.1:8000Demo admin user alice / ChangeMe123! (change after first login).
For the full setup matrix (marreq-server vs marreq-cloud, Docker vs local), see the setup guide. For database-only details (automated, manual, reset, verification), see the database setup guide.
The default docker/docker-compose.yml stack runs db, marreq-server (Rocket JSON API on 127.0.0.1:8000), frontend (nginx serving the production Vite build on http://localhost:8080 with /api/ proxied to marreq-server), and adminer (http://localhost:8081). The cloud compose profile adds marreq-cloud on 127.0.0.1:8001 plus frontend-cloud on http://localhost:8082. See the setup guide, docker/README.md, and the HTTP API contract.
Workspace layout, deployment modes, and build commands: docs/developer/workspace-layout.md. SPA scripts, routes, and API mapping: frontend/README.md.
Use the SPA (Docker http://localhost:8080 or npm run dev in frontend/). Sign in, pick a project, then use requirements, verifications, traceability, and related flows from the in-app navigation.
- Requirements: View and manage requirements (versions, comments where exposed in the UI). Comments on requirement/version views follow project rules (e.g. locked on approved versions when configured).
- Verifications (tests): Manage verification records per project
- Traceability: Matrix / graph views linking requirements and verifications
- Baselines: Create and inspect immutable snapshots; export ReqIF where the UI exposes it; diff vs current when available
- Categories & applicability: Managed per project where the UI provides entry points (additional admin flows may be API-only)
- Requirements Export: Click "Export Excel" on the requirements page or homepage
- Matrix Export: Click "Export Excel" on the matrix page
- ReqIF Export: Use "Export β ReqIF (current)" for live project, or "ReqIF (from baselineβ¦)" to pick a baseline and download its snapshot as ReqIF 1.2 XML
- File Format: Excel downloads as
.xls; ReqIF as XML
- Excel Import (Web UI): Upload
.xlsx/.csvfiles in the project import flow with column mapping - ReqIF 1.2 Import: Import requirements from ReqIF XML into a project (project ReqIF/Import page)
- Data Import: Import requirements and related metadata from Excel or ReqIF
- Indexing integration: Imported requirements are queued for semantic index refresh when embeddings are enabled
Interchangeable clients: session auth, CSRF, and Docker/nginx notes are documented in docs/developer/http-api-contract.md. A partial OpenAPI spec covers auth and session-scoped project listing.
http://localhost:8000/api
Behind the Docker frontend (or Vite dev), use the same origin as the SPA (e.g. http://localhost:8080/api/...). JSON routes are mounted under /api from marreq-core/src/api/mod.rs (shared routes) and the deployment crate's src/routes.rs (deployment-specific routes). When adding or changing API endpoints, update this section so the list stays in sync.
GET /auth/csrfβ JSON{ "csrf_token" }for mutating requests (X-CSRF-Tokenheader)POST /auth/loginβ JSON bodyusername,password; sets session + CSRF cookiesPOST /auth/logoutβ clears sessionGET /auth/meβ current user or 401 JSON (not HTML login page)GET /projectsβ projects for logged-in user (admin: all; others: memberships)GET /project-from-path/{namespace}/{slug}β resolve/{namespace}/{slug}to project id (SPA deep links; 403 if not a member)GET /projects/{project_id}/verificationsβ list verifications (tests) in the project (ViewRequirements)
GET /requirements- List all requirementsGET /requirements/{id}- Get specific requirementGET /requirements/{id}/versions- List versions for a requirement (newest first)GET /requirements/{req_id}/versions/{version_id}- Get a specific requirement versionGET /requirements/{req_id}/versions/{v1}/diff/{v2}- Diff two requirement versions (structured JSON: text and metadata added/removed/unchanged; includes optional labels for status, category, applicability, verification)PUT /requirements/{req_id}/versions/{version_id}/approval- Set approval state (body:state: "reviewed" | "approved"; project owners/managers only)GET /requirements/{id}/comments- List comments for a requirement (query: optionalversion_id; chronological order)POST /requirements/{id}/comments- Add a comment (body:body, optionalrequirement_version_id; approved versions rejected whenLOCK_APPROVED_VERSION_COMMENTS=true)POST /requirements- Create new requirementPATCH /requirements/{id}- Partially update supported requirement fieldsDELETE /requirements/{id}- Delete requirement
Project-scoped (session or Bearer token):
GET /projects/{project_id}/requirements- List requirements; query:approval_state,has_testsGET /projects/{project_id}/requirements/{id}- Get requirement with trace summary (parent, children, linked tests)GET /projects/{project_id}/requirements/{req_id}/versions/{v1}/diff/{v2}- Diff two versions (requirement must belong to project)POST /projects/{project_id}/requirements- Create requirement (body must includeproject_idmatching route)PATCH /projects/{project_id}/requirements/{id}- Partially update requirementPUT /projects/{project_id}/requirements/{req_id}/versions/{version_id}/approval- Set approval state (body:state: "reviewed" | "approved")
GET /tests- List all testsGET /tests/{id}- Get specific testPOST /tests- Create new testPOST /tests/{id}/field- Partially update a test field (body:field,value; supported fields: name, description, source, status_id, reference_code, parent_id)DELETE /tests/{id}- Delete test
GET /categories- List all categoriesGET /categories/{id}- Get specific categoryPOST /categories- Create new categoryPUT /categories/{id}- Update categoryDELETE /categories/{id}- Delete category
GET /applicability- List all applicability optionsGET /applicability/{id}- Get specific applicabilityPOST /applicability- Create new applicabilityPUT /applicability/{id}- Update applicabilityDELETE /applicability/{id}- Delete applicability
GET /matrix- Get traceability matrix dataGET /projects/{project_id}/matrix- Get traceability matrix for a project (session or Bearer)
GET /projects/{project_id}/baselines- List baselines for a projectGET /projects/{project_id}/baselines/{baseline_id}- Get baseline metadataPOST /projects/{project_id}/baselines- Create baseline (body:name,description; captures current requirement versions and traceability)GET /projects/{project_id}/baselines/{baseline_id}/requirements- Get requirements as stored in the baselineGET /projects/{project_id}/baselines/{baseline_id}/requirements/{req_id}/diff/current- Diff requirement in baseline vs current version (structured JSON with optional labels for status, category, applicability, verification)GET /projects/{project_id}/baselines/{baseline_id}/traceability- Get traceability snapshot for the baseline
GET /users- List all usersGET /users/{id}- Get specific userPOST /users- Create new userDELETE /users/{id}- Delete user
GET /status- List all status optionsGET /status/{id}- Get specific statusPOST /status- Create new status
GET /projects/{project_id}/requirements/{id}/trace_up- Get parent requirement(s) (session or Bearer)GET /projects/{project_id}/requirements/{id}/trace_down- Get child requirements and linked tests (session or Bearer)GET /projects/{project_id}/coverage_report- Requirements without tests, tests without requirements, suspect links (session or Bearer)POST /traceability/clear_suspect- Clear suspect flag for a traceability link (body:req_id,test_id; records current user and timestamp)
GET /projects/{project_id}/requirements/semantic_search- Search requirements by semantic similarity (query params:q, optionalk, filters)POST /projects/{project_id}/requirements/ask- RAG answer over project requirements (body:query, optionalk, filters)POST /projects/{project_id}/requirements/reindex- Reindex all requirements for the project (admin only)GET /projects/{project_id}/requirements/index_status- Get indexing status for the projectGET /projects/{project_id}/requirements/semantic_search/status- Check if semantic search is enabled
GET /cache/stats- Cache statisticsPOST /cache/clear- Clear cachePOST /cache/cleanup- Remove expired entriesGET /cache/performance- Cache performance metricsGET /cache/recommendations- Cache tuning recommendationsPOST /cache/reset-counters- Reset performance countersGET /cache/health- Cache health check
# Get all requirements
curl http://localhost:8000/api/requirements
# Create a new category
curl -X POST http://localhost:8000/api/categories \
-H "Content-Type: application/json" \
-d '{"title": "API", "description": "API requirements", "tag": "API"}'
# Export requirements to Excel
curl -O http://localhost:8000/requirements.xlsThe application uses PostgreSQL with the following main entities:
- Projects: Multi-project support with project metadata
- Requirements: Logical requirement containers; current content lives in requirement_versions (immutable version history)
- Requirement versions: Immutable snapshots of requirement content (title, description, status, category, applicability, etc.)
- Requirement comments: Immutable comments attached to a requirement (general) or a specific version; author, body, created_at; optional requirement_version_id
- Tests: Test cases with status and source information, project association
- Matrix: Traceability links between requirements and tests (live), project-scoped
- Baselines: Immutable project snapshots; baseline_requirements stores which requirement_version was current per requirement, baseline_traceability stores the matrix at baseline time
- Categories, Applicability, Requirement status, Test status, Verification: Project-scoped lookup/config tables
- Users: System users (authors, reviewers) with authentication
- User API tokens: Bearer tokens for headless/MCP access; optional project scope; hashed storage, last_used_at tracking
- Logs: Audit trail for all system activities
For a full entity-relationship diagram see docs/architecture/database-schema.md (Mermaid).
A comprehensive database initialization system is provided, including SQL files, helper scripts, pre-configured users, and rich sample data.
- For end-to-end database setup and reset via scripts, see the scripts README (
db_setup.sh,db_seed.sh,db_reset.sh). - For a full description of the schema, sample projects/users, and manual initialization commands, see the database setup guide.
Database schema changes are managed through Diesel migrations (diesel.toml lives in marreq-core/; run CLI commands from there):
cd marreq-core
# Create new migration
diesel migration generate migration_name
# Run migrations
diesel migration run
# Revert migrations
diesel migration redoNote: Migrations are the single source of truth for schema creation/evolution. marreq-core/scripts/init_complete.sql is seed data only (sample projects/users/requirements) and should be run after migrations.
Marreq/
βββ Cargo.toml # Virtual workspace (marreq-core, marreq-server, marreq-cloud)
βββ Cargo.lock # Single lock-file for the whole workspace
βββ Makefile # make server / make cloud / make test / β¦
βββ marreq-core/ # shared lib (domain, persistence, Rocket primitives)
β βββ Cargo.toml
β βββ src/ # Library source (api/, auth/, services/, models/, β¦)
β βββ migrations/ # Diesel migrations (schema source of truth)
β βββ diesel.toml
β βββ scripts/ # Dev tooling & DB helpers
β βββ db_setup.sh
β βββ db_seed.sh
β βββ db_migrate.sh
β βββ db_reset.sh
β βββ db_backup.sh
β βββ run_checks.sh # fmt, clippy, stylelint, purgecss, npm test
β βββ run_tests.sh
β βββ init_complete.sql
βββ marreq-server/ # self-hosted binary (admin-managed users)
β βββ Cargo.toml
β βββ src/
β βββ main.rs # Rocket launch for server mode
β βββ deployment.rs # impl DeploymentMode for Server
β βββ api/ # Server-only REST handlers
β βββ routes.rs # pub fn routes() for server-only routes
βββ marreq-cloud/ # hosted/SaaS binary (self-registration)
β βββ Cargo.toml
β βββ src/
β βββ main.rs # Rocket launch for cloud mode
β βββ deployment.rs # impl DeploymentMode for Cloud
β βββ api/ # Cloud-only REST handlers (register, verify-email, β¦)
β βββ services/ # registration_service.rs
β βββ fairings/ # cloud_admin_bootstrap.rs
β βββ routes.rs # pub fn routes() for cloud-only routes
βββ frontend/ # React + Vite SPA + legacy static/
β βββ src/ # React app (main.tsx, routes, components)
β βββ static/ # Legacy JS/CSS (optional @static alias)
β βββ package.json
βββ docs/ # Documentation (developers/architects/users)
β βββ README.md # Documentation index
β βββ ReqIF/ # ReqIF standards and reference docs
βββ mcp-server/ # Optional MCP server (Node/TypeScript) for AI assistants
βββ docker/ # Container files (compose, Dockerfile, entrypoint, CI override)
β βββ docker-compose.yml # Main Docker Compose stack
β βββ docker-compose.ci.yml
β βββ Dockerfile # Backend image (MARREQ_BIN=marreq-server|marreq-cloud)
β βββ frontend/ # Frontend image + nginx config
β βββ docker-entrypoint.sh
β βββ README.md
- Backend: Rust, Rocket, Diesel, PostgreSQL
- Frontend: React 19, TypeScript, Vite, Tailwind CSS (see frontend/README.md)
- Legacy assets:
frontend/static/(not loaded by default in the React shell) - Reports: Excel generation with xlsxwriter
- Containerization: Docker Compose (db, backend, frontend, optional services)
# Development build (all crates)
cargo build --workspace
# Release build
cargo build --workspace --release
# Run tests (all crates)
cargo test --workspace
# Run tests for a specific crate
cargo test -p marreq-core
# Run all checks (fmt, clippy, stylelint, purgecss, npm ci, npm test)
bash marreq-core/scripts/run_checks.sh
# Run backend test suite with summary output
bash marreq-core/scripts/run_tests.sh
# Run local CI flow (supports --jobs)
bash marreq-core/scripts/run_ci.sh local-ci --jobs 2This project is open source. See LICENSE file for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
If the app exits immediately with "Database setup failed", set DATABASE_URL (e.g. in .env) and ensure the database is reachable. The app uses Result-based pool initialization and will not start without a valid pool.
# Check if port 8000 is in use
lsof -i :8000
# Kill existing process
kill <PID>
# Start application (self-hosted mode)
cargo run -p marreq-server- Default credentials: Seeded admin
alicehas passwordChangeMe123!(change after first login). - Available users: alice, dr_smith, eng_jones, tech_lee, qa_wilson, admin
- Reset passwords: Update database directly or re-run setup script
- Database indexes: The initialization script includes optimized indexes
- Connection pooling: Application uses connection pooling for better performance
- Query optimization: Consider adding indexes for custom queries
For issues and questions, please open an issue on the project repository.
- Check troubleshooting section above
- Review application logs for error messages
- Run Docker checks/reset from docker/README.md
- Check Docker container status
- Open an issue with detailed error information