# Built a Sentiment Analysis Web App – My First Full-Stack ML Project

> Source: <https://dev.to/nasirovelchin/built-a-sentiment-analysis-web-app-my-first-full-stack-ml-project-35f8>
> Published: 2026-05-27 05:21:07+00:00

Hey dev.to 👋

After spending a month learning Machine Learning through Andrew Ng’s specialization, I wanted to build something real — not just notebooks.

So I created a **Sentiment Analysis Web App** — a full-stack project that takes any text and predicts whether it's **Positive** or **Negative**.

###
What I Built

-
**Frontend**: React with clean, modern UI
-
**Backend**: Flask API
-
**ML Model**: Random Forest using Scikit-Learn + TF-IDF
-
**Features**: Real-time prediction, confidence score, prediction history

###
Tech Stack

- React (frontend)
- Flask + Flask-CORS (backend)
- Scikit-Learn (RandomForestClassifier)
- TF-IDF Vectorizer for text processing

###
What I Learned

-
**From theory to practice** — Going from notebooks to a real web app was the biggest leap.
-
**Connecting frontend and backend** — Handling API calls, CORS, and state management.
-
**Model limitations** — Small training data leads to bias. I learned the hard way why pre-trained models or larger datasets matter.
-
**Full-stack thinking** — ML is not just about the model. Deployment, UI/UX, and user experience are equally important.

###
Challenges I Faced

- Version conflicts between Colab and local environment
- Model bias toward "Positive" predictions

###
Project Structure

sentiment-analysis/

├── backend/ # Flask API + ML model

│ ├── app.py

│ ├── train_model.py

│ └── sentiment_model.pkl

│

└── frontend/ # React application

├── src/

└── package.json

**GitHub Repo**: You can check out the full project here:

[machine-learning-projects](https://github.com/ElchinNasirov/machine-learning-projects)

(Go to `projects/sentiment-analysis/`

folder)

###
How to Run Locally

cd backend

python3 train-model.py

python3 app.py

cd frontend

npm start

###
What's Next?

I’m continuing to study ML and will be sharing more projects:

- Image classification
- Recommendation systems
- More full-stack ML apps

If you're also learning ML, I'd love to hear your journey in the comments!
