Skip to content

πŸ›οΈπŸ‘ž E-commerce website built as a training project

License

Notifications You must be signed in to change notification settings

maxbarsukov/shoeshop

Repository files navigation

Build Status Coverage Status Security GuardRails badge Dependabot

ShoeShop

A simple yet fully functional web-shop application built with Ruby on Rails

This app is a store with features close to the real ones.

The user can add products to the cart and buy, navigate by categories and brands, search, filter and sort products. The administrator is able to manage products, add and change them, and also has access to the API and the administrator page.

You can go to the website or view the images in the docs/images folder

Functionality included

  • Sign up / sign in / forgot password
  • Sign in with Facebook
  • Filter products by categories and brands
  • Add products to the shopping cart
  • Search for products using auto-completion
  • View related and recent products
  • Product's pagination
  • Use app's API if the administrator has given you UID and secret
  • Admin Page
  • OAuth 2 provider

About the code

  • Built with Ruby on Rails 5
  • Using Boostrap 3 and own stylesheets for styles
  • Devise as authentication solution
  • Pundit for authorization
  • Pagy for pagination
  • rails_admin for admin page
  • HAML as templating engine for HTML
  • CoffeeScript instead of JS in scripts
  • Using jQuery and plugins: easydropdown, responsiveslides, simpleCart, typeahead, etc.
  • meta-tags for SEO optimization
  • OmniAuth provides authentication using third-party credentials
  • Doorkeeper as OAuth 2 provider and API authenticator
  • API built with jbuilder and active_model_serializers
  • acts-as-taggable-on for filtering products by tags
  • rack-attack as middleware for throttling and blocking abusive requests
  • TDD with RSpec + ShouldaMatchers + FactoryBot + etc. (over 110 tests)
  • Profiling and optimization tools:
    • Bullet as N+1 problem profiler
    • active_record_doctor helps to keep the database in a good shape
  • Code quality scanners: rails_best_practices, rubocop, rubycritic, brakeman
  • CI/CD
    • Travis CI
    • Coveralls.io for test coverage history & statistics
    • Hakiri.io & GuardRails.io as security vulnerabilities scanner
  • Docker & docker-compose

Setup

Clone this repository:

git clone [email protected]:maxbarsukov/shoeshop.git

Install gems:

bundle install

Setup database and seeds:

bundle exec rails db:create db:migrate db:seed

Setup your test database:

bundle exec rails db:test:prepare

Run

With Foreman:

  • Dev: foreman start
  • Production: foreman start -f Procfile

Using Docker: docker-compose up

Testing

Run tests with rspec

Check security vulnerability with bundle exec brakeman --exit-on-warn -f plain -5

Check the quality of code with bundle exec rails_best_practices . --spec -c config/rails_best_practices.yml

Run bundle exec rubycritic for code quality reporter

License

MIT License. Copyright 2021 nyapsilon