Skip to content

Step 1: Project Map & Repository Scan ​

Folder Tree & File Purpose ​

21-bis-compliance-engine/
├── .dockerignore                           # Excludes git, cache, and node_modules from Docker build
├── Dockerfile                              # Multi-stage/Slim Python 3.11 container definition (Port 10000)
├── app.py                                  # Core FastAPI application, route handlers, ML pipeline & inference
├── bis_product_department_model_v3.pkl     # Serialized Scikit-Learn classifier for regulatory department routing
├── bulk_ingest.py                          # Ingestion pipeline expanding corpus with mandatory QCO standards
├── complete_12_node_bis_spine.csv          # Reference CSV dataset mapping 12 primary BIS regulatory nodes
├── crawl_standards.py                      # Crawler script designed for standards.bis.gov.in portal extraction
├── eval_guardrail.py                       # Test suite validating 4-tier domain guardrail against adversarial queries
├── export_route_patch.py                   # Utility patch enabling CSV export endpoint integration
├── gap_engine.py                           # Weighted readiness evaluation engine & RFC-4180 CSV report generator
├── guardrail.py                            # 4-tier domain validation guardrail (regex, blacklist, dense threshold)
├── merge_corpus.py                         # Deduplication and staging merger script for model2_corpus.json
├── model2_corpus.json                      # Master static knowledge base of 47 vetted Indian Standards
├── model2_rag_faiss.index                  # Pre-computed 384-dimensional FAISS IndexFlatIP vector index
├── rebuild_faiss_index.py                  # Script using FastEmbed ONNX to regenerate model2_rag_faiss.index
├── requirements.txt                        # Pinned Python package dependencies for backend runtime
├── smoke_check.py                          # Pre-flight latency benchmark and HTTP endpoint verification script
├── test_retrieval.py                       # Sanity verification script testing retrieval accuracy against test queries
├── package.json                            # Workspace root package manifest (VitePress docs scripts & dependencies)
│
├── bis-frontend/                           # React 19 Single Page Application
│   ├── .env.production                     # Production environment variable configuration
│   ├── index.html                          # HTML5 root template mounting React application
│   ├── package.json                        # Frontend dependencies and npm scripts
│   ├── vite.config.js                      # Vite 8 configuration with React plugin
│   └── src/
│       ├── App.jsx                         # Main React application component (UI, state, API calls, export)
│       ├── App.css                         # Application-level layout and responsive styles
│       ├── index.css                       # Base stylesheet and typography definitions
│       └── main.jsx                        # Entry script rendering React 19 root into DOM
│
└── docs/                                   # Complete Interview-Ready Documentation Suite (VitePress)
    ├── .vitepress/
    │   ├── config.mjs                      # VitePress documentation configuration and sidebar tree
    │   └── theme/
    │       ├── custom.css                  # Pure black OLED dark theme styling overrides
    │       └── index.js                    # VitePress custom theme entry point
    ├── 00-project-type.md                  # Pre-check project categorization and detection evidence
    ├── 00a-project-analysis.md             # Complete full-stack trace, connections, and system inventory
    ├── 00b-project-pitch.md                # 30-second and 2-minute spoken interview pitch scripts
    ├── 00-project-map.md                   # Repository folder map, dependencies, and environment variables
    ├── 01-features.md                      # Comprehensive feature catalog (F1-F5)
    ├── 02-build-order.md                   # Step-by-step rebuild manual from greenfield to production
    ├── 03-api-reference.md                 # Complete OpenAPI/REST endpoint documentation
    ├── 04-tech-comparisons.md              # Deep technical decision matrices and trade-off tables
    ├── 05-architecture.md                  # System architecture, data flow, and scaling diagrams
    ├── 06-security.md                      # OWASP Top 10 audit, air-gapped immunity, and safety measures
    ├── 07-ai-integration.md                # FastEmbed ONNX, FAISS vector search, and guardrail deep dive
    ├── 08-quality-and-ops.md               # Testing suites, Dockerization, profiling, and tech debt analysis
    ├── 09-interview-qa.md                  # 150+ project-specific interview questions and model answers
    ├── 10-gaps-and-improvements.md         # Production roadmap and prioritized architectural enhancements
    ├── 11-glossary.md                      # Exhaustive dictionary of regulatory, ML, and web engineering terms
    ├── 12-confirm-list.md                  # Verification list of codebase decisions marked for confirmation
    ├── 13-master-checklist.md              # 275-point exhaustive engineering readiness checklist
    ├── 14-say-it-out-loud.md               # Consolidated spoken scripts for every feature and rehearsal guide
    ├── README.md                           # Documentation hub and navigation guide
    ├── index.md                            # VitePress homepage layout with feature cards
    ├── features/                           # Detailed per-feature specifications (F1 - F5)
    └── system-design/                      # 19-part comprehensive distributed system design deep dive

