Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/protechz/restaurant-reviews
Let's you post your review about a fictional restaurant 😋🍽️
https://github.com/protechz/restaurant-reviews
expressjs fastapi nlp nltk nodejs react restaurant-website review-website sentiment-classification tailwindcss typescript
Last synced: about 1 month ago
JSON representation
Let's you post your review about a fictional restaurant 😋🍽️
- Host: GitHub
- URL: https://github.com/protechz/restaurant-reviews
- Owner: ProTechZ
- Created: 2024-08-28T09:06:03.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-09-26T06:35:47.000Z (about 2 months ago)
- Last Synced: 2024-09-28T12:40:14.669Z (about 2 months ago)
- Topics: expressjs, fastapi, nlp, nltk, nodejs, react, restaurant-website, review-website, sentiment-classification, tailwindcss, typescript
- Language: Jupyter Notebook
- Homepage:
- Size: 294 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Restaurant Reviews Website
This is a full-stack web application that allows users to leave and view reviews for a fictional restaurant, as well as see other reviews. It uses an NLP model to determine if the review is positive or negative.
## Table of Contents
- [Tech Stack](#tech-stack)
- [Setup](#setup)
- [Running the project](#running-the-project)
- [Usage](#usage)
- [API Endpoints](#api-endpoints)
## Tech Stack
- **Frontend:**
- React with Typescript
- TailwindCSS for styling
- Zustand for state management- **Backend:**
- Node.js with Express (TypeScript)
- fast-csv for parsing the data- **FastAPI Server** (Python) so the model can be accessed
- **NLP Model:**
- nltk for parsing the data
- sklearn (MultinomialNB) for the model- **Database:** static review data in csv file
- **Package Manager:** npm, pip
## Setup
To use and try out the project for yourself, follow these steps.
1. Clone the repository:
```bash
git clone https://github.com/ProTechZ/restaurant-reviews.git
cd restaurant-reviews
```2. Setup the client folder.
```bash
cd client
npm install
```Then create a `.env` file in this folder and paste this code:
```
REACT_APP_API_URL=http://localhost:3001
```3. Setup the server folder
```bash
cd ../server
npm install
```
Then create a `.env` file in this folder and paste this:```
PORT=3001
CLIENT_PORT=3000
```4. Setup the fastapi-server folder with a virtual environment
```bash
cd ../fastapi-serverpython -m venv env
env\Scripts\activate.batpip install -r requirements.txt
```
## Running the project
Create 3 new terminals, and make sure they are in the root directory (restaurant-reviews). Then run `npm run client` , `npm run server` and `npm run fastapi` respectively.
If you do want to modify the express server code, make sure to run `npm run tsc` as well. This ensures that the changes will be compiled and converted into regular JS.
## Usage
Navigate to http://localhost:3000 to view the website.
Click the **Leave Review** button to leave your own review. An NLP model which try to predict if your review is positive or negative. If it is negative, it will take you to a feedback form asking what we can do better!
## API Endpoints
#### 1. Express Server (Port 3001)
*GET* /reviews/list: Fetch all reviews.*POST* /reviews/add: Submit a new review → adds it to reviews.csv
#### 2. FastAPI Server (Port 8000)
*POST* /predict: Submit a review → returns if the review is postive/negative