This project is a web application that allows restaurants to view and reply to customer reviews. Users can log in using Google OAuth. The frontend is built with React, and the backend is implemented with Express.js. Axios is used for communication between the frontend and backend.
- Google OAuth Authentication: Users log in via their Google account.
- View Reviews: Restaurants can view customer reviews.
- Reply to Reviews: Restaurants can post replies to customer reviews.
- Secure Login: Authentication is managed securely with Google OAuth.
- Seamless Frontend-Backend Integration: Axios is used for API communication.
- React
- Axios
- CSS Modules
- React Router (for navigation)
- Express.js
- MongoDB (for storing reviews and replies)
- Passport.js (for Google OAuth)
- npm (for package management)
- Concurrently (for running frontend and backend simultaneously)
- Node.js and npm installed on your system.
- MongoDB instance running locally or a cloud-based MongoDB cluster.
- Google Cloud Console account with a configured OAuth 2.0 Client ID.
-
Clone the Repository
git clone https://github.com/SyedFaisal30/RestReview.git cd google-portal-reviews -
Setup Backend 🛡️
- Navigate to the
backendfolder:cd backend - Install dependencies:
npm install
- Create a
.envfile and add the following variables:PORT=5000 MONGO_URI=your-mongodb-connection-string GOOGLE_CLIENT_ID=your-google-client-id GOOGLE_CLIENT_SECRET=your-google-client-secret
- Start the backend server:
npm start
- Navigate to the
-
Setup Frontend 🌄
- Navigate to the
frontendfolder:cd ../frontend - Install dependencies:
npm install
- Start the frontend development server:
npm run dev
- Navigate to the
-
Run Both Servers Simultaneously 🚀
- Navigate back to the root folder and run both servers using Concurrently:
npm install -g concurrently concurrently "npm run dev --prefix frontend" "npm start --prefix backend"
- Navigate back to the root folder and run both servers using Concurrently:
src/components: Contains React components such as Login, Reviews, and ReplyForm.
routes/auth.js: Manages authentication routes using Passport.js.routes/userRoute.js: Handles user and review related endpoints.
POST /auth/google: Initiates Google login.GET /auth/google/callback: Handles Google OAuth callback.GET /auth/logout: Logs out the user.
The following environment variables are required:
| Variable | Description |
|---|---|
PORT |
Port number for the backend server |
MONGO_URI |
MongoDB connection string |
GOOGLE_CLIENT_ID |
Google OAuth Client ID |
GOOGLE_CLIENT_SECRET |
Google OAuth Client Secret |
- Log in to the application using your Google account.
- View the list of reviews for your restaurant.
- Post replies to reviews directly from the dashboard.
npm run dev: Starts the React development server.
npm start: Starts the Express server.
concurrently: Runs both frontend and backend simultaneously.
For deployment, you can use services like Heroku, Vercel, or AWS. Make sure to set the environment variables on the hosting platform and adjust the MongoDB URI and OAuth redirect URIs accordingly.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please fork the repository and submit a pull request for any feature or bug fix.
For any queries or issues, please contact:
- Name: Syed Faisal Abdul Rahman Zulfequar
- Email: sfarz172320@gmail.com
Happy coding! 🚀