Skip to content

mayanksingh-GIT-CODER/ai-app-deployed-fastapi-react

Repository files navigation

SignalDesk AI — FastAPI + React

CI FastAPI React License: MIT

A deployment-ready full-stack AI application for explainable customer-support triage. It routes requests into billing, account, technical, or feedback queues; estimates urgency and sentiment; redacts common personal data; and exposes the strongest model signals instead of returning a black-box label.

Architecture

Why this project

Many AI portfolio projects stop at a notebook. SignalDesk demonstrates the complete delivery path: a trained text model, typed API, batch endpoint, responsive frontend, automated tests, Docker images, CI, and cloud deployment manifests.

Features

  • Multinomial Naive Bayes classifier trained at startup on bundled examples
  • Category confidence normalized from log probabilities
  • Transparent token-level evidence for each prediction
  • Urgency and sentiment signals with deterministic, testable rules
  • Email and payment-number redaction before display
  • Single and batch inference endpoints
  • Interactive React dashboard with example tickets and responsive design
  • FastAPI OpenAPI docs at /docs
  • Docker Compose for a two-service local environment
  • Render backend blueprint and Vercel frontend configuration

Architecture

React/Vite browser
      |
      | POST /api/v1/analyze
      v
FastAPI + Pydantic
      |
      +--> PII redaction
      +--> local Naive Bayes classifier
      +--> urgency/sentiment signals
      `--> typed explanation response

The model is deliberately local and inspectable—no API key, remote inference, or hidden cost. This keeps the demo reproducible while showing the same service boundaries used with a larger hosted model.

Repository structure

ai-app-deployed-fastapi-react/
|-- backend/app/            # API, schemas, and inference service
|-- tests/                  # API and model tests
|-- frontend/src/           # React dashboard
|-- assets/                 # architecture and portfolio visuals
|-- docs/                   # API, architecture, deployment
|-- .github/workflows/      # backend and frontend CI
|-- docker-compose.yml
`-- render.yaml

Local setup

Backend

py -3.12 -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -r backend/requirements-dev.txt
uvicorn app.main:app --app-dir backend --reload

Open http://localhost:8000/docs for interactive API documentation.

Frontend

cd frontend
Copy-Item .env.example .env
npm install
npm run dev

Open http://localhost:5173.

Docker Compose

docker compose up --build

The frontend is served at http://localhost:5173 and the API at http://localhost:8000.

API example

curl -X POST http://localhost:8000/api/v1/analyze \
  -H "Content-Type: application/json" \
  -d '{"text":"Urgent: production dashboard crashes and every user is blocked"}'
{
  "category": "technical",
  "confidence": 0.91,
  "urgency": "high",
  "sentiment": "negative",
  "redacted_text": "Urgent: production dashboard crashes and every user is blocked",
  "signals": [{"token": "crashes", "strength": 0.84}],
  "model_version": "local-nb-1.0"
}

Exact probabilities depend on the bundled training vocabulary. See the complete API contract.

Quality checks

python -m pytest tests -q
ruff check backend
cd frontend
npm ci
npm run build

CI runs all four checks on every push and pull request.

Deployment

  • render.yaml defines the FastAPI web service.
  • frontend/vercel.json defines the Vite build and SPA routing.
  • Set VITE_API_URL in Vercel to the deployed Render API URL.
  • Update ALLOWED_ORIGINS in Render to the frontend origin.

The repository is deployment-ready but does not claim a live production URL until those account-specific resources are provisioned. Follow deployment.md.

Limitations and responsible use

This compact model is a portfolio demonstration, not a production decision system. Its bundled dataset is intentionally small, confidence is not calibrated on real support traffic, and urgency rules need organization-specific validation. Human review should remain in the loop for high-impact routing.

Roadmap

  • Replace bundled samples with a versioned, anonymized dataset
  • Add calibrated confidence and out-of-distribution detection
  • Persist review corrections for supervised retraining
  • Add authentication, queue integrations, and audit logging
  • Add Playwright end-to-end coverage after deployment

Author

Mayank Singh — aspiring AI Engineer building practical, tested AI products end to end.

License

MIT

About

Explainable support triage with a typed FastAPI backend and responsive React dashboard.

Topics

Resources

License

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors