How poorav007/speccraftai works
SpecCraft AI is an API-specification generator with a lightweight browser uploader/route-preview workflow and a separate Python static-analysis pipeline. In the shown frontend flow, a user submits code through the import page, the client parser builds a minimal OpenAPI preview, and the app persists the result in browser storage. The repository also names editor, validation, diff, export, viewer, and history capabilities. Backend excerpts show safe source ingestion and FastAPI AST extraction; they do not show frontend-to-backend wiring, so the two flows remain separate here.
Main entry points: fastapi_adapter.py FastAPI parser · models.py Source models · CodebaseImportPage.jsx Code import · App.jsx App state
Components 21
Browser workflow
- Code import
frontend/src/pages/CodebaseImportPage.jsx - Project uploader
frontend/src/components/import/ProjectUploader.jsx - Route parser
frontend/src/utils/parser.js - App state
frontend/src/App.jsx - Browser storage
frontend/src/utils/localStorage.js
Static analysis
- Source reader
backend/speccraft/reader.py - Path safety
backend/speccraft/utils/path_safety.py - Source models
backend/speccraft/models.py - Parser contract
backend/speccraft/parser/base.py - FastAPI parser
backend/speccraft/parser/fastapi_adapter.py - Schema builder
backend/speccraft/schema_builder.py - Diagnostics
backend/speccraft/diagnostics.py - Parse timing
backend/speccraft/utils/timing.py
Spec lifecycle
- AST analysis
frontend/src/pages/AstAnalysisPage.jsx - Spec editor
frontend/src/pages/SpecificationEditorPage.jsx - Validation results
frontend/src/pages/ValidationResultsPage.jsx - Spec comparison
frontend/src/pages/SpecificationDiffPage.jsx - Spec export
frontend/src/pages/ExportCenterPage.jsx - Interactive viewer
frontend/src/pages/InteractiveViewerPage.jsx - Settings and history
frontend/src/pages/SettingsHistoryPage.jsx
Other components
- Engineer
Connections 13
- Engineer → Code import: submits code
frontend/src/pages/CodebaseImportPage.jsx - Code import → Project uploader: renders
frontend/src/pages/CodebaseImportPage.jsx - Project uploader → Route parser: parses routes
frontend/src/components/import/ProjectUploader.jsx - App state → Code import: renders
frontend/src/App.jsx - App state → Browser storage: loads and saves
frontend/src/App.jsx - Source reader → Path safety: validates paths
backend/speccraft/reader.py - Source reader → Source models: creates source files
backend/speccraft/reader.py - Parser contract → Source models: uses result models
backend/speccraft/parser/base.py - FastAPI parser → Source models: builds extraction results
backend/speccraft/parser/fastapi_adapter.py - FastAPI parser → Parser contract: implements contract
backend/speccraft/parser/fastapi_adapter.py - FastAPI parser → Schema builder: uses schema extraction
backend/speccraft/parser/fastapi_adapter.py - FastAPI parser → Parse timing: measures parsing
backend/speccraft/parser/fastapi_adapter.py - Source models → Diagnostics: includes diagnostics
backend/speccraft/models.py