Restaurant reviews web application - A full stack project in Javascript based on React frontend, and Express on top of Node in the backend using MongoDB and Mongoose.
Design: There are 13 types of components in the implementation.
Main components:
- App: The main component, holds fields related to the application mode such as isConnected and isLoaded.
- TopBar: The app menu, has the following tabs: Login and Register - when the user is not connected. Restaurants, My Reviews, Users, Profile, Logout - when the user is connected.
User components:
- Login: Checks for correct combination of username and password that exists in the DB.
- Register: Includes fields the user must fill in order to sign up the system. The username must be unique - one that is not occupied by another user.
- Profile: Allows the user change his username and location.
- UserForm: A template for the login, register and profile screens.
- Users: Displays the information about all the users in the system, allows searching by name, username or location.
Restaurant components:
- Restaurants: Displays all the restaurants in the system and their details.
- AddRestaurant: Allows to add a restaurant to the restaurants list. Each restaurant has a unique combination of name and location.
- SearchRestaurants: Allows to search restaurants by name, location, score or closer-better scale.
Review components:
- UserReview: Displays all reviews of a specific user.
- CreateModifyReview: Allows the user to add a restaurant review or modify an existing review. Adding a review occurs on the specific restaurant's reviews page. Modifying a review occurs on the "My Reviews" page.
- Reviews: Displays reviews of a specific restaurant, allows sorting reviews by date or score.
To start the server:
- Start mongodb using mongod
- node src\server\server.js # backend
- npm run dev # frontend
Mongoose Models:
UserModel = id: String, firstName: String, lastName: String, username: String, password: String, location: {city: String, x: Number, y: Number}, picture: { pictureType: String, pictureData: String }
ReviewModel = categories: { bathroomQuality: Number, staffKindness: Number, cleanliness: Number, driveThruQuality: Number, deliverySpeed: Number, foodQuality: Number, }, pic1: { pictureType: String, pictureData: [], }, pic2: { pictureType: String, pictureData: [], }, restaurantId: String, userId: String, date: Date, image: {imageType: String, imageData: String}, average: Number
RestaurantModel = name: String, location: {city: String, x: Number, y: Number}, reviewsAverage: Number, isDelivery: Boolean, isDriveThru: Boolean
LocationsModel = cities: [{ city: String, x: Number, y: Number }]
Extra libraries:
- Semantic-ui React.
- PrimeReact.