Skip to content

iakancay/Hommy-Food-MERN

Repository files navigation

Hommy Food

1. Description

This app helps the freelance chefs to post their meals and sale them online. Our registered clients can order the meals they want or choosing a specific chef to order from according to his rate or cuisine. The guest user can have overview about our app also but with a limited permissions.

2. Usage

  • User (guest) can overview the app.
  • User can create an account and choose between a chef or client.
  • Ability to search for a meal according to the meal name, ingredients, category or cuisine.
  • Adding a specific chef to a favorite.
  • Finding the top 10 rated chefs.
  • Viewing the chef details, the service his offering (Delivery or Pickup), rating him and see his meal list.
  • Users (chef, customer) can edit thier personal profile.
  • The user can request several different meals from the same chef for one order.
  • In Delivery service, the user can change his default address at the checkout page to a different address.
  • In the Pickup service it will be showing the contact and the address of the chef.
  • Apple to pay online or cash.
  • User can check his order history.
  • Order to prepare page helps the chef to organize the orders he has.

3. Link and Preview

App view Project link is available at Hommy food App

Color guide

App color guide

4. Setup

First, to setup all the directories run the following in the main directory:

npm install

npm run setup

The first command will install cypress and some small libraries needed for running the rest of the commands. The second will go into the client and server directories and set those up to be ran.

In the client and server directory there are two .env.example files. Create a copy and rename that to .env. Then follow the instructions in those files to fill in the right values.

To run the app in dev mode you can run the following command in the main directory:

npm run dev

5. Built with

React Mongoose css stripe Express cloudinary Nodejs

6. Code structure

client
├── public
    └── images
    └── index.html
└── src
    └── __tests__
    └── __testUtils__
    └── components
        └── __tests__
        └── Banner
        └── CategoryListCards
        └── chefsSlider
        └── CuisineListButtons
        └── CustomerPersonalInfo
        └── Dropdown
        └── EditFromPopUp
        └── FavoriteChefCard
        └── Footer
        └── Header
        └── InputForm
        └── LoginForm
        └── mealCard
        └── MealList
        └── MsgPopUp
        └── OrderDetailsCards
        └── OrderHistoryCard
        └── OrdersHistory
        └── OrderToPrepareCard
        └── OrderToPrepareItem
        └── OrderToPreparePopup
        └── PersonalInfo
        └── ProfileHeader
        └── RateOfChef
        └── RatingStar
        └── SearchField
        └── ShoppingCart
        └── ShoppingCartCard
        └── UploadImgWidget
    └── contexts
        └── authentication.js
        └── msgPopup.js
    └── hooks
        └── __tests__
        └── fetchOptions.js
        └── postLoginInfo.js
        └── useFetch.js
        └── useWindowSize.js
    └── pages
        └── CheckoutPage
        └── CreateMeal
        └── EditMeal
        └── FavoritesPage
        └── Home
        └── Login
        └── MealDetailPage
        └── OrdersHistoryPage
        └── OrderToPrepare
        └── Payment
        └── ProfilePage
        └── resultPage
        └── ShoppingCart
        └── SignUp
        └── User
    └── util
    App.jsx
    App.css
    AppWrapper.jsx
    index.jsx
cypress
    └── fixtures
    └── integration
    └── plugins
    └── support
server
└── src
    └── __tests__
    └── __testUtils__
    └── controllers
        └── category.js
        └── cuisine.js
        └── favorites.js
        └── meal.js
        └── orders.js
        └── payment.js
        └── rate.js
        └── shoppingCart.js
        └── user.js
    └── db
        └── connectDB.js
    └── models
        └── Category.js
        └── Cuisine.js
        └── Meal.js
        └── User.js
    └── routes
        └── category.js
        └── cuisine.js
        └── favorites.js
        └── meal.js
        └── orders.js
        └── payment.js
        └── rate.js
        └── shoppingCart.js
        └── user.js
    └── util
        └── __tests__
        └── logging.js
        └── validateAllowedFields.js
        └── validationErrorMessage.js
    app.js
    index.js
    testRouter.js
README.md

6.1 Client structure

  • public || public facing client code.
  • __tests__ || any jest tests for specific components will be in a __tests__ folder on the same level.
  • __testUtils__ || any code that is only being used in the tests is put in the .__testUtils__ folder to separate that away from the rest of the code.
  • components || all of our shared components that are used over multiple pages.
  • hooks || all of our custom hooks.
  • pages || the page components of our app, any routing will go between these components.
  • pages/components || components used specifically on those pages.
  • util || any utility functions that can be used anywhere on the client side.
  • index.jsx || the start point of the client with providers.
  • app.jsx || storing the app routes.

6.2 Cypress structure

  • fixtures || any data/files that cypress needs can be placed here.
  • integration || all of our tests are in here, separated in folders based on the pages in our app.
  • plugins || any plugins for our cypress configuration can be placed here.
  • support || custom commands and other support files for cypress can be placed here.

6.3 Server structure

  • __tests__ || any jest tests for the api endpoints as that is our testing strategy for the backend.
  • __testUtils__ || any code that is only being used in the tests is put in the __testUtils__ folder to separate that away from the rest of the code.
  • controllers || all of our controller functions that interact with the database.
  • db || all of our configuration for the database.
  • models || all of our mongoose models will be placed here.
  • routes || code to match up the API with our controllers.
  • util || any utility functions that can be used anywhere on the server side.
  • index.js || the start point of the server.
  • app.js || creates express server and attaches the routes.

7. Stack / external libraries

The base stack of the app is a MERN stack (Mongoose, Express, React, Node). Next to that we make use of the following extras:

7.1 Configuration libraries

  • dotenv || To load the .env variables into the process environment. See docs
  • webpack / html-webpack-plugin || To bundle our React app and create a static app to host. See docs
  • husky || To run our tests and linter before committing. See docs
  • eslint || To check our code. We have different configurations for frontend and backend. You can check out the configuration in the .eslintrc.(c)js files in the respective client and server folders. See docs
  • prettier || To automatically format our code. See docs
  • concurrently || To run commands in parallel. See docs

For more information on how these work together including the automatic deployment to heroku, have a look at our detailed DEV file.

7.2 Client-side libraries

  • @testing-library/* || We use React Testing Library to write all of our tests. See docs
  • jest || To run our tests and coverage. See docs
  • jest-fetch-mock || To mock out the backend for our testing purposes. See docs
  • prop-types || To type-check our components. See docs
  • cloudinary || To help us upload images and save the url of it in database. See docs
  • emailjs || It help us creating contact form without using backend code. See docs
  • bootstrap || To help us styling our app. See docs
  • react-stripe-checkout || To connect our frontend payment data to the backend. See docs
  • swiper || It simpilize our touch slider for mobile version. see docs

7.3 Server-side libraries

  • nodemon || To automatically restart the server when in development mode. See docs
  • jest || To run our tests and coverage. See docs
  • supertest || To more easily test our endpoints. See docs
  • mongodb-memory-server || To mock out our database in our backend tests. See docs
  • cors || To open up our API. See docs
  • mongoose || To add schemas to our database. See docs
  • stripe || To allow our app online payment by using the third party payment process. See docs
  • bcrypt || Helping us hashing the passwords. see docs
  • dotenv || To Store configuration in the environment separate. see dosc
  • jsonwebtoken || To share security information between two parties (client and server). see docs

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages