This project is a full-stack web application that uses a deep learning (LSTM) model to analyze the sentiment of a movie review.
It is built with a microservice architecture, separating the web server (Node.js) from the AI model server (Python/Flask).
This application runs on three separate services:
-
Client (React + Tailwind): A frontend UI (running on
localhost:3000) that provides a textbox for the user. -
Node.js Server (Express): A backend server (running on
localhost:5000) that serves as a proxy. It receives requests from the React client and forwards them to the Python API. -
Python API (Flask): A dedicated AI server (running on
localhost:5001) that hosts the trained Keras/TensorFlow$LSTM$ model in memory and exposes a/predictendpoint.
Data Flow:
React (Port 3000) Node.js (Port 5000) Python/Flask (Port 5001)
- Frontend: React, Tailwind CSS
- Backend (Web): Node.js, Express
- Backend (AI): Python, Flask, TensorFlow/Keras
- Database: None (This project does not use MongoDB)
You must run all three services in separate terminals.
# Navigate to the Python API folder
cd python-api
# Set up and activate virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# (You should create a requirements.txt with: pip freeze > requirements.txt)
# Run the server
python app.py
# (In a new terminal)
cd node-server
# Install dependencies
npm install
# Run the server
node index.js
# (In a third terminal)
cd client
# Install dependencies
npm install
# Run the app
npm start