This project uses a 3-service architecture:
apps/web-react: React frontend (Vite)apps/api-node: Node.js API gateway (Express)apps/ml-fastapi: FastAPI NLP inference service (PyTorch + NLTK)
- Frontend sends chat message to
POST /api/chaton Node. - Node forwards the request to FastAPI
POST /chat. - FastAPI runs model inference and returns response.
apps/
web-react/
api-node/
ml-fastapi/
docker-compose.yml
README.md
- Node.js 20+
- Python 3.12+ (or compatible with your environment)
- npm
- Optional: Docker Desktop
Open 3 terminals.
- Start FastAPI ML service:
cd apps/ml-fastapi
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000- Start Node API service:
cd apps/api-node
npm install
copy .env.example .env
npm run dev- Start React frontend:
cd apps/web-react
npm install
copy .env.example .env
npm run devOpen http://localhost:5173.
docker compose up --buildThen open http://localhost:5173.
- FastAPI:
GET http://localhost:8000/health - Node API:
GET http://localhost:4000/health
- Node chat endpoint:
POST http://localhost:4000/api/chat - FastAPI chat endpoint:
POST http://localhost:8000/chat
- NLP model assets are stored in
apps/ml-fastapi/assets/. - Environment templates are provided as
.env.examplein each app where needed.