I learned from Agile Web Development with Rails 6 by Sam Ruby and David Bryant Copeland.
- Users may browse and check the introduction of each item/ product without login
- Users may add an item to their own shopping cart after signing up and log in
- Creating a new product needs an admin user
- an admin account for testing
email: lllatia_hyatt@welch.com / password: qazwsx
- an admin account for testing
- Users may checkout their shopping cart and create an order after inputting all necessary information (payment always assumes succeeded)
- Order email address will receive a notification email, subject: 'Świat Zabawek Store Order Confirmation')
-
devisefor authentication -
sidekiqfor background processing -
shrinefor image attachment -
image_processing, through this gem I can process images with either ImageMagick/GraphicsMagick or libvips libraries. -
sendgrid-rubyintegrates Sendgrid email outbound service -
rspecreplaces mini-test -
capybaraachieves scenario tests, especially for Javascript function test -
slightly played with
activeadminto have a basic understanding about backend interface for an admin user
- local install
ruby 2.6.5[Installation Method] (https://www.ruby-lang.org/en/documentation/installation/) - local install
rails 6.0.4 - local install
postgresql - local install
yarn - local install
redis[Installing Redis] (https://redis.io/docs/getting-started/installation/)
Well, I can't share my key with the public, the AWS config can be skipped by adjusting shrine.rb to use ActiveStorage (please check rails guides), Sendgrid config can be skipped by using the letter_opener gem in the development environment.
Or, you will need to run EDITOR="vim" bin/rails credentials:edit to create a new master.key and credentials.yml.enc in your local folder.
Next, you need to generate your own account info from both sendgrid and aws. Also, save them in the below format into your rails credentials.
sendgrid:
username:
password:
email:
aws:
access_key_id:
secret_access_key:
bucket_name:
region:
- run
bundle installto install all rails gems - run
yarnto install all frontend dependecies - run
bin/rails db:createto create two local databases, depot_development and depot_test (according to config/database.yml) - run
bin/rails db:migrateto config database tables, constraints and associations according to db/schema.rb - run
bin/rails db:seedto feed the initial product, and user data for using the website immediately - run
sh booster.shthat will runredis-server,bin/webpack-dev-server,bin/rails server, andbundle exec sidekiqat the same time automatically
Voila, open localhost:3000 in your browser.