August 2017 Craft Academy Course Project
An app which allows users to order food from various restaurants nearby.
Visit the Ufoods site. You will see restaurants nearby as markers on a map, and you may choose what range you want to search for restaurants in. You can choose a restaurant category, then a restaurant, then a menu, and then you can view different dishes. You sign up by creating an account with an email and password. After logging in you will be allowed to add dishes to order. On checkout you can choose delivery and pay with Stripe.
Visit the admin login site. You can sign up and get your restaurant registered. Once you've done that you can add info, menus and dishes.
Visit the admin login site. You can perform CRUD actions on all objects in the system. You are the one that registers Restaurant Owners and Restaurants.
Change the current working directory to the location where you want the cloned directory to be made.
$ git clone https://github.com/CraftAcademy/ufoods
- ruby 2.4.0
- ruby rails 5.1.4
Ensure that the gem versions on your local machine are as specified in the Gemfile. Run bundle install to install dependencies.
Run rake to see all the tests pass.
It runs automated acceptance tests written in a behavior-driven development (BDD) style. Central to the Cucumber BDD approach is its plain language parser called Gherkin. It allows expected software behaviors to be specified in a logical language that customers can understand.
Cucumber example:
Feature: user can see dishes and their info
As a user
In order to get food
I would like to see a list of dishes and info about them
Background:
Given the following dishes exists
| name | description | price | pic_url |
| Sushi rolls | Tasty Japanese food | 10 | https://goo.gl/fH7P5F |
Scenario: user can view dish names
Given I visit the dish page
Then I should see the text "Sushi rolls"
And I should see the text "Tasty Japanese food"
And I should see the text "10"
And I should see the picture "https://goo.gl/fH7P5F"
It is a behavior-driven development (BDD) framework which is extensively used in the production applications. The basic idea behind this concept is that of Test Driven Development(TDD) where the tests are written first and the development is based on writing just enough code that will fulfill those tests followed by refactoring.
Rspec example:
RSpec.describe Dish, type: :model do
describe 'DB table' do
it { is_expected.to have_db_column :name }
it { is_expected.to have_db_column :description }
it { is_expected.to have_db_column :price }
it { is_expected.to have_db_column :pic_url }
end
describe 'Validations' do
it { is_expected.to validate_presence_of :name }
it { is_expected.to validate_presence_of :description }
it { is_expected.to validate_presence_of :price }
it { is_expected.to validate_presence_of :pic_url }
end
describe 'Factory' do
it 'should be valid' do
expect(FactoryGirl.create(:dish)).to be_valid
end
end
end
We automatically deploy this app with Heroku through Github and Semaphore.
- Rails
- Acts_as_a_shopping_cart
- Gmaps.js
- Active Admin
- CanCanCan
- Devise
- Bootstrap-sass
- Geocoder
- Faker
- Haml-rails
- Rspec-rails
- Shoulda-matchers
- Factory_girl_rails
- Cucumber-rails
- Coveralls
- Database_cleaner
- Launchy
- Poltergeist
MIT license
The entire project is comprised of open source code so a huge THANKS to the open source community. Built with help from the coaches and some cool gems.