How theshafcodes/logivshaf works
1. This repository is organized as a single main application: quotation-extractor, built with Next.js and TypeScript. The rest of the repo is mostly guidance/specification material rather than separate deployable services.
2. The runtime boundary is the Next.js app under quotation-extractor/app. app/page.tsx is the user-facing entry point, with app/layout.tsx and app/globals.css providing the shell and styling. This suggests a browser-driven upload/analysis workflow.
3. The backend surface is implemented as App Router API routes:
- app/api/extract/route.ts for the primary end-to-end quotation extraction flow
- app/api/extract-raw/route.ts for a lower-level/raw extraction path
These routes are the main orchestration layer and likely the only HTTP APIs exposed by the app.
4. The core integration with document processing lives in lib/adobe-extract.ts. This is the external-service boundary and appears to handle PDF/document extraction via Adobe’s extraction tooling or API.
5. lib/parse-quotation.ts is the domain transformation layer. It likely converts extracted document text/structure into a normalized quotation model, separating vendor-specific PDF extraction from business-specific parsing.
6. lib/pdf-config.ts holds extraction-related configuration for PDFs. That makes PDF handling a first-class concern, and it likely controls page/input settings used by the extraction pipeline.
7. The domain contract is centralized in types/quotation.ts, with a second quotation.ts file at the repo root suggesting shared quotation schema or domain definitions outside the app folder. This is the shape that API responses and parsing logic should agree on.
8. The main data flow is:
browser/UI upload or request → /api/extract or /api/extract-raw → Adobe-based document extraction → quotation parsing/normalization → typed JSON response back to the UI or caller.
The raw route likely exposes an intermediate stage for debugging or inspection.
9. There is no evidence of a database, queue, or background worker. The architecture looks stateless and request/response driven, with processing happening synchronously inside the API route handlers.
10. Tooling and framework files (next.config.ts, tsconfig.json, eslint.config.mjs, postcss.config.mjs, package.json) indicate a standard Next.js/TypeScript frontend-plus-API deployment model, probably suitable for serverless or Node hosting.
11. The top-level docs (QUICKSTART.md, TECHNICAL_PROMPT.md, FRAGILITY_CLASSIFICATION_PLAN.md, van-calculation.md) suggest the repo also contains implementation guidance and adjacent domain notes. They are useful for understanding intended behavior, but they are not part of the runtime call graph.
Main entry points: quotation-extractor quotation-extractor · extract/route.ts Extract API · extract-raw/route.ts Raw API · quotation.ts Quotation types
Components 17
Repository
Top-level guidance and shared domain notes
- README · Repository entry guidance
README.md - Quickstart · Setup and usage guidance
logi-v1-main/logi-v1-main/QUICKSTART.md - Tech prompt · Implementation guidance and constraints
logi-v1-main/logi-v1-main/TECHNICAL_PROMPT.md - Fragility plan · Domain-specific quality and failure analysis notes
logi-v1-main/logi-v1-main/quotation-extractor/FRAGILITY_CLASSIFICATION_PLAN.md - Van calc · Adjacent domain notes
logi-v1-main/logi-v1-main/van-calculation.md - Quotation schema · Shared quotation definition at repo root
logi-v1-main/logi-v1-main/quotation.ts - Tooling · Next.js and TypeScript build/runtime configuration
logi-v1-main/logi-v1-main/quotation-extractor/package.json
Next.js app
Main browser-facing application and API routes
- quotation-extractor · Main Next.js application
logi-v1-main/logi-v1-main/quotation-extractor - Home page · User-facing upload and analysis entry point
logi-v1-main/logi-v1-main/quotation-extractor/app/page.tsx - App shell · Global layout wrapper
logi-v1-main/logi-v1-main/quotation-extractor/app/layout.tsx - Global styles · Application-wide styling
logi-v1-main/logi-v1-main/quotation-extractor/app/globals.css - Extract API · Primary end-to-end quotation extraction endpoint
logi-v1-main/logi-v1-main/quotation-extractor/app/api/extract/route.ts - Raw API · Lower-level extraction endpoint
logi-v1-main/logi-v1-main/quotation-extractor/app/api/extract-raw/route.ts
Core logic
Document extraction and quotation parsing pipeline
- Adobe extract · External document extraction boundary
logi-v1-main/logi-v1-main/quotation-extractor/lib/adobe-extract.ts - Parse quotation · Normalizes extracted content into quotation data
logi-v1-main/logi-v1-main/quotation-extractor/lib/parse-quotation.ts - PDF config · PDF extraction settings
logi-v1-main/logi-v1-main/quotation-extractor/lib/pdf-config.ts
Domain types
Shared quotation schema definitions
- Quotation types · Shared quotation contract
logi-v1-main/logi-v1-main/quotation-extractor/types/quotation.ts
Connections 20
- quotation-extractor → Home page: contains · Main user entry
- quotation-extractor → App shell: contains · App shell
- quotation-extractor → Global styles: uses · Global styling
- quotation-extractor → Extract API: exposes · Primary API route
- quotation-extractor → Raw API: exposes · Raw API route
- Home page → Extract API: calls · Browser workflow submits extraction requests
- Extract API → Adobe extract: uses · Document extraction step
- Extract API → Parse quotation: uses · Transforms extracted data into quotation model
- Extract API → PDF config: uses · Extraction settings
- Extract API → Quotation types: returns · Typed response contract
- Raw API → Adobe extract: uses · Raw extraction path
- Raw API → PDF config: uses · PDF handling settings
- Raw API → Quotation types: returns · Structured output shape
- Parse quotation → Quotation types: produces · Normalization target
- Quotation schema → Quotation types: mirrors · Shared domain schema representation
- Tooling → quotation-extractor: builds · Framework/runtime configuration supports the app
- Fragility plan → Parse quotation: guides · Domain-specific implementation notes
- Tech prompt → quotation-extractor: guides · Implementation guidance
- Quickstart → quotation-extractor: explains · Setup and run instructions
- Van calc → Quotation schema: relates · Adjacent domain documentation