Giter Site home page Giter Site logo

tanhongit / ruby_on_rails_6_shop Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 3.0 69.35 MB

Agile Web Development with Rails 6 & React. You can try it at https://rails6shop.herokuapp.com/

Home Page: https://rails6shop.herokuapp.com/

License: GNU General Public License v3.0

Ruby 56.81% JavaScript 23.16% HTML 14.38% SCSS 5.65%
rails tanhongit tanhongit-cart rails-application shop rails-applications ecommerce-application ruby rails-shop shopping-cart

ruby_on_rails_6_shop's Introduction

Welcome to ecommerce Application Rails 6 by TANHONGIT

Create the ecommerce application implementation using Ruby on Rails 6.

Demo

You can try it at https://rails6shop.herokuapp.com/

Account login on Backend

user :
    username: tanhong1     | password: tanhong1

1. Technology

  • Ruby on Rails

2. Configuration requirements

We are going to build the web application using:

  • Rails 6.0.3.2
  • Ruby 2.7.1

3. Feature

1. Product Manager
2. Using a Helper to Format the Price
3. Create cart 
4. Ajax-Based Cart
5. Check Out Order 
6. Login, Logout, Authenticating Users, User Manager 
7. Internationalization
8. Receive Emails and Respond with Rich Text
9. Pagination, Search
...

4. Runing

4.1. Clone Repo

$ git clone https://github.com/TanHongIT/ruby_on_rails_6_shop
$ cd ruby_on_rails_6_shop

4.2. Bundle Install

$ bundle install

4.3. Yarn Install

$ yarn install

4.4. Create database with Postgresql

You must change the appropriate database configuration

Change configuration at "config/database.yml" with Postgresql.

default: &default
  adapter: postgresql
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
  timeout: 5000
  username: ruby_on_rails_6_shop
  password: 1234
  host: localhost

# tutorial for ubuntu linux:
# sudo -u postgres psql
# create user "ruby_on_rails_6_shop" with password '1234';  
# create database "ruby_on_rails_6_shop" owner "ruby_on_rails_6_shop"; 

development:
  <<: *default
  database: ruby_on_rails_6_shop_6

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  <<: *default
  database: ruby_on_rails_6_shop_test

production:
  <<: *default
  database: ruby_on_rails_6_shop_production

You must change the username, password and database name accordingly!

4.5. run rails db:migrate

$ rails db:migrate
$ rails db:migrate RAILS_ENV=development

4.6. Change your mail for mailing function

4.6.1 Run console :

$ bundle exec figaro install

4.6.2 Go to config directory and add to file "config/application.yml"

user_mail: '[email protected]'
user_password: 'your password'

4.6.3 Change your mail in app/mailers/application_mailer.rb

class ApplicationMailer < ActionMailer::Base
  default from: 'change_your_mail'
  layout 'mailer'

4.6.4 Change your mail in app/mailers/order_mailer.rb

class OrderMailer < ApplicationMailer
  default from: 'Tan Hong <[email protected]>'

4.6.5 Change your mail in app/mailers/support_request_mailer.rb

 
class SupportRequestMailer < ApplicationMailer

  # Subject can be set in your I18n file at config/locales/en.yml
  # with the following lookup:
  #
  #   en.support_request_mailer.respond.subject
  #
  default from: "[email protected]"

4.6. Change your mail in app/mailboxes/application_mailbox.rb

class ApplicationMailbox < ActionMailbox::Base
  routing "[email protected]" => :support
end

4.7. Install Webpacker

$ bundle exec rake webpacker:install

4.8. Load data into database

We use loop to load data into database, run the following commands in turn:

$ rails runner bin/create_dummy_orders.rb
$ rails runner bin/create_dummy_products.rb
$ rails runner bin/create_dummy_users.rb

4.9. Run server

$ rails s

5. User Login

Account login on Backend

user :
    username: tanhong1     | password: tanhong1

Support for me

Support this project ๐Ÿ˜œ ๐Ÿ™

PayPal buymeacoffee TanHongIT

ruby_on_rails_6_shop's People

Contributors

dependabot[bot] avatar tanhongit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.