Skip to content

This project focuses on Sentiment Analysis as part of an assignment for the Fundamentals of Cloud Technologies course. The objective is to develop a functional web application, analyze user input for sentiment (positive, neutral, or negative), and later containerize the application using Docker.

Notifications You must be signed in to change notification settings

dmytro-varich/Sentiment-Analysis-Web-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🙂 Sentiment Analysis Web App

This project is a web application for sentiment analysis of user input sentences. It is part of the Fundamentals of Cloud Technologies course assignment, where the task was to deploy a local web application in Docker, consisting of at least two services (containers). These services must run on separate ports, be deployed in different containers, and exchange data between them. The backend service performs sentiment analysis on user-submitted sentences, while the frontend provides a user interface to interact with the web application.

apple-touch-icon

🗂️ Project Structure

sentiment-analysis-web-app/
│── backend/ 
│   ├── main.py            # Code for the web application (Backend)
│   ├── requirements.txt   # Required dependencies 
│   ├── Dockerfile         # Docker image for the backend service
│   ├── .dockerignore      # Specifies ignored files for the backend 
│── frontend/ 
│   ├── favicon/           # Favicon images for the frontend
│   ├── index.html         # HTML file for the user interface
│   ├── style.css          # CSS file for styling the frontend
│   ├── script.js          # JavaScript to handle frontend logic
│   ├── Dockerfile         # Docker image for Nginx (Frontend)
│   ├── .dockerignore      # Specifies ignored files for the frontend
│── docker-compose.yml     # Docker Compose file for orchestrating containers
│── .env                   # File with environment variables
│── start-app.sh           # Script to start the application
│── end-app.sh             # Script to stop the application
│── README.md              # Project documentation

🛠️ Tech Stack:

  • Frontend: HTML, CSS, JavaScript.
  • Backend: Python, FastAPI, NLTK, Uvicorn.
  • Deployment: Docker, Docker Compose.

🎥 Demo Video

demo-video.mp4

🐳 Docker Usage

  1. Navigate to the project's root directory using the command:

    cd sentiment-analysis-web-app
  2. To start the backend and frontend containers, run the startup script:

    ./start-app.sh 
  3. Verify that both containers are running by executing:

    docker container ls

    You should see two containers — one for the backend and one for the frontend:

    CONTAINER ID   IMAGE                                 COMMAND                  CREATED              STATUS              PORTS                    NAMES
    956badf9265f   sentiment-analysis-web-app-frontend   "/docker-entrypoint.…"   About a minute ago   Up About a minute   0.0.0.0:8080->80/tcp     sentiment-analysis-web-app-frontend-1
    a7dc3ea44d15   sentiment-analysis-web-app-backend    "uvicorn main:app --…"   About a minute ago   Up About a minute   0.0.0.0:8000->8000/tcp   sentiment-analysis-web-app-backend-1
    
  4. Access the application in a web browser:

    You can modify the FRONTEND_URL and BACKEND_URL environment variables in the .env file to change the addresses for the frontend and backend, respectively.

  5. To enter a running container, use:

    docker exec -it <container-name> /bin/sh
  6. To stop and remove the containers, run:

    ./end-app.sh

🌐 Deployment

For demonstration purposes, the web application has been deployed for free on the Railway server, without the need to run the project locally or use Docker Compose. You can access it at the following URL: https://sentiment-analysis-web-app-production.up.railway.app/. Please note that this deployment will be available for an indefinite period, subject to Railway's free-tier limits.

🧑🏻 Author

Dmytro Varich is the creator of this application. You can learn more about his projects on his personal Telegram channel, as well as connect with him via LinkedIn (dmytro-varich) and email ([email protected]).

About

This project focuses on Sentiment Analysis as part of an assignment for the Fundamentals of Cloud Technologies course. The objective is to develop a functional web application, analyze user input for sentiment (positive, neutral, or negative), and later containerize the application using Docker.

Topics

Resources

Stars

Watchers

Forks