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.
-
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
To use and try out the project for yourself, follow these steps.
-
Clone the repository:
git clone https://github.com/ProTechZ/restaurant-reviews.git cd restaurant-reviews -
Setup the client folder.
cd client npm installThen create a
.envfile in this folder and paste this code:REACT_APP_API_URL=http://localhost:3001 -
Setup the server folder
cd ../server npm installThen create a
.envfile in this folder and paste this:PORT=3001 CLIENT_PORT=3000 -
Setup the fastapi-server folder with a virtual environment
cd ../fastapi-server python -m venv env env\Scripts\activate.bat pip install -r requirements.txt
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.
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!
GET /reviews/list: Fetch all reviews.
POST /reviews/add: Submit a new review β adds it to reviews.csv
POST /predict: Submit a review β returns if the review is postive/negative