Tech Stack & Exact Versions ​

Backend (Python Runtime) ​

Technology / LibraryExact VersionPurpose in Codebase
Python3.11 (Docker base)Core runtime environment
FastAPI0.110.0High-performance asynchronous REST web framework
Uvicorn0.28.0Lightning-fast ASGI production web server
Pydantic2.6.4Request payload schema validation & serialization
FastEmbed>=0.5.0Zero-PyTorch ONNX runtime embedding generator (BAAI/bge-small-en-v1.5)
FAISS CPU1.8.0Dense vector similarity index and nearest-neighbor search
Scikit-Learn1.4.1.post1Supervised department classification model execution
NumPyLatest compatibleHigh-performance multidimensional array manipulation for vector math
Python-Multipart0.0.9Form-data and multipart payload parsing support

Frontend (JavaScript Runtime) ​

Technology / LibraryExact VersionPurpose in Codebase
React^19.2.8Declarative UI component library
React DOM^19.2.8React DOM renderer
Lucide React^1.46.0Modern, lightweight SVG iconography
@huggingface/transformers^4.2.0In-browser model integration client (reserved for edge inference)
Vite^8.3.0Next-generation frontend build tool and development server
@vitejs/plugin-react^6.1.1Fast Refresh and JSX transformation plugin for Vite
Oxlint^1.81.0High-performance Rust-based JavaScript/JSX linter

Documentation Site ​

Technology / LibraryExact VersionPurpose in Codebase
VitePress^1.6.3Static site generator powered by Vite and Vue
Mermaid^11.4.1Diagramming and charting tool using markdown syntax
VitePress Plugin Mermaid^2.0.17Seamless Mermaid diagram rendering inside VitePress pages

Environment Variables ​

VariableDefault ValueUsed In CodeDescriptionWhere to Obtain
PORT10000 (Docker) / 8000 (Local)[Dockerfile:L4,L15](file:///Users/avishjain/avishjain9-repos/21-bis-compliance-engine/Dockerfile#L4)Port on which Uvicorn binds the FastAPI serverSet via environment or container config
PYTHONUNBUFFERED1[Dockerfile:L3](file:///Users/avishjain/avishjain9-repos/21-bis-compliance-engine/Dockerfile#L3)Forces Python standard output streams to be unbufferedDocker runtime flag

Note: This platform has ZERO external API keys or cloud credentials (such as OpenAI, AWS, or Pinecone keys) because the system operates 100% offline and air-gapped.


Entry Points ​

Tier / ProcessEntry Point FileLaunch Command
Backend API[app.py](file:///Users/avishjain/avishjain9-repos/21-bis-compliance-engine/app.py)uvicorn app:app --reload --port 8000
Frontend UI[bis-frontend/src/main.jsx](file:///Users/avishjain/avishjain9-repos/21-bis-compliance-engine/bis-frontend/src/main.jsx)npm run dev (inside bis-frontend/)
Documentation[docs/index.md](file:///Users/avishjain/avishjain9-repos/21-bis-compliance-engine/docs/index.md)npm run docs:dev
Docker Container[Dockerfile](file:///Users/avishjain/avishjain9-repos/21-bis-compliance-engine/Dockerfile)docker build -t bis-engine . && docker run -p 10000:10000 bis-engine
Evaluation Suite[eval_guardrail.py](file:///Users/avishjain/avishjain9-repos/21-bis-compliance-engine/eval_guardrail.py)python eval_guardrail.py
Pre-Flight Smoke Check[smoke_check.py](file:///Users/avishjain/avishjain9-repos/21-bis-compliance-engine/smoke_check.py)python smoke_check.py
Vector Index Rebuilder[rebuild_faiss_index.py](file:///Users/avishjain/avishjain9-repos/21-bis-compliance-engine/rebuild_faiss_index.py)python rebuild_faiss_index.py