Code Monkey home page Code Monkey logo

fooddotcom's Introduction

Food.com

Food.com is a clone of Seamless.com. Why the name Food.com? Because it's a simpler, more basic version of Seamless, obviously. It allows users to find local restaurants near them, view menus, place orders and write reviews. See it live here. For comparison, check out Seamless here.

Technical Structure

Food.com is built in Rails with a PostgreSQL database. Data requests are made with AJAX and return JSON responses using JBuilder. The frontend is built with React.js components and Redux state management.

Features

User Auth

Food.com uses BCrypt for hashing and checking passwords. Plain text passwords are never stored in the database.

Restaurant Search

The restaurant search feature requires the application the navigate the Google Maps API (pun most definitely intended). There are two main components:

  1. Receiving an address via user input and geocoding it.
  2. Returning a filtered list of restaurants that are in range.

Receiving the address is not as simple as adding an input field and button. The application needs some control over the format of the address in order to geocode it correctly. Thus, I used the Google Autocomplete API to present users with a dropdown list of matching (and well-formatted) addresses to choose from. Once the address is entered The Ruby Geocoder gem allows form returning restaurants within a chosen radius. Food.com only returns resturants one mile away from the user or closer.

Search Dropdown

Filters

Filter restaurant search results by rating, price and delivery fee (and more filter options to come!) In order to implement this feature, the application must track which filters are active, keep a list of currently filtered restaurants and know when to show the filtered list versus the total list.

Menus

Menus are complicated. Every restaurant has menu items. Each item has option sections that can be required or optional. Each option section has multiple options. Users may add items to their orders, edit items, remove items or empty their bag and remove all items at once and they may take all of those actions with options as well.

Menu Item Modal

Ordering

Users must be logged in to proceed to the checkout page. If they are not logged in, they are prompted to do so. Credit card fields are only present to mimic the Seamless layout, but are not necessary to complete an order. The order, every item in the order and every option for every item is saved to its respective database table with a single AJAX request.

Order Confirmations

After ordering, users may choose to receive an email order confirmation. Gmail mail servers are used in conjunction with Rails ActionMailer and .erb email views. A text-only version of the email is also available for email clients that only accept text formats.

Reviews

After ordering, users are prompted to review the restaurant. Reviews are displayed at the bottom of restaurant menu pages and are listed in order of recency.

Reviews

UI

All modals are custom-built without use of external libraries. All pages, while created exclusively for laptop/desktop browsers, are built to expand and contract gracefully to provide a good experience on most screen sizes.

Future

Upcoming features include:

  1. Menu item customization (add toppings, etc.)
  2. Email order confirmations.
  3. Restaurant sorting by rating, price and distance.
  4. User profiles โ€“ Order histories.
  5. User profiles โ€“ Saved addresses.

fooddotcom's People

Contributors

numie avatar leebrian7799 avatar cameronmcinnes avatar dkvng avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.