Back to portfolio

AI engineering case study

Every message,
understood.

A full-stack classification service that turns unstructured customer text into a reliable category and confidence score through a clean REST API.

AI Text Classifier interface showing the message classification form
4CategoriesRESTIntegration0-1Confidence3/3Tests passing

Customer messages arrive without structure.

Support teams receive complaints, questions, feedback and unrelated messages in the same stream. Manual triage slows response time and creates inconsistent routing. This project provides a small, integration-ready service that applies one shared classification policy to every message.

A focused path from input to insight.

01

React client

Captures customer text and displays the category with a visual confidence score.

02

Express API

Validates requests and exposes a focused POST /api/classify endpoint.

03

Ollama model

Uses llama3.2:3b with a deterministic prompt and strict JSON output.

04

MongoDB

Optionally stores successful classifications through Mongoose.

POST /api/classifyJSON
{
  "text": "My order arrived damaged."
}

{
  "category": "Complaint",
  "confidence": 0.96
}

One endpoint.
Predictable output.

The API accepts a text string, validates it, invokes the model service and normalizes the response. Consumers always receive an allowed category and a confidence value between zero and one.

Check API health

AI output treated as untrusted input.

Allow-listed categories

Model output is matched case-insensitively against Complaint, Query, Feedback and Other.

Bounded confidence

Numeric confidence is clamped to the valid 0-1 range, with a documented fallback.

Defensive validation

Empty text and payloads over 5,000 characters return clear HTTP 400 responses.

Optional persistence

The classifier remains available when MongoDB is not configured or connected.

ReactViteNode.jsExpressMongoDBMongooseOllamaLangChainVercelCloudflare Tunnel

Built, tested and documented.

Responsive React testing interface

Layered controller, route and service structure

Automated API and normalization tests

Postman collection and environment examples

Vercel serverless deployment configuration

Detailed local and production setup guide

Explore the working product

Classify your first
message.

Launch live demo GitHub repository