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.

A stack where every tool has a clear responsibility.

The architecture for AI Text Classifier was shaped around the product workflow, integration boundaries and long-term maintainability. Technologies are used for specific responsibilities rather than added only to make the stack appear larger.

Experience2 tools

React

Builds reusable, state-driven interfaces and keeps complex user journeys organized into maintainable components.

Vite

Provides a fast development server and optimized production bundling for the client application.

Services & integration2 tools

Node.js

Runs the server-side JavaScript services, integration logic and non-blocking application workflows.

Express

Defines focused HTTP routes, middleware, validation and consistent REST API responses.

Data2 tools

MongoDB

Stores flexible application records and supports evolving product data without rigid table structures.

Mongoose

Adds schemas, validation and model-level consistency to MongoDB persistence workflows.

Intelligence2 tools

Ollama

Runs the language model used for local, controlled AI inference and structured classification output.

LangChain

Organizes prompts and model calls behind a reusable service layer that can evolve independently.

Cloud & delivery2 tools

Vercel

Hosts the web experience and serverless endpoints with repeatable deployment from source control.

Cloudflare Tunnel

Creates a protected route from the deployed API to the Ollama runtime without exposing local network ports.

Clear boundaries

Interface, business logic, persistence and external services remain separated so changes are easier to reason about.

Defensive data handling

Validation and predictable contracts protect downstream workflows from incomplete or unexpected input.

Deployment-aware design

Runtime limits, secrets, external dependencies and failure paths are considered as part of the implementation.

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