DocIntelligence

Upload a PDF or text file and get its key details pulled out (name, date, amount and entities), highlighted in the text, then ask questions about it in a chat.

Role
Solo: design, frontend and backend
Built
June 2026
Hosting
Vercel (frontend), Render (backend)

Why I built it

I wanted to see how far an LLM could take the boring part out of reading contracts, invoices and reports just to find a few specific details.

How it works

  • Uploads return straight away and processing runs in the background. The UI polls the document and shows each step: parse, extract, embed, ready.
  • pdf-parse reads PDFs. Groq's Llama 3 8B then extracts the name, date, amount, entities and any other useful fields as JSON, at temperature 0 so results stay consistent.
  • With no Groq key, or if the call fails, a regex extractor finds the name, date, amount, invoice number, email and phone, so a document never gets stuck.
  • The viewer highlights every extracted value in the text, and clicking a field scrolls to it.
  • Chat sends the extracted fields, the start of the document and the last 10 messages, and the prompt tells the model to answer only from the document.
  • A dashboard charts file types and processing status with Chart.js and lists the top keywords.

Decisions and trade-offs

  • Angular standalone components, all with OnPush change detection, and every route lazy-loaded.
  • Search uses a small 128-dimension vector hashed from words and word pairs, compared with cosine similarity. It's cheap and deterministic, but closer to keyword matching than true semantic embeddings, and for now it's only exposed through the API.
  • Documents are kept in memory and saved to a JSON file on shutdown. Fine for a demo, not a database.
  • Uploads are limited to .pdf and .txt files up to 10 MB.

Testing and deployment

73 Jest and Supertest tests cover the backend, with an 80% line-coverage threshold, and 54 Karma tests cover the frontend. A GitHub Actions workflow runs both, builds the app, and deploys the frontend to Vercel and the backend to Render. Dockerfiles run the server as a non-root user and serve the frontend from nginx.

Stack

Angular 17 · TypeScript · Chart.js · Node.js · Express · pdf-parse · Groq (Llama 3 8B) · Jest · Docker · GitHub Actions