Hand-Drawn Digit Recognizer

React 18 + Vite SPA · FastAPI + PyTorch CNN · MNIST classifier (backend API v2.0.0)

A full-stack hand-drawn digit recognition app where users draw digits on a browser canvas and the React frontend sends pixel data to a FastAPI backend that classifies them using an in-process PyTorch CNN trained on MNIST. The app provides per-digit confidence scores alongside the top predicted digit.

Generated 4 Jun 2026 · 18 files · 11 components · 5 flows

File Architecture

The full source tree as a layered graph — every file with its role, imports, exports and reverse dependencies.

System Design

Runtime topology across the five zones — client, edge, application, data and external services.

Flow Graph

The five most significant application flows, step by step — startup, auth, write, read and error recovery.

Technology

ComponentTechnologyVersionSource of Detection
Frontend frameworkReact^18.2.0frontend/package.json
Build tool / dev serverVite^5.0.8frontend/package.json, vite.config.js
StylingTailwind CSS + PostCSS^3.4.1tailwind.config.js, postcss.config.js
LintESLint (react, react-hooks)^8.57.0frontend/package.json
Backend frameworkFastAPI>=0.109.0backend/requirements.txt
ASGI serverUvicorn>=0.27.0backend/requirements.txt, main.py
ML frameworkPyTorch (torch)>=2.0.0backend/requirements.txt
Dataset / visiontorchvision (MNIST)>=0.15.0backend/train.py
ValidationPydantic>=2.5.0backend/main.py (PixelData)
NumericsNumPy>=1.24.0backend/main.py
Trained artifactCNN state dictAPI v2.0.0backend/mnist_model.pth
RuntimePython (CPU PyTorch)3.14digit-recognizer/CLAUDE.md, README.md