├── log └── .keep ├── storage └── .keep ├── tmp ├── .keep ├── pids │ └── .keep └── storage │ └── .keep ├── vendor └── .keep ├── lib ├── assets │ └── .keep ├── tasks │ └── .keep └── templates │ └── erb │ └── scaffold │ └── _form.html.erb ├── public ├── favicon.ico ├── apple-touch-icon.png ├── apple-touch-icon-precomposed.png ├── robots.txt ├── 500.html ├── 422.html └── 404.html ├── test ├── helpers │ └── .keep ├── mailers │ └── .keep ├── models │ └── .keep ├── system │ └── .keep ├── controllers │ └── .keep ├── integration │ └── .keep ├── fixtures │ └── files │ │ └── .keep ├── application_system_test_case.rb ├── channels │ └── application_cable │ │ └── connection_test.rb └── test_helper.rb ├── app ├── assets │ ├── builds │ │ └── .keep │ ├── images │ │ ├── .keep │ │ ├── profile.png │ │ └── undraw_profile.svg │ ├── stylesheets │ │ ├── devise.scss │ │ ├── admin.scss │ │ └── application.bootstrap.scss │ └── config │ │ └── manifest.js ├── models │ ├── concerns │ │ └── .keep │ ├── application_record.rb │ ├── category.rb │ ├── address.rb │ ├── product.rb │ └── user.rb ├── controllers │ ├── concerns │ │ └── .keep │ ├── admin │ │ ├── home_controller.rb │ │ ├── base_controller.rb │ │ ├── products_controller.rb │ │ └── categories_controller.rb │ ├── home_controller.rb │ ├── application_controller.rb │ ├── addresses_controller.rb │ └── settings_controller.rb ├── views │ ├── layouts │ │ ├── mailer.text.erb │ │ ├── shared │ │ │ └── _flash.html.erb │ │ ├── store │ │ │ ├── _footer.html.erb │ │ │ ├── _user_signed_in.html.erb │ │ │ └── _nav.html.erb │ │ ├── admin │ │ │ ├── _footer.html.erb │ │ │ ├── _sidebar.html.erb │ │ │ └── _topbar.html.erb │ │ ├── mailer.html.erb │ │ ├── application.html.erb │ │ ├── admin.html.erb │ │ └── devise.html.erb │ ├── devise │ │ ├── shared │ │ │ ├── _button_submit.html.erb │ │ │ ├── _error_messages.html.erb │ │ │ └── _links.html.erb │ │ ├── mailer │ │ │ ├── password_change.html.erb │ │ │ ├── confirmation_instructions.html.erb │ │ │ ├── unlock_instructions.html.erb │ │ │ ├── email_changed.html.erb │ │ │ └── reset_password_instructions.html.erb │ │ ├── unlocks │ │ │ └── new.html.erb │ │ ├── confirmations │ │ │ └── new.html.erb │ │ ├── passwords │ │ │ ├── new.html.erb │ │ │ └── edit.html.erb │ │ ├── sessions │ │ │ └── new.html.erb │ │ └── registrations │ │ │ ├── edit.html.erb │ │ │ └── new.html.erb │ ├── admin │ │ ├── products │ │ │ ├── edit.turbo_stream.erb │ │ │ ├── new.turbo_stream.erb │ │ │ ├── show.html.erb │ │ │ ├── new.html.erb │ │ │ ├── edit.html.erb │ │ │ ├── _product.html.erb │ │ │ ├── _form.html.erb │ │ │ ├── _form_modal.html.erb │ │ │ └── index.html.erb │ │ ├── categories │ │ │ ├── edit.turbo_stream.erb │ │ │ ├── new.turbo_stream.erb │ │ │ ├── _category.html.erb │ │ │ ├── show.html.erb │ │ │ ├── edit.html.erb │ │ │ ├── new.html.erb │ │ │ ├── _form.html.erb │ │ │ ├── _form_modal.html.erb │ │ │ └── index.html.erb │ │ └── home │ │ │ └── index.html.erb │ ├── settings │ │ ├── _menu.html.erb │ │ ├── password.html.erb │ │ └── index.html.erb │ ├── addresses │ │ ├── new.html.erb │ │ └── index.html.erb │ └── home │ │ └── index.html.erb ├── helpers │ ├── home_helper.rb │ ├── application_helper.rb │ └── user_helper.rb ├── javascript │ ├── jquery.js │ ├── application.js │ ├── controllers │ │ ├── hello_controller.js │ │ ├── application.js │ │ ├── modal_controller.js │ │ ├── index.js │ │ └── admin_modal_controller.js │ ├── devise.js │ ├── mask.js │ ├── admin.js │ └── sbadmin │ │ ├── sbadmin.js │ │ └── jquery-easing │ │ └── jquery.easing.min.js ├── channels │ └── application_cable │ │ ├── channel.rb │ │ └── connection.rb ├── policies │ ├── product_policy.rb │ └── application_policy.rb ├── mailers │ └── application_mailer.rb ├── jobs │ └── application_job.rb └── presenters │ └── product_presenter.rb ├── .ruby-version ├── .rspec ├── bin ├── rake ├── rails ├── dev ├── setup └── bundle ├── spec ├── support │ ├── factory_bot.rb │ └── database_cleaner.rb ├── models │ ├── address_spec.rb │ ├── product_spec.rb │ ├── category_spec.rb │ └── user_spec.rb ├── factories │ ├── categories.rb │ ├── products.rb │ ├── users.rb │ └── addresses.rb ├── requests │ ├── home_spec.rb │ └── categories_spec.rb ├── spec_helper.rb └── rails_helper.rb ├── config ├── environment.rb ├── boot.rb ├── cable.yml ├── database.yml ├── initializers │ ├── filter_parameter_logging.rb │ ├── permissions_policy.rb │ ├── assets.rb │ ├── inflections.rb │ ├── content_security_policy.rb │ ├── simple_form.rb │ └── devise.rb ├── credentials.yml.enc ├── routes.rb ├── application.rb ├── locales │ ├── simple_form.en.yml │ ├── en.yml │ └── devise.en.yml ├── storage.yml ├── puma.rb └── environments │ ├── test.rb │ ├── development.rb │ └── production.rb ├── config.ru ├── .env.sample ├── Procfile.dev ├── Rakefile ├── .gitattributes ├── db ├── migrate │ ├── 20221104231300_create_categories.rb │ ├── 20221202232713_add_fields_promo_to_products.rb │ ├── 20221022011103_add_column_role_to_user.rb │ ├── 20221105004205_create_products.rb │ ├── 20230204002530_create_addresses.rb │ ├── 20221008003537_devise_create_users.rb │ └── 20221112000829_create_active_storage_tables.active_storage.rb ├── seeds.rb └── schema.rb ├── Dockerfile ├── package.json ├── .gitignore ├── docker-compose.yml ├── Gemfile ├── README.md ├── Gemfile.lock └── yarn.lock /log/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /storage/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tmp/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/tasks/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/helpers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/mailers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/models/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/system/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tmp/pids/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tmp/storage/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/builds/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/images/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/controllers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/integration/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | ruby-3.1.0 2 | -------------------------------------------------------------------------------- /app/models/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/apple-touch-icon.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/files/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --require spec_helper 2 | -------------------------------------------------------------------------------- /app/controllers/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /app/helpers/home_helper.rb: -------------------------------------------------------------------------------- 1 | module HomeHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/assets/stylesheets/devise.scss: -------------------------------------------------------------------------------- 1 | @import 'devise/style.css'; 2 | -------------------------------------------------------------------------------- /app/assets/stylesheets/admin.scss: -------------------------------------------------------------------------------- 1 | @import 'sbadmin/sbadmin.min.css'; 2 | -------------------------------------------------------------------------------- /app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_tree ../builds 3 | -------------------------------------------------------------------------------- /app/javascript/jquery.js: -------------------------------------------------------------------------------- 1 | import jquery from 'jquery'; 2 | window.jQuery = jquery; 3 | window.$ = jquery; 4 | -------------------------------------------------------------------------------- /app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | primary_abstract_class 3 | end 4 | -------------------------------------------------------------------------------- /app/models/category.rb: -------------------------------------------------------------------------------- 1 | class Category < ApplicationRecord 2 | validates :name, :position, presence: true 3 | end 4 | -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative "../config/boot" 3 | require "rake" 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /spec/support/factory_bot.rb: -------------------------------------------------------------------------------- 1 | RSpec.configure do |config| 2 | config.include FactoryBot::Syntax::Methods 3 | end 4 | -------------------------------------------------------------------------------- /app/assets/images/profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progshowzim/ecommerce_showzim/HEAD/app/assets/images/profile.png -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | -------------------------------------------------------------------------------- /app/models/address.rb: -------------------------------------------------------------------------------- 1 | class Address < ApplicationRecord 2 | belongs_to :user 3 | validates :name, presence: true 4 | end 5 | -------------------------------------------------------------------------------- /app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /app/policies/product_policy.rb: -------------------------------------------------------------------------------- 1 | class ProductPolicy < ApplicationPolicy 2 | def new? 3 | Category.count.positive? 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /app/controllers/admin/home_controller.rb: -------------------------------------------------------------------------------- 1 | module Admin 2 | class HomeController < BaseController 3 | def index 4 | end 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: "from@example.com" 3 | layout "mailer" 4 | end 5 | -------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_PATH = File.expand_path("../config/application", __dir__) 3 | require_relative "../config/boot" 4 | require "rails/commands" 5 | -------------------------------------------------------------------------------- /app/views/devise/shared/_button_submit.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <%= f.button :submit, text, class: 'btn btn-primary rounded btn-block p-3' %> 3 |
4 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative "application" 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /spec/models/address_spec.rb: -------------------------------------------------------------------------------- 1 | require 'rails_helper' 2 | 3 | RSpec.describe Address, type: :model do 4 | pending "add some examples to (or delete) #{__FILE__}" 5 | end 6 | -------------------------------------------------------------------------------- /spec/models/product_spec.rb: -------------------------------------------------------------------------------- 1 | require 'rails_helper' 2 | 3 | RSpec.describe Product, type: :model do 4 | pending "add some examples to (or delete) #{__FILE__}" 5 | end 6 | -------------------------------------------------------------------------------- /app/views/devise/mailer/password_change.html.erb: -------------------------------------------------------------------------------- 1 |

Hello <%= @resource.email %>!

2 | 3 |

We're contacting you to notify you that your password has been changed.

4 | -------------------------------------------------------------------------------- /spec/factories/categories.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :category do 3 | name { Faker::Name.name } 4 | position { Faker::Number.number(digits: 1) } 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /app/helpers/user_helper.rb: -------------------------------------------------------------------------------- 1 | module UserHelper 2 | def user_avatar_url(current_user) 3 | return current_user.avatar if current_user.avatar.attached? 4 | 'profile' 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative "config/environment" 4 | 5 | run Rails.application 6 | Rails.application.load_server 7 | -------------------------------------------------------------------------------- /app/controllers/home_controller.rb: -------------------------------------------------------------------------------- 1 | class HomeController < ApplicationController 2 | def index 3 | @products = Product.all.map { |product| ProductPresenter.new(product) } 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /.env.sample: -------------------------------------------------------------------------------- 1 | RAILS_ENV=development 2 | 3 | REDIS_URL=redis://redis:6379/0 4 | SIDEKIQ_WORKERS=5 5 | RAILS_MAX_THREADS=4 6 | WEB_CONCURRENCY=4 7 | 8 | SIDEKIQ_USER= 9 | SIDEKIQ_PASSWORD= 10 | -------------------------------------------------------------------------------- /Procfile.dev: -------------------------------------------------------------------------------- 1 | web: bin/rails server -p 3000 -b '0.0.0.0' 2 | js: yarn build --watch 3 | css: yarn build:css --watch 4 | devise: yarn build:css:devise --watch 5 | admin: yarn build:css:admin --watch 6 | -------------------------------------------------------------------------------- /app/views/admin/products/edit.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace "bootstrap_modal" do %> 2 | <%= render partial: "admin/products/form_modal", locals: { product: @product }%> 3 | <% end %> 4 | -------------------------------------------------------------------------------- /app/views/admin/products/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace "bootstrap_modal" do %> 2 | <%= render partial: "admin/products/form_modal", locals: { product: @product }%> 3 | <% end %> 4 | -------------------------------------------------------------------------------- /app/views/layouts/shared/_flash.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <% flash.each do |type, msg| %> 3 |
4 | <%= msg %> 5 |
6 | <% end %> 7 |
8 | -------------------------------------------------------------------------------- /app/views/admin/categories/edit.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace "bootstrap_modal" do %> 2 | <%= render partial: "admin/categories/form_modal", locals: { category: @category }%> 3 | <% end %> 4 | -------------------------------------------------------------------------------- /app/views/admin/categories/new.turbo_stream.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_stream.replace "bootstrap_modal" do %> 2 | <%= render partial: "admin/categories/form_modal", locals: { category: @category }%> 3 | <% end %> 4 | -------------------------------------------------------------------------------- /app/views/layouts/store/_footer.html.erb: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /bin/dev: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if ! foreman version &> /dev/null 4 | then 5 | echo "Installing foreman..." 6 | gem install foreman 7 | fi 8 | 9 | foreman start -f Procfile.dev "$@" 10 | -------------------------------------------------------------------------------- /test/application_system_test_case.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ApplicationSystemTestCase < ActionDispatch::SystemTestCase 4 | driven_by :selenium, using: :chrome, screen_size: [1400, 1400] 5 | end 6 | -------------------------------------------------------------------------------- /app/javascript/application.js: -------------------------------------------------------------------------------- 1 | // Entry point for the build script in your package.json 2 | import "@hotwired/turbo-rails" 3 | import "./controllers" 4 | import * as bootstrap from "bootstrap" 5 | import "./mask" 6 | -------------------------------------------------------------------------------- /app/javascript/controllers/hello_controller.js: -------------------------------------------------------------------------------- 1 | import { Controller } from "@hotwired/stimulus" 2 | 3 | export default class extends Controller { 4 | connect() { 5 | this.element.textContent = "Hello World!" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) 2 | 3 | require "bundler/setup" # Set up gems listed in the Gemfile. 4 | require "bootsnap/setup" # Speed up boot time by caching expensive operations. 5 | -------------------------------------------------------------------------------- /app/javascript/devise.js: -------------------------------------------------------------------------------- 1 | // Entry point for the build script in your package.json 2 | import "@hotwired/turbo-rails" 3 | import "./controllers" 4 | import * as bootstrap from "bootstrap" 5 | Turbo.session.drive = false 6 | import "./mask" 7 | -------------------------------------------------------------------------------- /app/javascript/mask.js: -------------------------------------------------------------------------------- 1 | import Inputmask from "inputmask" 2 | 3 | // MASK PHONE 4 | const element_phone = document.getElementsByClassName("mask-phone") 5 | const im_phone = new Inputmask("(99) 999999999") 6 | im_phone.mask(element_phone) 7 | -------------------------------------------------------------------------------- /spec/factories/products.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :product do 3 | name { "MyString" } 4 | description { "MyText" } 5 | price { "9.99" } 6 | publish { false } 7 | category { nil } 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative "config/application" 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: test 6 | 7 | production: 8 | adapter: redis 9 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> 10 | channel_prefix: ecommerce_showzim_production 11 | -------------------------------------------------------------------------------- /app/views/devise/mailer/confirmation_instructions.html.erb: -------------------------------------------------------------------------------- 1 |

Welcome <%= @email %>!

2 | 3 |

You can confirm your account email through the link below:

4 | 5 |

<%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %>

6 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # See https://git-scm.com/docs/gitattributes for more about git attribute files. 2 | 3 | # Mark the database schema as having been generated. 4 | db/schema.rb linguist-generated 5 | 6 | # Mark any vendored files as having been vendored. 7 | vendor/* linguist-vendored 8 | -------------------------------------------------------------------------------- /app/views/admin/categories/_category.html.erb: -------------------------------------------------------------------------------- 1 |
2 |

3 | Name: 4 | <%= category.name %> 5 |

6 | 7 |

8 | Position: 9 | <%= category.position %> 10 |

11 | 12 |
13 | -------------------------------------------------------------------------------- /db/migrate/20221104231300_create_categories.rb: -------------------------------------------------------------------------------- 1 | class CreateCategories < ActiveRecord::Migration[7.0] 2 | def change 3 | create_table :categories do |t| 4 | t.string :name 5 | t.integer :position 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20221202232713_add_fields_promo_to_products.rb: -------------------------------------------------------------------------------- 1 | class AddFieldsPromoToProducts < ActiveRecord::Migration[7.0] 2 | def change 3 | add_column :products, :promo, :boolean, default: false 4 | add_column :products, :promo_price, :decimal, default: 0.0 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /app/views/layouts/admin/_footer.html.erb: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /app/javascript/controllers/application.js: -------------------------------------------------------------------------------- 1 | import { Application } from "@hotwired/stimulus" 2 | 3 | const application = Application.start() 4 | 5 | // Configure Stimulus development experience 6 | application.debug = false 7 | window.Stimulus = application 8 | 9 | export { application } 10 | -------------------------------------------------------------------------------- /spec/requests/home_spec.rb: -------------------------------------------------------------------------------- 1 | require 'rails_helper' 2 | 3 | RSpec.describe "Homes", type: :request do 4 | describe "GET /index" do 5 | it "returns http success" do 6 | get "/home/index" 7 | expect(response).to have_http_status(:success) 8 | end 9 | end 10 | 11 | end 12 | -------------------------------------------------------------------------------- /app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | # Automatically retry jobs that encountered a deadlock 3 | # retry_on ActiveRecord::Deadlocked 4 | 5 | # Most jobs are safe to ignore if the underlying records are no longer available 6 | # discard_on ActiveJob::DeserializationError 7 | end 8 | -------------------------------------------------------------------------------- /app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/views/admin/products/show.html.erb: -------------------------------------------------------------------------------- 1 |

Detalhes da categoria

2 | 3 |
4 |
5 |
6 |
7 | <%= render @product %> 8 |
9 |
10 |
11 |
12 | -------------------------------------------------------------------------------- /db/migrate/20221022011103_add_column_role_to_user.rb: -------------------------------------------------------------------------------- 1 | class AddColumnRoleToUser < ActiveRecord::Migration[7.0] 2 | def change 3 | create_enum :role_user, ['user', 'admin'] 4 | 5 | change_table :users do |t| 6 | t.enum :role, enum_type: 'role_user', default: 'user', null: false 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/views/admin/categories/show.html.erb: -------------------------------------------------------------------------------- 1 |

Detalhes da categoria

2 | 3 |
4 |
5 |
6 |
7 | <%= render @category %> 8 |
9 |
10 |
11 |
12 | -------------------------------------------------------------------------------- /app/views/admin/products/new.html.erb: -------------------------------------------------------------------------------- 1 |

Novo produto

2 | 3 |
4 |
5 |
6 |
7 | <%= render "form", product: @product %> 8 |
9 |
10 |
11 |
12 | -------------------------------------------------------------------------------- /app/views/admin/products/edit.html.erb: -------------------------------------------------------------------------------- 1 |

Editar produto

2 | 3 |
4 |
5 |
6 |
7 | <%= render "form", product: @product %> 8 |
9 |
10 |
11 |
12 | -------------------------------------------------------------------------------- /spec/factories/users.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :user do 3 | password = Faker::Number.number(digits: 10) 4 | email { Faker::Internet.email } 5 | password { password } 6 | password_confirmation { password } 7 | name { Faker::Name.name } 8 | phone { Faker::PhoneNumber.cell_phone } 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /app/views/admin/categories/edit.html.erb: -------------------------------------------------------------------------------- 1 |

Editar categoria

2 | 3 |
4 |
5 |
6 |
7 | <%= render "form", category: @category %> 8 |
9 |
10 |
11 |
12 | -------------------------------------------------------------------------------- /app/views/admin/categories/new.html.erb: -------------------------------------------------------------------------------- 1 |

Nova categoria

2 | 3 |
4 |
5 |
6 |
7 | <%= render "form", category: @category %> 8 |
9 |
10 |
11 |
12 | -------------------------------------------------------------------------------- /app/models/product.rb: -------------------------------------------------------------------------------- 1 | class Product < ApplicationRecord 2 | has_one_attached :image do |attachable| 3 | attachable.variant :thumb, resize_to_limit: [100, 100] 4 | attachable.variant :big_thumb, resize_to_limit: [600, 700] 5 | end 6 | belongs_to :category 7 | 8 | validates :name, :description, :price, presence: true 9 | end 10 | -------------------------------------------------------------------------------- /app/views/devise/mailer/unlock_instructions.html.erb: -------------------------------------------------------------------------------- 1 |

Hello <%= @resource.email %>!

2 | 3 |

Your account has been locked due to an excessive number of unsuccessful sign in attempts.

4 | 5 |

Click the link below to unlock your account:

6 | 7 |

<%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %>

8 | -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 1 | default: &default 2 | adapter: postgresql 3 | encoding: unicode 4 | pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> 5 | url: <%= ENV["DATABASE_URL"] %> 6 | 7 | development: 8 | <<: *default 9 | 10 | test: 11 | <<: *default 12 | 13 | homolog: 14 | <<: *default 15 | 16 | production: 17 | <<: *default 18 | -------------------------------------------------------------------------------- /test/channels/application_cable/connection_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ApplicationCable::ConnectionTest < ActionCable::Connection::TestCase 4 | # test "connects with cookies" do 5 | # cookies.signed[:user_id] = 42 6 | # 7 | # connect 8 | # 9 | # assert_equal connection.user_id, "42" 10 | # end 11 | end 12 | -------------------------------------------------------------------------------- /app/controllers/admin/base_controller.rb: -------------------------------------------------------------------------------- 1 | module Admin 2 | class BaseController < ApplicationController 3 | layout 'admin' 4 | before_action :authenticate_user! 5 | before_action :only_admin! 6 | 7 | private 8 | 9 | def only_admin! 10 | redirect_to root_path unless current_user.admin? 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /spec/factories/addresses.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :address do 3 | name { "MyString" } 4 | street { "MyString" } 5 | neighborhood { "MyString" } 6 | number { "MyString" } 7 | zipcode { "MyString" } 8 | city { "MyString" } 9 | state { "MyString" } 10 | main { false } 11 | user { nil } 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/assets/stylesheets/application.bootstrap.scss: -------------------------------------------------------------------------------- 1 | @import 'bootstrap/scss/bootstrap'; 2 | @import 'bootstrap-icons/font/bootstrap-icons'; 3 | 4 | .menu-item-profile { 5 | text-decoration: none; 6 | font-weight: 600; 7 | } 8 | 9 | .menu-item-profile li:hover { 10 | background-color: #e4e4e4; 11 | } 12 | 13 | .input_image_full { 14 | width: 100%; 15 | } 16 | -------------------------------------------------------------------------------- /app/javascript/admin.js: -------------------------------------------------------------------------------- 1 | // Entry point for the build script in your package.json 2 | import "@hotwired/turbo-rails" 3 | import "./controllers" 4 | import "./jquery" 5 | import * as bootstrap from "bootstrap" 6 | window.bootstrap = bootstrap 7 | // Turbo.session.drive = false 8 | import "./sbadmin/sbadmin.js" 9 | import "./sbadmin/jquery-easing/jquery.easing.min.js" 10 | -------------------------------------------------------------------------------- /app/views/devise/mailer/email_changed.html.erb: -------------------------------------------------------------------------------- 1 |

Hello <%= @email %>!

2 | 3 | <% if @resource.try(:unconfirmed_email?) %> 4 |

We're contacting you to notify you that your email is being changed to <%= @resource.unconfirmed_email %>.

5 | <% else %> 6 |

We're contacting you to notify you that your email has been changed to <%= @resource.email %>.

7 | <% end %> 8 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | RSpec.configure do |config| 2 | config.expect_with :rspec do |expectations| 3 | expectations.include_chain_clauses_in_custom_matcher_descriptions = true 4 | end 5 | 6 | config.mock_with :rspec do |mocks| 7 | mocks.verify_partial_doubles = true 8 | end 9 | 10 | config.shared_context_metadata_behavior = :apply_to_host_groups 11 | end 12 | -------------------------------------------------------------------------------- /db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # movies = Movie.create([{ name: "Star Wars" }, { name: "Lord of the Rings" }]) 7 | # Character.create(name: "Luke", movie: movies.first) 8 | -------------------------------------------------------------------------------- /app/presenters/product_presenter.rb: -------------------------------------------------------------------------------- 1 | class ProductPresenter < SimpleDelegator 2 | include ActionView::Helpers::NumberHelper 3 | include ActionView::Helpers::TagHelper 4 | 5 | def price 6 | return content_tag(:span, number_to_currency(super), class: "text-muted text-decoration-line-through") + " #{number_to_currency(promo_price)}" if promo? 7 | 8 | number_to_currency(super) 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | include Pundit::Authorization 3 | 4 | before_action :configure_permitted_parameters, if: :devise_controller? 5 | 6 | protected 7 | 8 | def configure_permitted_parameters 9 | devise_parameter_sanitizer.permit(:sign_up) do |u| 10 | u.permit(:name, :email, :password, :password_confirmation, :phone) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV["RAILS_ENV"] ||= "test" 2 | require_relative "../config/environment" 3 | require "rails/test_help" 4 | 5 | class ActiveSupport::TestCase 6 | # Run tests in parallel with specified workers 7 | parallelize(workers: :number_of_processors) 8 | 9 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 10 | fixtures :all 11 | 12 | # Add more helper methods to be used by all tests here... 13 | end 14 | -------------------------------------------------------------------------------- /app/javascript/controllers/modal_controller.js: -------------------------------------------------------------------------------- 1 | import { Controller } from "@hotwired/stimulus" 2 | 3 | // Connects to data-controller="modal" 4 | export default class extends Controller { 5 | connect() { 6 | console.log("conecta no modal controller") 7 | this.modal = new bootstrap.Modal(this.element, { 8 | keyboard: false 9 | }) 10 | 11 | this.modal.show() 12 | } 13 | 14 | disconnect() { 15 | this.modal.hide() 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/views/devise/shared/_error_messages.html.erb: -------------------------------------------------------------------------------- 1 | <% if resource.errors.any? %> 2 |
3 |

4 | <%= I18n.t("errors.messages.not_saved", 5 | count: resource.errors.count, 6 | resource: resource.class.model_name.human.downcase) 7 | %> 8 |

9 |

10 | <%= resource.errors.full_messages.join(', ') %> 11 |

12 |
13 | <% end %> 14 | -------------------------------------------------------------------------------- /config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure parameters to be filtered from the log file. Use this to limit dissemination of 4 | # sensitive information. See the ActiveSupport::ParameterFilter documentation for supported 5 | # notations and behaviors. 6 | Rails.application.config.filter_parameters += [ 7 | :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn 8 | ] 9 | -------------------------------------------------------------------------------- /config/initializers/permissions_policy.rb: -------------------------------------------------------------------------------- 1 | # Define an application-wide HTTP permissions policy. For further 2 | # information see https://developers.google.com/web/updates/2018/06/feature-policy 3 | # 4 | # Rails.application.config.permissions_policy do |f| 5 | # f.camera :none 6 | # f.gyroscope :none 7 | # f.microphone :none 8 | # f.usb :none 9 | # f.fullscreen :self 10 | # f.payment :self, "https://secure.example.com" 11 | # end 12 | -------------------------------------------------------------------------------- /app/views/devise/mailer/reset_password_instructions.html.erb: -------------------------------------------------------------------------------- 1 |

Hello <%= @resource.email %>!

2 | 3 |

Someone has requested a link to change your password. You can do this through the link below.

4 | 5 |

<%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %>

6 | 7 |

If you didn't request this, please ignore this email.

8 |

Your password won't change until you access the link above and create a new one.

9 | -------------------------------------------------------------------------------- /config/credentials.yml.enc: -------------------------------------------------------------------------------- 1 | y4X/XEya4onclKOzYJUuiZ/1GfOp14Gqq+3mPnN4mLN/Tp+csyFoZkRUzkTLmMPGrJ8hlgUYEr1BgKqBo3mclk90bC0MZ4XBK8Cn8iTQkskoWWTYKkV5lLA10v7mZbWTvINsR2PgiP4a05fmP8nPnm0YVzKh5KP94T6wtFukLCdsnr04wZZwl2/9zY8798bxbYz0OjBP/TbMTyek2+EFgGKe4Q8QzwzMOwqlrBuzX1Ju3KzTjJRex2MGdh4PnJycdon4qRJ0eGSwyuWE7OvasdoSlx7jjt++1z4fxcu3tGJC/4+p/iioOWyabClHHcC4BrkLu04UCTEAsaQ19z/E6PX1XHM9fc/tuCE2oW4xVpSVjrM1fPvgM/pPxV7Os+cPmsX4wIgrEXanCya5tPID2xsICuhl9aVnflo9--z6VZ0F6aHqK/Dnm1--+o2M5XgFZyaJrZPTrixpww== -------------------------------------------------------------------------------- /app/models/user.rb: -------------------------------------------------------------------------------- 1 | class User < ApplicationRecord 2 | # Include default devise modules. Others available are: 3 | # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable 4 | devise :database_authenticatable, :registerable, 5 | :recoverable, :rememberable, :validatable 6 | 7 | validates :name, :phone, presence: true 8 | 9 | has_one_attached :avatar 10 | 11 | has_many :addresses 12 | 13 | enum role: { user: 'user', admin: 'admin' } 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20221105004205_create_products.rb: -------------------------------------------------------------------------------- 1 | class CreateProducts < ActiveRecord::Migration[7.0] 2 | def change 3 | create_table :products do |t| 4 | t.string :name, null: false 5 | t.text :description, null: false 6 | t.decimal :price, precision: 8, scale: 2, null: false 7 | t.boolean :publish, null: false, default: false 8 | t.references :category, null: false, foreign_key: true 9 | 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/views/admin/categories/_form.html.erb: -------------------------------------------------------------------------------- 1 | <%= simple_form_for([:admin, @category]) do |f| %> 2 | <%= f.error_notification %> 3 | <%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %> 4 | 5 |
6 | <%= f.input :name %> 7 | <%= f.input :position %> 8 |
9 | 10 |
11 | <%= f.button :submit, 'Salvar', class: 'btn btn-info' %> 12 |
13 | <% end %> 14 | -------------------------------------------------------------------------------- /spec/support/database_cleaner.rb: -------------------------------------------------------------------------------- 1 | RSpec.configure do |config| 2 | config.before(:suite) do 3 | DatabaseCleaner.clean_with(:truncation) 4 | end 5 | 6 | config.before(:each) do 7 | DatabaseCleaner.strategy = :transaction 8 | end 9 | 10 | config.before(:each, js: true) do 11 | DatabaseCleaner.strategy = :transaction 12 | end 13 | 14 | config.before(:each) do 15 | DatabaseCleaner.start 16 | end 17 | 18 | config.after(:each) do 19 | DatabaseCleaner.clean 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/views/settings/_menu.html.erb: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ruby:3.1.2 2 | 3 | ARG NODE_MAJOR_VERSION=19 4 | RUN curl -sL https://deb.nodesource.com/setup_$NODE_MAJOR_VERSION.x | bash - 5 | RUN apt-get update -qq && \ 6 | apt-get install -y build-essential libvips nodejs libpq-dev postgresql-client && \ 7 | apt-get clean && \ 8 | rm -rf /var/lib/apt/lists/* /usr/share/doc /usr/share/man && \ 9 | npm install -g yarn 10 | 11 | WORKDIR /app 12 | ADD . /app 13 | RUN gem install bundler -v 2.3.26 # aqui você pode especificar com o que está no final do Gemfile.lock 14 | RUN bundle install 15 | -------------------------------------------------------------------------------- /app/views/admin/products/_product.html.erb: -------------------------------------------------------------------------------- 1 |
2 |

3 | Name: 4 | <%= product.name %> 5 |

6 | 7 |

8 | Imagem: 9 | <%= image_tag product.image.variant(:thumb) %> 10 |

11 | 12 |

13 | Descrição: 14 | <%= product.description %> 15 |

16 | 17 |

18 | Preço: 19 | <%= product.price %> 20 |

21 | 22 |

23 | Ativo: 24 | <%= product.publish %> 25 |

26 | 27 |
28 | -------------------------------------------------------------------------------- /db/migrate/20230204002530_create_addresses.rb: -------------------------------------------------------------------------------- 1 | class CreateAddresses < ActiveRecord::Migration[7.0] 2 | def change 3 | create_table :addresses do |t| 4 | t.string :name, null: false 5 | t.string :street, null: false 6 | t.string :neighborhood, null: false 7 | t.string :number, null: false 8 | t.string :address_detail 9 | t.string :zipcode, null: false 10 | t.string :city, null: false 11 | t.string :state, null: false 12 | t.references :user, null: false, foreign_key: true 13 | 14 | t.timestamps 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/templates/erb/scaffold/_form.html.erb: -------------------------------------------------------------------------------- 1 | <%# frozen_string_literal: true %> 2 | <%%= simple_form_for(@<%= singular_table_name %>) do |f| %> 3 | <%%= f.error_notification %> 4 | <%%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %> 5 | 6 |
7 | <%- attributes.each do |attribute| -%> 8 | <%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> %> 9 | <%- end -%> 10 |
11 | 12 |
13 | <%%= f.button :submit %> 14 |
15 | <%% end %> 16 | -------------------------------------------------------------------------------- /app/views/layouts/store/_user_signed_in.html.erb: -------------------------------------------------------------------------------- 1 | <% if user_signed_in? %> 2 | 5 | 8 | <% else %> 9 | 12 | 15 | <% end %> 16 | -------------------------------------------------------------------------------- /app/javascript/controllers/index.js: -------------------------------------------------------------------------------- 1 | // This file is auto-generated by ./bin/rails stimulus:manifest:update 2 | // Run that command whenever you add a new controller or create them with 3 | // ./bin/rails generate stimulus controllerName 4 | 5 | import { application } from "./application" 6 | 7 | import AdminModalController from "./admin_modal_controller" 8 | application.register("admin-modal", AdminModalController) 9 | 10 | import HelloController from "./hello_controller" 11 | application.register("hello", HelloController) 12 | 13 | import ModalController from "./modal_controller" 14 | application.register("modal", ModalController) 15 | -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | devise_for :users 3 | 4 | # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html 5 | 6 | # Defines the root path route ("/") 7 | # root "articles#index" 8 | root to: 'home#index' 9 | resources :settings, only: [:index] do 10 | collection do 11 | get :password 12 | patch :update_user 13 | patch :update_password 14 | end 15 | end 16 | 17 | resources :addresses 18 | 19 | namespace :admin do 20 | root to: 'home#index' 21 | resources :categories 22 | resources :products 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Bem vindo ao Ecommerce Showzim 5 | 6 | <%= csrf_meta_tags %> 7 | <%= csp_meta_tag %> 8 | 9 | <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> 10 | <%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %> 11 | 12 | 13 | 14 | 15 | <%= render 'layouts/store/nav' %> 16 | <%= yield %> 17 | <%= render 'layouts/store/footer' %> 18 | 19 | 20 | -------------------------------------------------------------------------------- /app/views/devise/unlocks/new.html.erb: -------------------------------------------------------------------------------- 1 |

Resend unlock instructions

2 | 3 | <%= simple_form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %> 4 | <%= f.error_notification %> 5 | <%= f.full_error :unlock_token %> 6 | 7 |
8 | <%= f.input :email, 9 | required: true, 10 | autofocus: true, 11 | input_html: { autocomplete: "email" } %> 12 |
13 | 14 |
15 | <%= f.button :submit, "Resend unlock instructions" %> 16 |
17 | <% end %> 18 | 19 | <%= render "devise/shared/links" %> 20 | -------------------------------------------------------------------------------- /config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = "1.0" 5 | 6 | # Add additional assets to the asset load path. 7 | # Rails.application.config.assets.paths << Emoji.images_path 8 | Rails.application.config.assets.paths << Rails.root.join("node_modules/bootstrap-icons/font") 9 | 10 | # Precompile additional assets. 11 | # application.js, application.css, and all non-JS/CSS in the app/assets 12 | # folder are already added. 13 | # Rails.application.config.assets.precompile += %w( admin.js admin.css ) 14 | -------------------------------------------------------------------------------- /spec/models/category_spec.rb: -------------------------------------------------------------------------------- 1 | require 'rails_helper' 2 | 3 | RSpec.describe Category, type: :model do 4 | context 'Espero validar os campos obrigatório' do 5 | it 'Valida o campos estivem presentes' do 6 | category = build(:category) 7 | 8 | expect(category.valid?).to eq(true) 9 | end 10 | 11 | it 'valida o campo nome não está presente' do 12 | category = build(:category, name: nil) 13 | 14 | expect(category.valid?).to eq(false) 15 | end 16 | 17 | it 'valida o campo posição não está presente' do 18 | category = build(:category, position: nil) 19 | 20 | expect(category.valid?).to eq(false) 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /app/views/admin/products/_form.html.erb: -------------------------------------------------------------------------------- 1 | <%= simple_form_for([:admin, @product]) do |f| %> 2 | <%= f.error_notification %> 3 | <%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %> 4 | 5 |
6 | <%= f.input :name %> 7 | <%= f.input :image %> 8 | <%= f.input :description %> 9 | <%= f.input :price %> 10 | <%= f.input :publish %> 11 | <%= f.input :promo %> 12 | <%= f.input :promo_price %> 13 | <%= f.association :category, include_blank: false %> 14 |
15 | 16 |
17 | <%= f.button :submit, 'Salvar', class: 'btn btn-info' %> 18 |
19 | <% end %> 20 | -------------------------------------------------------------------------------- /config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, "\\1en" 8 | # inflect.singular /^(ox)en/i, "\\1" 9 | # inflect.irregular "person", "people" 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym "RESTful" 16 | # end 17 | -------------------------------------------------------------------------------- /app/javascript/controllers/admin_modal_controller.js: -------------------------------------------------------------------------------- 1 | import { Controller } from "@hotwired/stimulus" 2 | import { Turbo } from "@hotwired/turbo-rails"; 3 | 4 | // Connects to data-controller="admin-modal" 5 | export default class extends Controller { 6 | connect() { 7 | console.log("iniciando o controller admim modal") 8 | this.element.setAttribute("data-action", "admin-modal#click_modal") 9 | } 10 | 11 | click_modal(e) { 12 | console.log(e) 13 | e.preventDefault() 14 | this.url = this.element.getAttribute("href") 15 | 16 | fetch(this.url, { 17 | headers: { 18 | Accept: "text/vnd.turbo-stream.html" 19 | } 20 | }) 21 | .then(response => response.text()) 22 | .then(html => Turbo.renderStreamMessage(html)) 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /app/views/devise/confirmations/new.html.erb: -------------------------------------------------------------------------------- 1 |

Resend confirmation instructions

2 | 3 | <%= simple_form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %> 4 | <%= f.error_notification %> 5 | <%= f.full_error :confirmation_token %> 6 | 7 |
8 | <%= f.input :email, 9 | required: true, 10 | autofocus: true, 11 | value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email), 12 | input_html: { autocomplete: "email" } %> 13 |
14 | 15 |
16 | <%= f.button :submit, "Resend confirmation instructions" %> 17 |
18 | <% end %> 19 | 20 | <%= render "devise/shared/links" %> 21 | -------------------------------------------------------------------------------- /app/views/devise/passwords/new.html.erb: -------------------------------------------------------------------------------- 1 | <%= simple_form_for(resource, html: { class: 'login-form'}, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %> 2 |
3 | <%= f.error_notification %> 4 |
5 | 6 |
7 | <%= f.input :email, 8 | required: true, 9 | autofocus: true, 10 | label: false, 11 | placeholder: 'E-mail', 12 | input_html: { autocomplete: "email" } %> 13 |
14 | 15 | <%= render 'devise/shared/button_submit', f: f, text: 'Recuperar senha' %> 16 | <% end %> 17 | 18 |
19 |
20 | <%= render "devise/shared/links" %> 21 |
22 |
23 | -------------------------------------------------------------------------------- /app/controllers/addresses_controller.rb: -------------------------------------------------------------------------------- 1 | class AddressesController < ApplicationController 2 | def index 3 | @addresses = current_user.addresses 4 | end 5 | 6 | def new 7 | @address = current_user.addresses.new 8 | end 9 | 10 | def create 11 | @address = current_user.addresses.new(address_params) 12 | if @address.save 13 | flash[:notice] = 'Endereço cadastrado com sucesso!' 14 | redirect_to action: :index 15 | else 16 | render :new 17 | end 18 | end 19 | 20 | def show; end 21 | 22 | 23 | def edit; end 24 | 25 | def update; end 26 | 27 | def destroy; end 28 | 29 | private 30 | 31 | def address_params 32 | params.require(:address).permit( 33 | :name, :street, :neighborhood, :number, :address_detail, :zipcode, :city, :state) 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /app/policies/application_policy.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class ApplicationPolicy 4 | attr_reader :user, :record 5 | 6 | def initialize(user, record) 7 | @user = user 8 | @record = record 9 | end 10 | 11 | def index? 12 | false 13 | end 14 | 15 | def show? 16 | false 17 | end 18 | 19 | def create? 20 | false 21 | end 22 | 23 | def new? 24 | create? 25 | end 26 | 27 | def update? 28 | false 29 | end 30 | 31 | def edit? 32 | update? 33 | end 34 | 35 | def destroy? 36 | false 37 | end 38 | 39 | class Scope 40 | def initialize(user, scope) 41 | @user = user 42 | @scope = scope 43 | end 44 | 45 | def resolve 46 | raise NotImplementedError, "You must define #resolve in #{self.class}" 47 | end 48 | 49 | private 50 | 51 | attr_reader :user, :scope 52 | end 53 | end 54 | -------------------------------------------------------------------------------- /config/application.rb: -------------------------------------------------------------------------------- 1 | require_relative "boot" 2 | 3 | require "rails/all" 4 | 5 | # Require the gems listed in Gemfile, including any gems 6 | # you've limited to :test, :development, or :production. 7 | Bundler.require(*Rails.groups) 8 | 9 | if ['development', 'test'].include? ENV['RAILS_ENV'] 10 | Dotenv::Railtie.load 11 | end 12 | 13 | module EcommerceShowzim 14 | class Application < Rails::Application 15 | # Initialize configuration defaults for originally generated Rails version. 16 | config.load_defaults 7.0 17 | 18 | # Configuration for the application, engines, and railties goes here. 19 | # 20 | # These settings can be overridden in specific environments using the files 21 | # in config/environments, which are processed later. 22 | # 23 | # config.time_zone = "Central Time (US & Canada)" 24 | # config.eager_load_paths << Rails.root.join("extras") 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /app/views/settings/password.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 | <%= render 'menu' %> 7 |
8 |
9 |
10 |
11 |
12 | <%= render 'layouts/shared/flash' if flash.present? %> 13 |

Alterar senha

14 | <%= simple_form_for current_user, url: update_password_settings_path, data: { turbo: false } do |f| %> 15 | <%= f.input :current_password %> 16 | <%= f.input :password %> 17 | <%= f.input :password_confirmation %> 18 | <%= f.button :submit, "Atualizar senha", class: 'btn btn-primary mt-4' %> 19 | <% end %> 20 |
21 |
22 |
23 |
24 |
25 |
26 | -------------------------------------------------------------------------------- /app/views/admin/products/_form_modal.html.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_frame_tag :bootstrap_modal, target: :_top do %> 2 | 22 | <% end %> 23 | -------------------------------------------------------------------------------- /app/views/admin/categories/_form_modal.html.erb: -------------------------------------------------------------------------------- 1 | <%= turbo_frame_tag :bootstrap_modal, target: :_top do %> 2 | 22 | <% end %> 23 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "app", 3 | "private": "true", 4 | "dependencies": { 5 | "@hotwired/stimulus": "^3.1.0", 6 | "@hotwired/turbo-rails": "^7.2.0", 7 | "@popperjs/core": "^2.11.6", 8 | "bootstrap": "^5.2.1", 9 | "bootstrap-icons": "^1.9.1", 10 | "esbuild": "^0.15.10", 11 | "inputmask": "^5.0.7", 12 | "jquery": "^3.6.1", 13 | "sass": "^1.55.0" 14 | }, 15 | "scripts": { 16 | "build": "esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=assets", 17 | "build:css": "sass ./app/assets/stylesheets/application.bootstrap.scss:./app/assets/builds/application.css --no-source-map --load-path=node_modules", 18 | "build:css:devise": "sass ./app/assets/stylesheets/devise.scss:./app/assets/builds/devise.css --no-source-map --load-path=node_modules", 19 | "build:css:admin": "sass ./app/assets/stylesheets/admin.scss:./app/assets/builds/admin.css --no-source-map --load-path=node_modules" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /config/locales/simple_form.en.yml: -------------------------------------------------------------------------------- 1 | en: 2 | simple_form: 3 | "yes": 'Yes' 4 | "no": 'No' 5 | required: 6 | text: 'required' 7 | mark: '*' 8 | # You can uncomment the line below if you need to overwrite the whole required html. 9 | # When using html, text and mark won't be used. 10 | # html: '*' 11 | error_notification: 12 | default_message: "Please review the problems below:" 13 | # Examples 14 | # labels: 15 | # defaults: 16 | # password: 'Password' 17 | # user: 18 | # new: 19 | # email: 'E-mail to sign in.' 20 | # edit: 21 | # email: 'E-mail.' 22 | # hints: 23 | # defaults: 24 | # username: 'User name to sign in.' 25 | # password: 'No special characters, please.' 26 | # include_blanks: 27 | # defaults: 28 | # age: 'Rather not say' 29 | # prompts: 30 | # defaults: 31 | # age: 'Select your age' 32 | -------------------------------------------------------------------------------- /config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t "hello" 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t("hello") %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # The following keys must be escaped otherwise they will not be retrieved by 20 | # the default I18n backend: 21 | # 22 | # true, false, on, off, yes, no 23 | # 24 | # Instead, surround them with single quotes. 25 | # 26 | # en: 27 | # "true": "foo" 28 | # 29 | # To learn more, please read the Rails Internationalization guide 30 | # available at https://guides.rubyonrails.org/i18n.html. 31 | 32 | en: 33 | hello: "Hello world" 34 | -------------------------------------------------------------------------------- /app/views/devise/sessions/new.html.erb: -------------------------------------------------------------------------------- 1 | <%= simple_form_for(resource, html: { class: 'login-form'}, as: resource_name, url: session_path(resource_name)) do |f| %> 2 |
3 | <%= f.input :email, 4 | required: false, 5 | autofocus: true, 6 | label: false, 7 | placeholder: 'E-mail', 8 | input_html: { autocomplete: "email" } %> 9 | <%= f.input :password, 10 | required: false, 11 | label: false, 12 | placeholder: 'Senha', 13 | input_html: { autocomplete: "current-password" } %> 14 |
15 | <%= render 'devise/shared/button_submit', f: f, text: 'Entrar' %> 16 | 17 |
18 |
19 | <%= f.input :remember_me, as: :boolean, input_html: { class: 'remember' } if devise_mapping.rememberable? %> 20 |
21 |
22 | <%= render "devise/shared/links" %> 23 |
24 |
25 | <% end %> 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile '~/.gitignore_global' 6 | 7 | # Ignore bundler config. 8 | /.bundle 9 | 10 | # Ignore the default SQLite database. 11 | /db/*.sqlite3 12 | /db/*.sqlite3-* 13 | 14 | # Ignore all logfiles and tempfiles. 15 | /log/* 16 | /tmp/* 17 | !/log/.keep 18 | !/tmp/.keep 19 | 20 | # Ignore pidfiles, but keep the directory. 21 | /tmp/pids/* 22 | !/tmp/pids/ 23 | !/tmp/pids/.keep 24 | 25 | # Ignore uploaded files in development. 26 | /storage/* 27 | !/storage/.keep 28 | /tmp/storage/* 29 | !/tmp/storage/ 30 | !/tmp/storage/.keep 31 | 32 | /public/assets 33 | 34 | # Ignore master key for decrypting credentials and more. 35 | /config/master.key 36 | 37 | /app/assets/builds/* 38 | !/app/assets/builds/.keep 39 | 40 | /node_modules 41 | 42 | .env 43 | .env.test 44 | 45 | coverage 46 | /bin/* 47 | 48 | yarn-error.log 49 | 50 | .idea/* 51 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "2" 2 | 3 | services: 4 | app: 5 | build: 6 | context: . 7 | image: ecommerce_prog 8 | command: bash -c "rm -f tmp/pids/server.pid && bin/dev" 9 | volumes: 10 | - .:/app 11 | - projeto_bundle:/usr/local/bundle 12 | ports: 13 | - 3000:3000 14 | networks: 15 | - ecommerce_prog_network 16 | stdin_open: true 17 | tty: true 18 | env_file: 19 | - ${ENV_FILE:-.env} 20 | depends_on: 21 | - db 22 | 23 | db: 24 | image: postgres 25 | container_name: ecommerce_prog_db 26 | volumes: 27 | - pg_data:/var/lib/postgresql/data 28 | environment: 29 | POSTGRES_USER: postgres 30 | POSTGRES_PASSWORD: postgres 31 | ports: 32 | - "5432:5432" 33 | networks: 34 | - ecommerce_prog_network 35 | 36 | mailcatcher: 37 | image: dockage/mailcatcher:0.8.2 38 | restart: on-failure 39 | ports: 40 | - "1080:1080" 41 | - "1025:1025" 42 | 43 | volumes: 44 | pg_data: 45 | projeto_bundle: 46 | 47 | networks: 48 | ecommerce_prog_network: 49 | name: ecommerce_prog_network 50 | -------------------------------------------------------------------------------- /app/views/layouts/store/_nav.html.erb: -------------------------------------------------------------------------------- 1 | 20 | -------------------------------------------------------------------------------- /bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require "fileutils" 3 | 4 | # path to your application root. 5 | APP_ROOT = File.expand_path("..", __dir__) 6 | 7 | def system!(*args) 8 | system(*args) || abort("\n== Command #{args} failed ==") 9 | end 10 | 11 | FileUtils.chdir APP_ROOT do 12 | # This script is a way to set up or update your development environment automatically. 13 | # This script is idempotent, so that you can run it at any time and get an expectable outcome. 14 | # Add necessary setup steps to this file. 15 | 16 | puts "== Installing dependencies ==" 17 | system! "gem install bundler --conservative" 18 | system("bundle check") || system!("bundle install") 19 | 20 | # puts "\n== Copying sample files ==" 21 | # unless File.exist?("config/database.yml") 22 | # FileUtils.cp "config/database.yml.sample", "config/database.yml" 23 | # end 24 | 25 | puts "\n== Preparing database ==" 26 | system! "bin/rails db:prepare" 27 | 28 | puts "\n== Removing old logs and tempfiles ==" 29 | system! "bin/rails log:clear tmp:clear" 30 | 31 | puts "\n== Restarting application server ==" 32 | system! "bin/rails restart" 33 | end 34 | -------------------------------------------------------------------------------- /spec/rails_helper.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | require 'vcr' 3 | require 'simplecov' 4 | require 'faker' 5 | 6 | ENV['RAILS_ENV'] ||= 'test' 7 | 8 | require_relative '../config/environment' 9 | 10 | abort('The Rails environment is running in production mode!') if Rails.env.production? 11 | require 'rspec/rails' 12 | 13 | Dir[Rails.root.join('spec', 'support', '**', '*.rb')].sort.each { |f| require f } 14 | 15 | begin 16 | ActiveRecord::Migration.maintain_test_schema! 17 | rescue ActiveRecord::PendingMigrationError => e 18 | puts e.to_s.strip 19 | exit 1 20 | end 21 | 22 | RSpec.configure do |config| 23 | config.fixture_path = "#{::Rails.root}/spec/fixtures" 24 | 25 | config.use_transactional_fixtures = true 26 | 27 | config.infer_spec_type_from_file_location! 28 | 29 | config.filter_rails_from_backtrace! 30 | end 31 | 32 | Shoulda::Matchers.configure do |config| 33 | config.integrate do |with| 34 | with.test_framework :rspec 35 | with.library :rails 36 | end 37 | end 38 | 39 | VCR.configure do |config| 40 | config.cassette_library_dir = 'fixtures/vcr' 41 | config.hook_into :webmock 42 | end 43 | 44 | SimpleCov.start 45 | -------------------------------------------------------------------------------- /config/initializers/content_security_policy.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Define an application-wide content security policy. 4 | # See the Securing Rails Applications Guide for more information: 5 | # https://guides.rubyonrails.org/security.html#content-security-policy-header 6 | 7 | # Rails.application.configure do 8 | # config.content_security_policy do |policy| 9 | # policy.default_src :self, :https 10 | # policy.font_src :self, :https, :data 11 | # policy.img_src :self, :https, :data 12 | # policy.object_src :none 13 | # policy.script_src :self, :https 14 | # policy.style_src :self, :https 15 | # # Specify URI for violation reports 16 | # # policy.report_uri "/csp-violation-report-endpoint" 17 | # end 18 | # 19 | # # Generate session nonces for permitted importmap and inline scripts 20 | # config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s } 21 | # config.content_security_policy_nonce_directives = %w(script-src) 22 | # 23 | # # Report violations without enforcing the policy. 24 | # # config.content_security_policy_report_only = true 25 | # end 26 | -------------------------------------------------------------------------------- /app/views/settings/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 | <%= render 'menu' %> 7 |
8 |
9 |
10 |
11 |
12 | <%= render 'layouts/shared/flash' if flash.present? %> 13 |

<%= current_user.name %>

14 | <%= image_tag user_avatar_url(current_user), width: 120, height: 120, class: 'mb-4 rounded-circle' %> 15 | <%= simple_form_for current_user, url: update_user_settings_path, data: { turbo: false } do |f| %> 16 | <%= f.input :avatar, label: false, hint: 'Escolha uma foto para sua conta.', input_html: { class: 'input_image_full' } %> 17 | <%= f.input :email, readonly: true %> 18 | <%= f.input :name %> 19 | <%= f.input :phone, input_html: { class: 'mask-phone' } %> 20 | <%= f.button :submit, "Atualizar", class: 'btn btn-primary mt-4' %> 21 | <% end %> 22 |
23 |
24 |
25 |
26 |
27 |
28 | -------------------------------------------------------------------------------- /app/views/devise/passwords/edit.html.erb: -------------------------------------------------------------------------------- 1 | <%= simple_form_for(resource, html: { class: 'login-form'}, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %> 2 |
3 | <%= f.error_notification %> 4 |
5 | 6 | <%= f.input :reset_password_token, as: :hidden %> 7 | <%= f.full_error :reset_password_token %> 8 | 9 |
10 | <%= f.input :password, 11 | label: "New password", 12 | required: true, 13 | autofocus: true, 14 | label: false, 15 | placeholder: "senha no mínimo de #{@minimum_password_length} caracteres", 16 | input_html: { autocomplete: "new-password" } %> 17 | <%= f.input :password_confirmation, 18 | label: false, 19 | placeholder: 'Confirmar senha', 20 | required: true, 21 | input_html: { autocomplete: "new-password" } %> 22 |
23 | 24 | <%= render 'devise/shared/button_submit', f: f, text: 'Alterar senha' %> 25 | <% end %> 26 | 27 |
28 |
29 | <%= render "devise/shared/links" %> 30 |
31 |
32 | -------------------------------------------------------------------------------- /app/views/devise/shared/_links.html.erb: -------------------------------------------------------------------------------- 1 | <%- if controller_name != 'sessions' %> 2 | <%= link_to "Log in", new_session_path(resource_name) %>
3 | <% end %> 4 | 5 | <%- if devise_mapping.registerable? && controller_name != 'registrations' %> 6 | <%= link_to "Sign up", new_registration_path(resource_name) %>
7 | <% end %> 8 | 9 | <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %> 10 | <%= link_to "Forgot your password?", new_password_path(resource_name) %>
11 | <% end %> 12 | 13 | <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> 14 | <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
15 | <% end %> 16 | 17 | <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> 18 | <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
19 | <% end %> 20 | 21 | <%- if devise_mapping.omniauthable? %> 22 | <%- resource_class.omniauth_providers.each do |provider| %> 23 | <%= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), method: :post %>
24 | <% end %> 25 | <% end %> 26 | -------------------------------------------------------------------------------- /config/storage.yml: -------------------------------------------------------------------------------- 1 | test: 2 | service: Disk 3 | root: <%= Rails.root.join("tmp/storage") %> 4 | 5 | local: 6 | service: Disk 7 | root: <%= Rails.root.join("storage") %> 8 | 9 | # Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) 10 | # amazon: 11 | # service: S3 12 | # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> 13 | # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> 14 | # region: us-east-1 15 | # bucket: your_own_bucket-<%= Rails.env %> 16 | 17 | # Remember not to checkin your GCS keyfile to a repository 18 | # google: 19 | # service: GCS 20 | # project: your_project 21 | # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> 22 | # bucket: your_own_bucket-<%= Rails.env %> 23 | 24 | # Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key) 25 | # microsoft: 26 | # service: AzureStorage 27 | # storage_account_name: your_account_name 28 | # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %> 29 | # container: your_container_name-<%= Rails.env %> 30 | 31 | # mirror: 32 | # service: Mirror 33 | # primary: local 34 | # mirrors: [ amazon, google, microsoft ] 35 | -------------------------------------------------------------------------------- /app/views/layouts/admin.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Loja Showzim - Admin 5 | 6 | <%= csrf_meta_tags %> 7 | <%= csp_meta_tag %> 8 | 9 | <%= stylesheet_link_tag "admin", "data-turbo-track": "reload" %> 10 | 11 | 12 | <%= javascript_include_tag "admin", "data-turbo-track": "reload", defer: true %> 13 | 14 | 15 | 16 |
17 | <%= render 'layouts/admin/sidebar' %> 18 |
19 | 20 |
21 | <%= render 'layouts/admin/topbar' %> 22 |
23 | <%= yield %> 24 |
25 |
26 | <%= render 'layouts/admin/footer'%> 27 |
28 |
29 | <%= turbo_frame_tag "bootstrap_modal" %> 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /app/controllers/settings_controller.rb: -------------------------------------------------------------------------------- 1 | class SettingsController < ApplicationController 2 | before_action :authenticate_user! 3 | 4 | def index; end 5 | 6 | def password; end 7 | 8 | def update_user 9 | if current_user.update(user_params) 10 | redirect_to settings_path, notice: 'Seus dados foram atualizado com sucesso.' 11 | else 12 | render :index 13 | end 14 | end 15 | 16 | def update_password 17 | # TODO: Refatorar esse algoritmo 18 | if !current_password_params[:current_password].empty? && current_user.valid_password?(current_password_params[:current_password]) 19 | if current_user.update(password_params) 20 | bypass_sign_in(current_user) 21 | redirect_to password_settings_path, notice: 'Sua senha foi atualizada com sucesso.' 22 | else 23 | render :password 24 | end 25 | else 26 | redirect_to password_settings_path, notice: 'Você precisa informar sua senha atual para trocar de senha' 27 | end 28 | end 29 | 30 | private 31 | 32 | def user_params 33 | params.require(:user).permit(:name, :phone, :avatar) 34 | end 35 | 36 | def current_password_params 37 | params.require(:user).permit(:current_password) 38 | end 39 | 40 | def password_params 41 | params.require(:user).permit(:password, :password_confirmation) 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /app/views/admin/categories/index.html.erb: -------------------------------------------------------------------------------- 1 |

<%= notice %>

2 | 3 |

Categoria

4 | 5 |
6 |
7 |
8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | <% @categories.each do |category| %> 17 | 18 | 19 | 20 | 25 | 26 | <% end %> 27 | 28 |
NomePosiçãoAções
<%= category.name %><%= category.position %> 21 | <%= link_to "Detalhes", admin_category_path(category), class: 'btn btn-dark' %> 22 | <%= link_to "Editar", edit_admin_category_path(category), data: { controller: 'admin-modal' }, class: 'btn btn-warning' %> 23 | <%= link_to "Excluir", admin_category_path(category), method: :delete, class: 'btn btn-danger', data: {turbo_method: :delete, turbo_confirm: 'Deseja realmente exlcuir?'} %> 24 |
29 | 30 | <%= link_to "Nova categoria", new_admin_category_path, data: { controller: 'admin-modal' }, class: 'btn btn-primary' %> 31 |
32 |
33 |
34 |
35 | -------------------------------------------------------------------------------- /app/views/devise/registrations/edit.html.erb: -------------------------------------------------------------------------------- 1 |

Edit <%= resource_name.to_s.humanize %>

2 | 3 | <%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %> 4 | <%= f.error_notification %> 5 | 6 |
7 | <%= f.input :email, required: true, autofocus: true %> 8 | 9 | <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %> 10 |

Currently waiting confirmation for: <%= resource.unconfirmed_email %>

11 | <% end %> 12 | 13 | <%= f.input :password, 14 | hint: "leave it blank if you don't want to change it", 15 | required: false, 16 | input_html: { autocomplete: "new-password" } %> 17 | <%= f.input :password_confirmation, 18 | required: false, 19 | input_html: { autocomplete: "new-password" } %> 20 | <%= f.input :current_password, 21 | hint: "we need your current password to confirm your changes", 22 | required: true, 23 | input_html: { autocomplete: "current-password" } %> 24 |
25 | 26 |
27 | <%= f.button :submit, "Update" %> 28 |
29 | <% end %> 30 | 31 |

Cancel my account

32 | 33 |

Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %>

34 | 35 | <%= link_to "Back", :back %> 36 | -------------------------------------------------------------------------------- /app/views/devise/registrations/new.html.erb: -------------------------------------------------------------------------------- 1 | <%= simple_form_for(resource, html: { class: 'login-form'}, as: resource_name, url: registration_path(resource_name)) do |f| %> 2 |
3 | <%= f.error_notification %> 4 | <%= render 'devise/shared/error_messages' %> 5 |
6 | 7 |
8 | <%= f.input :name, label: false, placeholder: 'Nome' %> 9 | <%= f.input :phone, input_html:{ class: "mask-phone" }, label: false, placeholder: 'Telefone' %> 10 | <%= f.input :email, 11 | required: true, 12 | autofocus: true, 13 | label: false, 14 | placeholder: 'E-mail', 15 | input_html: { autocomplete: "email" }%> 16 | <%= f.input :password, 17 | required: true, 18 | label: false, 19 | placeholder: "senha no mínimo de #{@minimum_password_length} caracteres", 20 | input_html: { autocomplete: "new-password" } %> 21 | <%= f.input :password_confirmation, 22 | required: true, 23 | label: false, 24 | placeholder: 'Confirmar senha', 25 | input_html: { autocomplete: "new-password" } %> 26 |
27 | 28 | <%= render 'devise/shared/button_submit', f: f, text: 'Cadastrar' %> 29 | <% end %> 30 | 31 |
32 |
33 | <%= render "devise/shared/links" %> 34 |
35 |
36 | -------------------------------------------------------------------------------- /app/views/addresses/new.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 | <%= render 'settings/menu' %> 7 |
8 |
9 |
10 |
11 |
12 | <%= render 'layouts/shared/flash' if flash.present? %> 13 |

Novo endereço

14 | <%= simple_form_for @address, data: { turbo:false } do |f| %> 15 | <%= f.error_notification %> 16 | <%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %> 17 | 18 |
19 | <%= f.input :name, label: 'Nome' %> 20 | <%= f.input :street, label: 'Rua' %> 21 | <%= f.input :neighborhood, label: 'Bairro' %> 22 | <%= f.input :number, label: 'Número' %> 23 | <%= f.input :address_detail, label: 'Complemento' %> 24 | <%= f.input :zipcode, label: 'CEP' %> 25 | <%= f.input :city, label: 'Cidade' %> 26 | <%= f.input :state, label: 'Estado' %> 27 |
28 | 29 |
30 | <%= f.button :submit, 'Salvar', class: 'btn btn-primary' %> 31 |
32 | <% end %> 33 |
34 |
35 |
36 |
37 |
38 |
39 | -------------------------------------------------------------------------------- /app/views/layouts/admin/_sidebar.html.erb: -------------------------------------------------------------------------------- 1 | 49 | -------------------------------------------------------------------------------- /app/views/layouts/devise.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Ecommerce Showzim 5 | 6 | <%= csrf_meta_tags %> 7 | <%= csp_meta_tag %> 8 | 9 | <%= stylesheet_link_tag "devise", "data-turbo-track": "reload" %> 10 | 11 | 12 | <%= javascript_include_tag "devise", "data-turbo-track": "reload", defer: true %> 13 | 14 | 15 | 16 |
17 |
18 |
19 |
20 |

<%= link_to "Ecommerce Showzim", root_path %>

21 |
22 |
23 | 24 |
25 |
26 | 34 |
35 |
36 |
37 |
38 | 39 | 40 | -------------------------------------------------------------------------------- /app/views/admin/products/index.html.erb: -------------------------------------------------------------------------------- 1 |

<%= notice %>

2 | 3 |

Produtos

4 | 5 |
6 |
7 |
8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | <% @products.each do |product| %> 19 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | <% end %> 31 | 32 |
NomeDescriçãoPreçoAtivoAções
<%= product.name %><%= product.description %><%= product.price %><%= product.publish %> 25 | <%= link_to "Detalhes", admin_product_path(product), class: 'btn btn-dark' %> 26 | <%= link_to "Editar", edit_admin_product_path(product), data: { controller: 'admin-modal' }, class: 'btn btn-warning' %> 27 | <%= link_to "Excluir", admin_product_path(product), method: :delete, class: 'btn btn-danger', data: {turbo_method: :delete, turbo_confirm: 'Deseja realmente exlcuir?'} %> 28 |
33 | 34 | <%= link_to "Novo produto", new_admin_product_path, data: { controller: 'admin-modal' }, class: 'btn btn-primary' %> 35 |
36 |
37 |
38 |
39 | -------------------------------------------------------------------------------- /app/controllers/admin/products_controller.rb: -------------------------------------------------------------------------------- 1 | module Admin 2 | class ProductsController < BaseController 3 | before_action :set_product, only: %i[show edit update destroy] 4 | 5 | def index 6 | @products = Product.all 7 | end 8 | 9 | def edit; end 10 | 11 | def new 12 | @product = Product.new 13 | authorize @product 14 | rescue Pundit::NotAuthorizedError 15 | flash[:notice] = 'Você só pode cadastrar um produto se tiver uma categoria criada.' 16 | redirect_to action: :index 17 | end 18 | 19 | def show; end 20 | 21 | def create 22 | @product = Product.new(product_params) 23 | 24 | if @product.save 25 | redirect_to admin_products_path(@product), notice: 'Product criado com sucesso.' 26 | else 27 | render :new, status: :unprocessable_entity 28 | end 29 | end 30 | 31 | def update 32 | if @product.update(product_params) 33 | redirect_to admin_products_path(@product), notice: 'Produto criado com sucesso.' 34 | else 35 | render :edit, status: :unprocessable_entity 36 | end 37 | end 38 | 39 | def destroy 40 | @product.destroy 41 | 42 | respond_to do |format| 43 | format.html { redirect_to admin_products_path, notice: 'Produto excluída com sucesso.' } 44 | end 45 | end 46 | 47 | private 48 | 49 | def product_params 50 | params.require(:product).permit(:name, :description, :price, :publish, :image, :category_id, :promo, :promo_price) 51 | end 52 | 53 | def set_product 54 | @product = Product.find(params[:id]) 55 | end 56 | end 57 | end 58 | -------------------------------------------------------------------------------- /db/migrate/20221008003537_devise_create_users.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class DeviseCreateUsers < ActiveRecord::Migration[7.0] 4 | def change 5 | create_table :users do |t| 6 | ## Database authenticatable 7 | t.string :email, null: false, default: "" 8 | t.string :encrypted_password, null: false, default: "" 9 | 10 | ## Recoverable 11 | t.string :reset_password_token 12 | t.datetime :reset_password_sent_at 13 | 14 | ## Rememberable 15 | t.datetime :remember_created_at 16 | 17 | t.string :name 18 | t.string :phone 19 | 20 | ## Trackable 21 | # t.integer :sign_in_count, default: 0, null: false 22 | # t.datetime :current_sign_in_at 23 | # t.datetime :last_sign_in_at 24 | # t.string :current_sign_in_ip 25 | # t.string :last_sign_in_ip 26 | 27 | ## Confirmable 28 | # t.string :confirmation_token 29 | # t.datetime :confirmed_at 30 | # t.datetime :confirmation_sent_at 31 | # t.string :unconfirmed_email # Only if using reconfirmable 32 | 33 | ## Lockable 34 | # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts 35 | # t.string :unlock_token # Only if unlock strategy is :email or :both 36 | # t.datetime :locked_at 37 | 38 | 39 | t.timestamps null: false 40 | end 41 | 42 | add_index :users, :email, unique: true 43 | add_index :users, :reset_password_token, unique: true 44 | # add_index :users, :confirmation_token, unique: true 45 | # add_index :users, :unlock_token, unique: true 46 | end 47 | end 48 | -------------------------------------------------------------------------------- /app/controllers/admin/categories_controller.rb: -------------------------------------------------------------------------------- 1 | module Admin 2 | class CategoriesController < BaseController 3 | before_action :set_category, only: %i[show edit update destroy] 4 | 5 | # GET /categories or /categories.json 6 | def index 7 | @categories = Category.all 8 | end 9 | 10 | # GET /categories/1 or /categories/1.json 11 | def show; end 12 | 13 | # GET /categories/new 14 | def new 15 | @category = Category.new 16 | end 17 | 18 | # GET /categories/1/edit 19 | def edit; end 20 | 21 | # POST /categories or /categories.json 22 | def create 23 | @category = Category.new(category_params) 24 | 25 | if @category.save 26 | redirect_to admin_categories_path(@category), notice: 'Categoria criado com sucesso.' 27 | else 28 | render :new, status: :unprocessable_entity 29 | end 30 | end 31 | 32 | # PATCH/PUT /categories/1 or /categories/1.json 33 | def update 34 | if @category.update(category_params) 35 | redirect_to admin_categories_path(@category), notice: 'Categoria atualizado com sucesso.' 36 | else 37 | render :edit, status: :unprocessable_entity 38 | end 39 | end 40 | 41 | # DELETE /categories/1 or /categories/1.json 42 | def destroy 43 | @category.destroy 44 | 45 | respond_to do |format| 46 | format.html { redirect_to admin_categories_path, notice: 'Categoria excluída com sucesso.' } 47 | end 48 | end 49 | 50 | private 51 | 52 | def set_category 53 | @category = Category.find(params[:id]) 54 | end 55 | 56 | # Only allow a list of trusted parameters through. 57 | def category_params 58 | params.require(:category).permit(:name, :position) 59 | end 60 | end 61 | end 62 | -------------------------------------------------------------------------------- /app/views/addresses/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 | <%= render 'settings/menu' %> 7 |
8 |
9 |
10 |
11 |
12 | <%= render 'layouts/shared/flash' if flash.present? %> 13 |

Meus endereços

14 | <% if @addresses.any? %> 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | <% @addresses.each do |address| %> 27 | 28 | 29 | 30 | 31 | 32 | 36 | 37 | <% end %> 38 | 39 |
NomeRuaBairroNúmeroAções
<%= address.name %><%= address.street %><%= address.neighborhood %><%= address.number %> 33 | <%= link_to 'Detalhes', address_path(address), class: 'btn btn-secondary' %> 34 | <%= link_to 'Excluir', address_path(address), method: :delete, class: 'btn btn-danger' %> 35 |
40 | <% else %> 41 |
Nenhum endereço cadastrado.
42 | <% end %> 43 | <%= link_to "Novo endereço", new_address_path, class: 'btn btn-primary' %> 44 |
45 |
46 |
47 |
48 |
49 |
50 | -------------------------------------------------------------------------------- /public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We're sorry, but something went wrong (500) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

We're sorry, but something went wrong.

62 |
63 |

If you are the application owner check the logs for more information.

64 |
65 | 66 | 67 | -------------------------------------------------------------------------------- /config/puma.rb: -------------------------------------------------------------------------------- 1 | # Puma can serve each request in a thread from an internal thread pool. 2 | # The `threads` method setting takes two numbers: a minimum and maximum. 3 | # Any libraries that use thread pools should be configured to match 4 | # the maximum value specified for Puma. Default is set to 5 threads for minimum 5 | # and maximum; this matches the default thread size of Active Record. 6 | # 7 | max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } 8 | min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count } 9 | threads min_threads_count, max_threads_count 10 | 11 | # Specifies the `worker_timeout` threshold that Puma will use to wait before 12 | # terminating a worker in development environments. 13 | # 14 | worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development" 15 | 16 | # Specifies the `port` that Puma will listen on to receive requests; default is 3000. 17 | # 18 | port ENV.fetch("PORT") { 3000 } 19 | 20 | # Specifies the `environment` that Puma will run in. 21 | # 22 | environment ENV.fetch("RAILS_ENV") { "development" } 23 | 24 | # Specifies the `pidfile` that Puma will use. 25 | pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } 26 | 27 | # Specifies the number of `workers` to boot in clustered mode. 28 | # Workers are forked web server processes. If using threads and workers together 29 | # the concurrency of the application would be max `threads` * `workers`. 30 | # Workers do not work on JRuby or Windows (both of which do not support 31 | # processes). 32 | # 33 | # workers ENV.fetch("WEB_CONCURRENCY") { 2 } 34 | 35 | # Use the `preload_app!` method when specifying a `workers` number. 36 | # This directive tells Puma to first boot the application and load code 37 | # before forking the application. This takes advantage of Copy On Write 38 | # process behavior so workers use less memory. 39 | # 40 | # preload_app! 41 | 42 | # Allow puma to be restarted by `bin/rails restart` command. 43 | plugin :tmp_restart 44 | -------------------------------------------------------------------------------- /app/views/layouts/admin/_topbar.html.erb: -------------------------------------------------------------------------------- 1 | 44 | -------------------------------------------------------------------------------- /public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The change you wanted was rejected (422) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

The change you wanted was rejected.

62 |

Maybe you tried to change something you didn't have access to.

63 |
64 |

If you are the application owner check the logs for more information.

65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The page you were looking for doesn't exist (404) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

The page you were looking for doesn't exist.

62 |

You may have mistyped the address or the page may have moved.

63 |
64 |

If you are the application owner check the logs for more information.

65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /app/javascript/sbadmin/sbadmin.js: -------------------------------------------------------------------------------- 1 | (function($) { 2 | "use strict"; // Start of use strict 3 | 4 | // Toggle the side navigation 5 | $("#sidebarToggle, #sidebarToggleTop").on('click', function(e) { 6 | $("body").toggleClass("sidebar-toggled"); 7 | $(".sidebar").toggleClass("toggled"); 8 | if ($(".sidebar").hasClass("toggled")) { 9 | $('.sidebar .collapse').collapse('hide'); 10 | }; 11 | }); 12 | 13 | // Close any open menu accordions when window is resized below 768px 14 | $(window).resize(function() { 15 | if ($(window).width() < 768) { 16 | $('.sidebar .collapse').collapse('hide'); 17 | }; 18 | 19 | // Toggle the side navigation when window is resized below 480px 20 | if ($(window).width() < 480 && !$(".sidebar").hasClass("toggled")) { 21 | $("body").addClass("sidebar-toggled"); 22 | $(".sidebar").addClass("toggled"); 23 | $('.sidebar .collapse').collapse('hide'); 24 | }; 25 | }); 26 | 27 | // Prevent the content wrapper from scrolling when the fixed side navigation hovered over 28 | $('body.fixed-nav .sidebar').on('mousewheel DOMMouseScroll wheel', function(e) { 29 | if ($(window).width() > 768) { 30 | var e0 = e.originalEvent, 31 | delta = e0.wheelDelta || -e0.detail; 32 | this.scrollTop += (delta < 0 ? 1 : -1) * 30; 33 | e.preventDefault(); 34 | } 35 | }); 36 | 37 | // Scroll to top button appear 38 | $(document).on('scroll', function() { 39 | var scrollDistance = $(this).scrollTop(); 40 | if (scrollDistance > 100) { 41 | $('.scroll-to-top').fadeIn(); 42 | } else { 43 | $('.scroll-to-top').fadeOut(); 44 | } 45 | }); 46 | 47 | // Smooth scrolling using jQuery easing 48 | $(document).on('click', 'a.scroll-to-top', function(e) { 49 | var $anchor = $(this); 50 | $('html, body').stop().animate({ 51 | scrollTop: ($($anchor.attr('href')).offset().top) 52 | }, 1000, 'easeInOutExpo'); 53 | e.preventDefault(); 54 | }); 55 | 56 | })(jQuery); // End of use strict 57 | -------------------------------------------------------------------------------- /spec/models/user_spec.rb: -------------------------------------------------------------------------------- 1 | require 'rails_helper' 2 | 3 | RSpec.describe User, type: :model do 4 | context 'Espero validar os campos obrigatório' do 5 | it 'Valida o campo nome está presente' do 6 | user = build(:user) 7 | 8 | expect(user.valid?).to eq(true) 9 | end 10 | 11 | it 'valida o campo nome não está presente' do 12 | user = build(:user, name: nil) 13 | 14 | expect(user.valid?).to eq(false) 15 | end 16 | 17 | it 'Valida o campo telefone está presente' do 18 | user = build(:user) 19 | 20 | expect(user.valid?).to eq(true) 21 | end 22 | 23 | it 'valida o campo telefone não está presente' do 24 | user = build(:user, phone: nil) 25 | 26 | expect(user.valid?).to eq(false) 27 | end 28 | 29 | it 'Valida o campo email está presente' do 30 | user = build(:user) 31 | 32 | expect(user.valid?).to eq(true) 33 | end 34 | 35 | it 'valida o campo email não está presente' do 36 | user = build(:user, email: nil) 37 | 38 | expect(user.valid?).to eq(false) 39 | end 40 | 41 | it 'Valida o campo senha está presente' do 42 | user = build(:user) 43 | 44 | expect(user.valid?).to eq(true) 45 | end 46 | 47 | it 'valida o campo senha não está presente' do 48 | user = build(:user, password: nil) 49 | 50 | expect(user.valid?).to eq(false) 51 | end 52 | 53 | context 'Valida email' do 54 | it 'Validar email unicos' do 55 | user1 = create(:user) # user email: user1@gmail.com 56 | user2 = build(:user, email: user1.email) # user1@gmail.com 57 | 58 | expect(user2.valid?).to eq(false) 59 | end 60 | 61 | it 'Validar mensagem de erro para emails unicos' do 62 | user1 = create(:user) # user email: user1@gmail.com 63 | user2 = build(:user, email: user1.email) # user1@gmail.com 64 | 65 | user2.save 66 | 67 | expect(user2.valid?).to eq(false) 68 | expect(user2.errors.size).to be_positive 69 | end 70 | end 71 | end 72 | end 73 | -------------------------------------------------------------------------------- /db/migrate/20221112000829_create_active_storage_tables.active_storage.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from active_storage (originally 20170806125915) 2 | class CreateActiveStorageTables < ActiveRecord::Migration[5.2] 3 | def change 4 | # Use Active Record's configured type for primary and foreign keys 5 | primary_key_type, foreign_key_type = primary_and_foreign_key_types 6 | 7 | create_table :active_storage_blobs, id: primary_key_type do |t| 8 | t.string :key, null: false 9 | t.string :filename, null: false 10 | t.string :content_type 11 | t.text :metadata 12 | t.string :service_name, null: false 13 | t.bigint :byte_size, null: false 14 | t.string :checksum 15 | 16 | if connection.supports_datetime_with_precision? 17 | t.datetime :created_at, precision: 6, null: false 18 | else 19 | t.datetime :created_at, null: false 20 | end 21 | 22 | t.index [ :key ], unique: true 23 | end 24 | 25 | create_table :active_storage_attachments, id: primary_key_type do |t| 26 | t.string :name, null: false 27 | t.references :record, null: false, polymorphic: true, index: false, type: foreign_key_type 28 | t.references :blob, null: false, type: foreign_key_type 29 | 30 | if connection.supports_datetime_with_precision? 31 | t.datetime :created_at, precision: 6, null: false 32 | else 33 | t.datetime :created_at, null: false 34 | end 35 | 36 | t.index [ :record_type, :record_id, :name, :blob_id ], name: :index_active_storage_attachments_uniqueness, unique: true 37 | t.foreign_key :active_storage_blobs, column: :blob_id 38 | end 39 | 40 | create_table :active_storage_variant_records, id: primary_key_type do |t| 41 | t.belongs_to :blob, null: false, index: false, type: foreign_key_type 42 | t.string :variation_digest, null: false 43 | 44 | t.index [ :blob_id, :variation_digest ], name: :index_active_storage_variant_records_uniqueness, unique: true 45 | t.foreign_key :active_storage_blobs, column: :blob_id 46 | end 47 | end 48 | 49 | private 50 | def primary_and_foreign_key_types 51 | config = Rails.configuration.generators 52 | setting = config.options[config.orm][:primary_key_type] 53 | primary_key_type = setting || :primary_key 54 | foreign_key_type = setting || :bigint 55 | [primary_key_type, foreign_key_type] 56 | end 57 | end 58 | -------------------------------------------------------------------------------- /app/javascript/sbadmin/jquery-easing/jquery.easing.min.js: -------------------------------------------------------------------------------- 1 | (function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],function($){return factory($)})}else if(typeof module==="object"&&typeof module.exports==="object"){exports=factory(require("jquery"))}else{factory(jQuery)}})(function($){$.easing.jswing=$.easing.swing;var pow=Math.pow,sqrt=Math.sqrt,sin=Math.sin,cos=Math.cos,PI=Math.PI,c1=1.70158,c2=c1*1.525,c3=c1+1,c4=2*PI/3,c5=2*PI/4.5;function bounceOut(x){var n1=7.5625,d1=2.75;if(x<1/d1){return n1*x*x}else if(x<2/d1){return n1*(x-=1.5/d1)*x+.75}else if(x<2.5/d1){return n1*(x-=2.25/d1)*x+.9375}else{return n1*(x-=2.625/d1)*x+.984375}}$.extend($.easing,{def:"easeOutQuad",swing:function(x){return $.easing[$.easing.def](x)},easeInQuad:function(x){return x*x},easeOutQuad:function(x){return 1-(1-x)*(1-x)},easeInOutQuad:function(x){return x<.5?2*x*x:1-pow(-2*x+2,2)/2},easeInCubic:function(x){return x*x*x},easeOutCubic:function(x){return 1-pow(1-x,3)},easeInOutCubic:function(x){return x<.5?4*x*x*x:1-pow(-2*x+2,3)/2},easeInQuart:function(x){return x*x*x*x},easeOutQuart:function(x){return 1-pow(1-x,4)},easeInOutQuart:function(x){return x<.5?8*x*x*x*x:1-pow(-2*x+2,4)/2},easeInQuint:function(x){return x*x*x*x*x},easeOutQuint:function(x){return 1-pow(1-x,5)},easeInOutQuint:function(x){return x<.5?16*x*x*x*x*x:1-pow(-2*x+2,5)/2},easeInSine:function(x){return 1-cos(x*PI/2)},easeOutSine:function(x){return sin(x*PI/2)},easeInOutSine:function(x){return-(cos(PI*x)-1)/2},easeInExpo:function(x){return x===0?0:pow(2,10*x-10)},easeOutExpo:function(x){return x===1?1:1-pow(2,-10*x)},easeInOutExpo:function(x){return x===0?0:x===1?1:x<.5?pow(2,20*x-10)/2:(2-pow(2,-20*x+10))/2},easeInCirc:function(x){return 1-sqrt(1-pow(x,2))},easeOutCirc:function(x){return sqrt(1-pow(x-1,2))},easeInOutCirc:function(x){return x<.5?(1-sqrt(1-pow(2*x,2)))/2:(sqrt(1-pow(-2*x+2,2))+1)/2},easeInElastic:function(x){return x===0?0:x===1?1:-pow(2,10*x-10)*sin((x*10-10.75)*c4)},easeOutElastic:function(x){return x===0?0:x===1?1:pow(2,-10*x)*sin((x*10-.75)*c4)+1},easeInOutElastic:function(x){return x===0?0:x===1?1:x<.5?-(pow(2,20*x-10)*sin((20*x-11.125)*c5))/2:pow(2,-20*x+10)*sin((20*x-11.125)*c5)/2+1},easeInBack:function(x){return c3*x*x*x-c1*x*x},easeOutBack:function(x){return 1+c3*pow(x-1,3)+c1*pow(x-1,2)},easeInOutBack:function(x){return x<.5?pow(2*x,2)*((c2+1)*2*x-c2)/2:(pow(2*x-2,2)*((c2+1)*(x*2-2)+c2)+2)/2},easeInBounce:function(x){return 1-bounceOut(1-x)},easeOutBounce:bounceOut,easeInOutBounce:function(x){return x<.5?(1-bounceOut(1-2*x))/2:(1+bounceOut(2*x-1))/2}})}); -------------------------------------------------------------------------------- /config/environments/test.rb: -------------------------------------------------------------------------------- 1 | require "active_support/core_ext/integer/time" 2 | 3 | # The test environment is used exclusively to run your application's 4 | # test suite. You never need to work with it otherwise. Remember that 5 | # your test database is "scratch space" for the test suite and is wiped 6 | # and recreated between test runs. Don't rely on the data there! 7 | 8 | Rails.application.configure do 9 | # Settings specified here will take precedence over those in config/application.rb. 10 | 11 | # Turn false under Spring and add config.action_view.cache_template_loading = true. 12 | config.cache_classes = true 13 | 14 | # Eager loading loads your whole application. When running a single test locally, 15 | # this probably isn't necessary. It's a good idea to do in a continuous integration 16 | # system, or in some way before deploying your code. 17 | config.eager_load = ENV["CI"].present? 18 | 19 | # Configure public file server for tests with Cache-Control for performance. 20 | config.public_file_server.enabled = true 21 | config.public_file_server.headers = { 22 | "Cache-Control" => "public, max-age=#{1.hour.to_i}" 23 | } 24 | 25 | # Show full error reports and disable caching. 26 | config.consider_all_requests_local = true 27 | config.action_controller.perform_caching = false 28 | config.cache_store = :null_store 29 | 30 | # Raise exceptions instead of rendering exception templates. 31 | config.action_dispatch.show_exceptions = false 32 | 33 | # Disable request forgery protection in test environment. 34 | config.action_controller.allow_forgery_protection = false 35 | 36 | # Store uploaded files on the local file system in a temporary directory. 37 | config.active_storage.service = :test 38 | 39 | config.action_mailer.perform_caching = false 40 | 41 | # Tell Action Mailer not to deliver emails to the real world. 42 | # The :test delivery method accumulates sent emails in the 43 | # ActionMailer::Base.deliveries array. 44 | config.action_mailer.delivery_method = :test 45 | 46 | # Print deprecation notices to the stderr. 47 | config.active_support.deprecation = :stderr 48 | 49 | # Raise exceptions for disallowed deprecations. 50 | config.active_support.disallowed_deprecation = :raise 51 | 52 | # Tell Active Support which deprecation messages to disallow. 53 | config.active_support.disallowed_deprecation_warnings = [] 54 | 55 | # Raises error for missing translations. 56 | # config.i18n.raise_on_missing_translations = true 57 | 58 | # Annotate rendered view with file names. 59 | # config.action_view.annotate_rendered_view_with_filenames = true 60 | end 61 | -------------------------------------------------------------------------------- /config/environments/development.rb: -------------------------------------------------------------------------------- 1 | require "active_support/core_ext/integer/time" 2 | 3 | Rails.application.configure do 4 | # Settings specified here will take precedence over those in config/application.rb. 5 | 6 | # In the development environment your application's code is reloaded any time 7 | # it changes. This slows down response time but is perfect for development 8 | # since you don't have to restart the web server when you make code changes. 9 | config.cache_classes = false 10 | 11 | # Do not eager load code on boot. 12 | config.eager_load = false 13 | 14 | # Show full error reports. 15 | config.consider_all_requests_local = true 16 | 17 | # Enable server timing 18 | config.server_timing = true 19 | 20 | # Enable/disable caching. By default caching is disabled. 21 | # Run rails dev:cache to toggle caching. 22 | if Rails.root.join("tmp/caching-dev.txt").exist? 23 | config.action_controller.perform_caching = true 24 | config.action_controller.enable_fragment_cache_logging = true 25 | 26 | config.cache_store = :memory_store 27 | config.public_file_server.headers = { 28 | "Cache-Control" => "public, max-age=#{2.days.to_i}" 29 | } 30 | else 31 | config.action_controller.perform_caching = false 32 | 33 | config.cache_store = :null_store 34 | end 35 | 36 | # Store uploaded files on the local file system (see config/storage.yml for options). 37 | config.active_storage.service = :local 38 | 39 | # Don't care if the mailer can't send. 40 | config.action_mailer.raise_delivery_errors = false 41 | 42 | config.action_mailer.perform_caching = false 43 | 44 | # Print deprecation notices to the Rails logger. 45 | config.active_support.deprecation = :log 46 | 47 | # Raise exceptions for disallowed deprecations. 48 | config.active_support.disallowed_deprecation = :raise 49 | 50 | # Tell Active Support which deprecation messages to disallow. 51 | config.active_support.disallowed_deprecation_warnings = [] 52 | 53 | # Raise an error on page load if there are pending migrations. 54 | config.active_record.migration_error = :page_load 55 | 56 | # Highlight code that triggered database queries in logs. 57 | config.active_record.verbose_query_logs = true 58 | 59 | # Suppress logger output for asset requests. 60 | config.assets.quiet = true 61 | 62 | config.action_mailer.default_url_options = { host: 'localhost', port: 3000 } 63 | # Raises error for missing translations. 64 | # config.i18n.raise_on_missing_translations = true 65 | 66 | # Annotate rendered view with file names. 67 | # config.action_view.annotate_rendered_view_with_filenames = true 68 | 69 | # Uncomment if you wish to allow Action Cable access from any origin. 70 | # config.action_cable.disable_request_forgery_protection = true 71 | end 72 | -------------------------------------------------------------------------------- /app/views/home/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |

Sua loja virtual preferida

5 |

Aqui vai ser o slogan

6 |
7 |
8 |
9 | 10 |
11 |
12 |
13 | <% @products.each do |product| %> 14 |
15 |
16 | <% if product.promo? %> 17 |
Promo
18 | <% end %> 19 | 20 | <%= image_tag product.image.variant(:thumb), class: 'card-img-top' %> 21 | 22 |
23 |
24 | 25 |
<%= product.name %>
26 | 27 | <%= product.price %> 28 |
29 |
30 | 31 | 34 |
35 |
36 | <% end %> 37 | 60 |
61 |
62 |
63 | 64 | -------------------------------------------------------------------------------- /app/assets/images/undraw_profile.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 11 | 12 | 13 | 17 | 19 | 20 | 23 | 25 | 27 | 29 | 31 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | git_source(:github) { |repo| "https://github.com/#{repo}.git" } 3 | 4 | ruby "3.1.2" 5 | 6 | # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" 7 | gem "rails", "~> 7.0.4" 8 | 9 | # The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] 10 | gem "sprockets-rails" 11 | 12 | # Use pg as the database for Active Record 13 | gem "pg" 14 | 15 | # Use the Puma web server [https://github.com/puma/puma] 16 | gem "puma", "~> 5.0" 17 | 18 | # Bundle and transpile JavaScript [https://github.com/rails/jsbundling-rails] 19 | gem "jsbundling-rails" 20 | 21 | # Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev] 22 | gem "turbo-rails" 23 | 24 | # Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev] 25 | gem "stimulus-rails" 26 | 27 | # Bundle and process CSS [https://github.com/rails/cssbundling-rails] 28 | gem "cssbundling-rails" 29 | 30 | # Build JSON APIs with ease [https://github.com/rails/jbuilder] 31 | gem "jbuilder" 32 | 33 | gem 'devise' 34 | 35 | gem 'simple_form' 36 | 37 | gem 'pundit' 38 | 39 | gem "aws-sdk-s3" 40 | gem "image_processing", ">= 1.2" 41 | 42 | # Use Redis adapter to run Action Cable in production 43 | # gem "redis", "~> 4.0" 44 | 45 | # Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis] 46 | # gem "kredis" 47 | 48 | # Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword] 49 | # gem "bcrypt", "~> 3.1.7" 50 | 51 | # Windows does not include zoneinfo files, so bundle the tzinfo-data gem 52 | gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ] 53 | 54 | # Reduces boot times through caching; required in config/boot.rb 55 | gem "bootsnap", require: false 56 | 57 | # Use Sass to process CSS 58 | # gem "sassc-rails" 59 | 60 | # Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images] 61 | # gem "image_processing", "~> 1.2" 62 | 63 | group :development, :test do 64 | # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem 65 | gem "debug", platforms: %i[ mri mingw x64_mingw ] 66 | gem 'awesome_print' 67 | gem 'dotenv-rails' 68 | gem 'factory_bot_rails' 69 | gem 'faker' 70 | gem 'pry-rails' 71 | gem 'rspec-rails' 72 | gem 'rubocop' 73 | end 74 | 75 | group :development do 76 | # Use console on exceptions pages [https://github.com/rails/web-console] 77 | gem "web-console" 78 | 79 | # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler] 80 | # gem "rack-mini-profiler" 81 | 82 | # Speed up commands on slow machines / big apps [https://github.com/rails/spring] 83 | # gem "spring" 84 | end 85 | 86 | group :test do 87 | # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing] 88 | gem "capybara" 89 | gem "selenium-webdriver" 90 | gem "webdrivers" 91 | gem 'webmock' 92 | gem 'database_cleaner' 93 | gem 'shoulda-matchers' 94 | gem 'simplecov' 95 | gem 'vcr' 96 | end 97 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # README 2 | 3 | Este projeto esta sendo desenvolvido em live no meu canal https://twitch.tv/progshowzim 4 | 5 | # Configurando o sistema 6 | Para configurar o sistema no seu computador você precisa do ruby, node e yarn configurado no seu computador. 7 | 8 | Para ruby eu costumo usar o asdf como gerenciador de ruby e node. Mas você pode isntalar o gerenciador que estiver mais familiarizado. 9 | 10 | Ruby: 3.1.2 11 | Rails 7.0.2 12 | Node: 16+ 13 | Yarn: 1.22+ 14 | Libvips: https://installati.one/ubuntu/20.04/libvips-dev/ 15 | 16 | Siga os passos abaixo para configurar o sistema no seu computador. 17 | 1. Instalar todas as dependências assets: `yarn install` 18 | 2. Instalar todas as dependências do rails (gems): `bundle install` 19 | 3. Configure o arquivo `database.yml` que está na pasta config com seu usuário e senha. 20 | 4. Com o banco de dados configurado gere os bancos: `rails db:create` 21 | 5. Agora execute as migrações: `rails db:migrate` 22 | 6. Fim 23 | 24 | # Iniciando o projeto 25 | Agora com tudo configurado, basta executa `bin/dev` 26 | 27 | ## Fluxos do sistema: 28 | https://whimsical.com/e-commerce-showzim-LzJQQLaeREuubiZSkCMmC5 29 | 30 | ## Templates 31 | 32 | https://startbootstrap.com/template/shop-homepage 33 | https://startbootstrap.com/template/shop-item 34 | https://colorlib.com/wp/template/login-form-11/ 35 | Design do perfil - https://cdn.dribbble.com/users/5015889/screenshots/14032312/media/90a535d6824b058c0476f0324ee7ae9c.png 36 | 37 | # modelagem 38 | https://dbdiagram.io/d/63645030c9abfc611170313f 39 | 40 | ### Usando com docker 41 | 42 | 1. Create file `.env` and `env.test` off file `.env.sample`. 43 | 44 | 2. Add values in the variables empties 45 | 46 | 3. Add value below on file `.env` 47 | 48 | ```yml 49 | DATABASE_URL=postgres://postgres:postgres@db:5432/projeto_development 50 | ``` 51 | 52 | 4. Add value below on file `.env.test` 53 | 54 | ```yml 55 | DATABASE_URL=postgres://postgres:postgres@db:5432/projeto_test 56 | ``` 57 | 58 | 5. Create file `.env.sidekiq` and add values below: 59 | ``` 60 | REDIS_URL=redis://redis:6379/0 61 | SIDEKIQ_WORKERS=5 62 | DATABASE_URL=postgres://postgres:postgres@db:5432/projeto_development 63 | ``` 64 | 6. Execute the command below for build image 65 | ``` 66 | docker-compose up -d --no-deps --build app 67 | ``` 68 | 7. Execute the command below for start project 69 | ``` 70 | docker compose up -d 71 | ``` 72 | 8. Execute the command below for access bash 73 | ``` 74 | docker compose run --rm app bash 75 | ``` 76 | 9. Execute the command below for create database 77 | ``` 78 | rails db:create 79 | ``` 80 | 10. Execute the command below for migration database 81 | ``` 82 | rails db:migrate 83 | ``` 84 | 11. Execute the command below for populate database 85 | ``` 86 | rails db:seed 87 | ``` 88 | 89 | # Command extras 90 | Reset stats sidekiq 91 | ``` 92 | Sidekiq::Stats.new.reset 93 | ``` 94 | For the test rspec, execute the command below 95 | ``` 96 | ENV_FILE=.env.test docker compose run --rm app rspec 97 | ``` 98 | For execute rubocop 99 | ``` 100 | docker compose run --rm app rubocop 101 | ``` 102 | For debug with binding.pry 103 | ``` 104 | docker attach --detach-keys="ctrl-c" 105 | ``` 106 | -------------------------------------------------------------------------------- /bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | # 5 | # This file was generated by Bundler. 6 | # 7 | # The application 'bundle' is installed as part of a gem, and 8 | # this file is here to facilitate running it. 9 | # 10 | 11 | require "rubygems" 12 | 13 | m = Module.new do 14 | module_function 15 | 16 | def invoked_as_script? 17 | File.expand_path($0) == File.expand_path(__FILE__) 18 | end 19 | 20 | def env_var_version 21 | ENV["BUNDLER_VERSION"] 22 | end 23 | 24 | def cli_arg_version 25 | return unless invoked_as_script? # don't want to hijack other binstubs 26 | return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update` 27 | bundler_version = nil 28 | update_index = nil 29 | ARGV.each_with_index do |a, i| 30 | if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN 31 | bundler_version = a 32 | end 33 | next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/ 34 | bundler_version = $1 35 | update_index = i 36 | end 37 | bundler_version 38 | end 39 | 40 | def gemfile 41 | gemfile = ENV["BUNDLE_GEMFILE"] 42 | return gemfile if gemfile && !gemfile.empty? 43 | 44 | File.expand_path("../../Gemfile", __FILE__) 45 | end 46 | 47 | def lockfile 48 | lockfile = 49 | case File.basename(gemfile) 50 | when "gems.rb" then gemfile.sub(/\.rb$/, gemfile) 51 | else "#{gemfile}.lock" 52 | end 53 | File.expand_path(lockfile) 54 | end 55 | 56 | def lockfile_version 57 | return unless File.file?(lockfile) 58 | lockfile_contents = File.read(lockfile) 59 | return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/ 60 | Regexp.last_match(1) 61 | end 62 | 63 | def bundler_requirement 64 | @bundler_requirement ||= 65 | env_var_version || cli_arg_version || 66 | bundler_requirement_for(lockfile_version) 67 | end 68 | 69 | def bundler_requirement_for(version) 70 | return "#{Gem::Requirement.default}.a" unless version 71 | 72 | bundler_gem_version = Gem::Version.new(version) 73 | 74 | requirement = bundler_gem_version.approximate_recommendation 75 | 76 | return requirement unless Gem.rubygems_version < Gem::Version.new("2.7.0") 77 | 78 | requirement += ".a" if bundler_gem_version.prerelease? 79 | 80 | requirement 81 | end 82 | 83 | def load_bundler! 84 | ENV["BUNDLE_GEMFILE"] ||= gemfile 85 | 86 | activate_bundler 87 | end 88 | 89 | def activate_bundler 90 | gem_error = activation_error_handling do 91 | gem "bundler", bundler_requirement 92 | end 93 | return if gem_error.nil? 94 | require_error = activation_error_handling do 95 | require "bundler/version" 96 | end 97 | return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION)) 98 | warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`" 99 | exit 42 100 | end 101 | 102 | def activation_error_handling 103 | yield 104 | nil 105 | rescue StandardError, LoadError => e 106 | e 107 | end 108 | end 109 | 110 | m.load_bundler! 111 | 112 | if m.invoked_as_script? 113 | load Gem.bin_path("bundler", "bundle") 114 | end 115 | -------------------------------------------------------------------------------- /app/views/admin/home/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 |

Dashboard

3 |
4 | 5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | Earnings (Monthly)
13 |
$40,000
14 |
15 |
16 | 17 |
18 |
19 |
20 |
21 |
22 | 23 | 24 |
25 |
26 |
27 |
28 |
29 |
30 | Earnings (Annual)
31 |
$215,000
32 |
33 |
34 | 35 |
36 |
37 |
38 |
39 |
40 | 41 | 42 |
43 |
44 |
45 |
46 |
47 |
Tasks 48 |
49 |
50 |
51 |
50%
52 |
53 |
54 |
55 |
58 |
59 |
60 |
61 |
62 |
63 | 64 |
65 |
66 |
67 |
68 |
69 | 70 | 71 |
72 |
73 |
74 |
75 |
76 |
77 | Pending Requests
78 |
18
79 |
80 |
81 | 82 |
83 |
84 |
85 |
86 |
87 |
88 | -------------------------------------------------------------------------------- /config/environments/production.rb: -------------------------------------------------------------------------------- 1 | require "active_support/core_ext/integer/time" 2 | 3 | Rails.application.configure do 4 | # Settings specified here will take precedence over those in config/application.rb. 5 | 6 | # Code is not reloaded between requests. 7 | config.cache_classes = true 8 | 9 | # Eager load code on boot. This eager loads most of Rails and 10 | # your application in memory, allowing both threaded web servers 11 | # and those relying on copy on write to perform better. 12 | # Rake tasks automatically ignore this option for performance. 13 | config.eager_load = true 14 | 15 | # Full error reports are disabled and caching is turned on. 16 | config.consider_all_requests_local = false 17 | config.action_controller.perform_caching = true 18 | 19 | # config.active_storage.service = :amazon 20 | 21 | # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] 22 | # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). 23 | # config.require_master_key = true 24 | 25 | # Disable serving static files from the `/public` folder by default since 26 | # Apache or NGINX already handles this. 27 | config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? 28 | 29 | # Compress CSS using a preprocessor. 30 | # config.assets.css_compressor = :sass 31 | 32 | # Do not fallback to assets pipeline if a precompiled asset is missed. 33 | config.assets.compile = false 34 | 35 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. 36 | # config.asset_host = "http://assets.example.com" 37 | 38 | # Specifies the header that your server uses for sending files. 39 | # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache 40 | # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX 41 | 42 | # Store uploaded files on the local file system (see config/storage.yml for options). 43 | config.active_storage.service = :local 44 | 45 | # Mount Action Cable outside main process or domain. 46 | # config.action_cable.mount_path = nil 47 | # config.action_cable.url = "wss://example.com/cable" 48 | # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ] 49 | 50 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 51 | # config.force_ssl = true 52 | 53 | # Include generic and useful information about system operation, but avoid logging too much 54 | # information to avoid inadvertent exposure of personally identifiable information (PII). 55 | config.log_level = :info 56 | 57 | # Prepend all log lines with the following tags. 58 | config.log_tags = [ :request_id ] 59 | 60 | # Use a different cache store in production. 61 | # config.cache_store = :mem_cache_store 62 | 63 | # Use a real queuing backend for Active Job (and separate queues per environment). 64 | # config.active_job.queue_adapter = :resque 65 | # config.active_job.queue_name_prefix = "ecommerce_showzim_production" 66 | 67 | config.action_mailer.perform_caching = false 68 | 69 | # Ignore bad email addresses and do not raise email delivery errors. 70 | # Set this to true and configure the email server for immediate delivery to raise delivery errors. 71 | # config.action_mailer.raise_delivery_errors = false 72 | 73 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 74 | # the I18n.default_locale when a translation cannot be found). 75 | config.i18n.fallbacks = true 76 | 77 | # Don't log any deprecations. 78 | config.active_support.report_deprecations = false 79 | 80 | # Use default logging formatter so that PID and timestamp are not suppressed. 81 | config.log_formatter = ::Logger::Formatter.new 82 | 83 | # Use a different logger for distributed setups. 84 | # require "syslog/logger" 85 | # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name") 86 | 87 | if ENV["RAILS_LOG_TO_STDOUT"].present? 88 | logger = ActiveSupport::Logger.new(STDOUT) 89 | logger.formatter = config.log_formatter 90 | config.logger = ActiveSupport::TaggedLogging.new(logger) 91 | end 92 | 93 | # Do not dump schema after migrations. 94 | config.active_record.dump_schema_after_migration = false 95 | end 96 | -------------------------------------------------------------------------------- /config/locales/devise.en.yml: -------------------------------------------------------------------------------- 1 | # Additional translations at https://github.com/heartcombo/devise/wiki/I18n 2 | 3 | en: 4 | devise: 5 | confirmations: 6 | confirmed: "Your email address has been successfully confirmed." 7 | send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes." 8 | send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes." 9 | failure: 10 | already_authenticated: "You are already signed in." 11 | inactive: "Your account is not activated yet." 12 | invalid: "Invalid %{authentication_keys} or password." 13 | locked: "Your account is locked." 14 | last_attempt: "You have one more attempt before your account is locked." 15 | not_found_in_database: "Invalid %{authentication_keys} or password." 16 | timeout: "Your session expired. Please sign in again to continue." 17 | unauthenticated: "You need to sign in or sign up before continuing." 18 | unconfirmed: "You have to confirm your email address before continuing." 19 | mailer: 20 | confirmation_instructions: 21 | subject: "Confirmation instructions" 22 | reset_password_instructions: 23 | subject: "Reset password instructions" 24 | unlock_instructions: 25 | subject: "Unlock instructions" 26 | email_changed: 27 | subject: "Email Changed" 28 | password_change: 29 | subject: "Password Changed" 30 | omniauth_callbacks: 31 | failure: "Could not authenticate you from %{kind} because \"%{reason}\"." 32 | success: "Successfully authenticated from %{kind} account." 33 | passwords: 34 | no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided." 35 | send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes." 36 | send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes." 37 | updated: "Your password has been changed successfully. You are now signed in." 38 | updated_not_active: "Your password has been changed successfully." 39 | registrations: 40 | destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon." 41 | signed_up: "Welcome! You have signed up successfully." 42 | signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated." 43 | signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked." 44 | signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account." 45 | update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirmation link to confirm your new email address." 46 | updated: "Your account has been updated successfully." 47 | updated_but_not_signed_in: "Your account has been updated successfully, but since your password was changed, you need to sign in again." 48 | sessions: 49 | signed_in: "Signed in successfully." 50 | signed_out: "Signed out successfully." 51 | already_signed_out: "Signed out successfully." 52 | unlocks: 53 | send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes." 54 | send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes." 55 | unlocked: "Your account has been unlocked successfully. Please sign in to continue." 56 | errors: 57 | messages: 58 | already_confirmed: "was already confirmed, please try signing in" 59 | confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one" 60 | expired: "has expired, please request a new one" 61 | not_found: "not found" 62 | not_locked: "was not locked" 63 | not_saved: 64 | one: "1 error prohibited this %{resource} from being saved:" 65 | other: "%{count} errors prohibited this %{resource} from being saved:" 66 | -------------------------------------------------------------------------------- /db/schema.rb: -------------------------------------------------------------------------------- 1 | # This file is auto-generated from the current state of the database. Instead 2 | # of editing this file, please use the migrations feature of Active Record to 3 | # incrementally modify your database, and then regenerate this schema definition. 4 | # 5 | # This file is the source Rails uses to define your schema when running `bin/rails 6 | # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to 7 | # be faster and is potentially less error prone than running all of your 8 | # migrations from scratch. Old migrations may fail to apply correctly if those 9 | # migrations use external dependencies or application code. 10 | # 11 | # It's strongly recommended that you check this file into your version control system. 12 | 13 | ActiveRecord::Schema[7.0].define(version: 2023_02_04_002530) do 14 | # These are extensions that must be enabled in order to support this database 15 | enable_extension "plpgsql" 16 | 17 | # Custom types defined in this database. 18 | # Note that some types may not work with other database engines. Be careful if changing database. 19 | create_enum "role_user", ["user", "admin"] 20 | 21 | create_table "active_storage_attachments", force: :cascade do |t| 22 | t.string "name", null: false 23 | t.string "record_type", null: false 24 | t.bigint "record_id", null: false 25 | t.bigint "blob_id", null: false 26 | t.datetime "created_at", null: false 27 | t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id" 28 | t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true 29 | end 30 | 31 | create_table "active_storage_blobs", force: :cascade do |t| 32 | t.string "key", null: false 33 | t.string "filename", null: false 34 | t.string "content_type" 35 | t.text "metadata" 36 | t.string "service_name", null: false 37 | t.bigint "byte_size", null: false 38 | t.string "checksum" 39 | t.datetime "created_at", null: false 40 | t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true 41 | end 42 | 43 | create_table "active_storage_variant_records", force: :cascade do |t| 44 | t.bigint "blob_id", null: false 45 | t.string "variation_digest", null: false 46 | t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true 47 | end 48 | 49 | create_table "addresses", force: :cascade do |t| 50 | t.string "name", null: false 51 | t.string "street", null: false 52 | t.string "neighborhood", null: false 53 | t.string "number", null: false 54 | t.string "address_detail" 55 | t.string "zipcode", null: false 56 | t.string "city", null: false 57 | t.string "state", null: false 58 | t.bigint "user_id", null: false 59 | t.datetime "created_at", null: false 60 | t.datetime "updated_at", null: false 61 | t.index ["user_id"], name: "index_addresses_on_user_id" 62 | end 63 | 64 | create_table "categories", force: :cascade do |t| 65 | t.string "name" 66 | t.integer "position" 67 | t.datetime "created_at", null: false 68 | t.datetime "updated_at", null: false 69 | end 70 | 71 | create_table "products", force: :cascade do |t| 72 | t.string "name", null: false 73 | t.text "description", null: false 74 | t.decimal "price", precision: 8, scale: 2, null: false 75 | t.boolean "publish", default: false, null: false 76 | t.bigint "category_id", null: false 77 | t.datetime "created_at", null: false 78 | t.datetime "updated_at", null: false 79 | t.boolean "promo", default: false 80 | t.decimal "promo_price", default: "0.0" 81 | t.index ["category_id"], name: "index_products_on_category_id" 82 | end 83 | 84 | create_table "users", force: :cascade do |t| 85 | t.string "email", default: "", null: false 86 | t.string "encrypted_password", default: "", null: false 87 | t.string "reset_password_token" 88 | t.datetime "reset_password_sent_at" 89 | t.datetime "remember_created_at" 90 | t.string "name" 91 | t.string "phone" 92 | t.datetime "created_at", null: false 93 | t.datetime "updated_at", null: false 94 | t.enum "role", default: "user", null: false, enum_type: "role_user" 95 | t.index ["email"], name: "index_users_on_email", unique: true 96 | t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true 97 | end 98 | 99 | add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id" 100 | add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id" 101 | add_foreign_key "addresses", "users" 102 | add_foreign_key "products", "categories" 103 | end 104 | -------------------------------------------------------------------------------- /spec/requests/categories_spec.rb: -------------------------------------------------------------------------------- 1 | require 'rails_helper' 2 | 3 | # This spec was generated by rspec-rails when you ran the scaffold generator. 4 | # It demonstrates how one might use RSpec to test the controller code that 5 | # was generated by Rails when you ran the scaffold generator. 6 | # 7 | # It assumes that the implementation code is generated by the rails scaffold 8 | # generator. If you are using any extension libraries to generate different 9 | # controller code, this generated spec may or may not pass. 10 | # 11 | # It only uses APIs available in rails and/or rspec-rails. There are a number 12 | # of tools you can use to make these specs even more expressive, but we're 13 | # sticking to rails and rspec-rails APIs to keep things simple and stable. 14 | 15 | RSpec.describe "/categories", type: :request do 16 | 17 | # This should return the minimal set of attributes required to create a valid 18 | # Category. As you add validations to Category, be sure to 19 | # adjust the attributes here as well. 20 | let(:valid_attributes) { 21 | skip("Add a hash of attributes valid for your model") 22 | } 23 | 24 | let(:invalid_attributes) { 25 | skip("Add a hash of attributes invalid for your model") 26 | } 27 | 28 | describe "GET /index" do 29 | it "renders a successful response" do 30 | Category.create! valid_attributes 31 | get categories_url 32 | expect(response).to be_successful 33 | end 34 | end 35 | 36 | describe "GET /show" do 37 | it "renders a successful response" do 38 | category = Category.create! valid_attributes 39 | get category_url(category) 40 | expect(response).to be_successful 41 | end 42 | end 43 | 44 | describe "GET /new" do 45 | it "renders a successful response" do 46 | get new_category_url 47 | expect(response).to be_successful 48 | end 49 | end 50 | 51 | describe "GET /edit" do 52 | it "renders a successful response" do 53 | category = Category.create! valid_attributes 54 | get edit_category_url(category) 55 | expect(response).to be_successful 56 | end 57 | end 58 | 59 | describe "POST /create" do 60 | context "with valid parameters" do 61 | it "creates a new Category" do 62 | expect { 63 | post categories_url, params: { category: valid_attributes } 64 | }.to change(Category, :count).by(1) 65 | end 66 | 67 | it "redirects to the created category" do 68 | post categories_url, params: { category: valid_attributes } 69 | expect(response).to redirect_to(category_url(Category.last)) 70 | end 71 | end 72 | 73 | context "with invalid parameters" do 74 | it "does not create a new Category" do 75 | expect { 76 | post categories_url, params: { category: invalid_attributes } 77 | }.to change(Category, :count).by(0) 78 | end 79 | 80 | it "renders a successful response (i.e. to display the 'new' template)" do 81 | post categories_url, params: { category: invalid_attributes } 82 | expect(response).to be_successful 83 | end 84 | end 85 | end 86 | 87 | describe "PATCH /update" do 88 | context "with valid parameters" do 89 | let(:new_attributes) { 90 | skip("Add a hash of attributes valid for your model") 91 | } 92 | 93 | it "updates the requested category" do 94 | category = Category.create! valid_attributes 95 | patch category_url(category), params: { category: new_attributes } 96 | category.reload 97 | skip("Add assertions for updated state") 98 | end 99 | 100 | it "redirects to the category" do 101 | category = Category.create! valid_attributes 102 | patch category_url(category), params: { category: new_attributes } 103 | category.reload 104 | expect(response).to redirect_to(category_url(category)) 105 | end 106 | end 107 | 108 | context "with invalid parameters" do 109 | it "renders a successful response (i.e. to display the 'edit' template)" do 110 | category = Category.create! valid_attributes 111 | patch category_url(category), params: { category: invalid_attributes } 112 | expect(response).to be_successful 113 | end 114 | end 115 | end 116 | 117 | describe "DELETE /destroy" do 118 | it "destroys the requested category" do 119 | category = Category.create! valid_attributes 120 | expect { 121 | delete category_url(category) 122 | }.to change(Category, :count).by(-1) 123 | end 124 | 125 | it "redirects to the categories list" do 126 | category = Category.create! valid_attributes 127 | delete category_url(category) 128 | expect(response).to redirect_to(categories_url) 129 | end 130 | end 131 | end 132 | -------------------------------------------------------------------------------- /config/initializers/simple_form.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # 3 | # Uncomment this and change the path if necessary to include your own 4 | # components. 5 | # See https://github.com/heartcombo/simple_form#custom-components to know 6 | # more about custom components. 7 | # Dir[Rails.root.join('lib/components/**/*.rb')].each { |f| require f } 8 | # 9 | # Use this setup block to configure all options available in SimpleForm. 10 | SimpleForm.setup do |config| 11 | # Wrappers are used by the form builder to generate a 12 | # complete input. You can remove any component from the 13 | # wrapper, change the order or even add your own to the 14 | # stack. The options given below are used to wrap the 15 | # whole input. 16 | config.wrappers :default, class: :input, 17 | hint_class: :field_with_hint, error_class: :field_with_errors, valid_class: :field_without_errors do |b| 18 | ## Extensions enabled by default 19 | # Any of these extensions can be disabled for a 20 | # given input by passing: `f.input EXTENSION_NAME => false`. 21 | # You can make any of these extensions optional by 22 | # renaming `b.use` to `b.optional`. 23 | 24 | # Determines whether to use HTML5 (:email, :url, ...) 25 | # and required attributes 26 | b.use :html5 27 | 28 | # Calculates placeholders automatically from I18n 29 | # You can also pass a string as f.input placeholder: "Placeholder" 30 | b.use :placeholder 31 | 32 | ## Optional extensions 33 | # They are disabled unless you pass `f.input EXTENSION_NAME => true` 34 | # to the input. If so, they will retrieve the values from the model 35 | # if any exists. If you want to enable any of those 36 | # extensions by default, you can change `b.optional` to `b.use`. 37 | 38 | # Calculates maxlength from length validations for string inputs 39 | # and/or database column lengths 40 | b.optional :maxlength 41 | 42 | # Calculate minlength from length validations for string inputs 43 | b.optional :minlength 44 | 45 | # Calculates pattern from format validations for string inputs 46 | b.optional :pattern 47 | 48 | # Calculates min and max from length validations for numeric inputs 49 | b.optional :min_max 50 | 51 | # Calculates readonly automatically from readonly attributes 52 | b.optional :readonly 53 | 54 | ## Inputs 55 | # b.use :input, class: 'input', error_class: 'is-invalid', valid_class: 'is-valid' 56 | b.use :label_input 57 | b.use :hint, wrap_with: { tag: :span, class: :hint } 58 | b.use :error, wrap_with: { tag: :span, class: :error } 59 | 60 | ## full_messages_for 61 | # If you want to display the full error message for the attribute, you can 62 | # use the component :full_error, like: 63 | # 64 | # b.use :full_error, wrap_with: { tag: :span, class: :error } 65 | end 66 | 67 | # The default wrapper to be used by the FormBuilder. 68 | config.default_wrapper = :default 69 | 70 | # Define the way to render check boxes / radio buttons with labels. 71 | # Defaults to :nested for bootstrap config. 72 | # inline: input + label 73 | # nested: label > input 74 | config.boolean_style = :nested 75 | 76 | # Default class for buttons 77 | config.button_class = 'btn' 78 | 79 | # Method used to tidy up errors. Specify any Rails Array method. 80 | # :first lists the first message for each field. 81 | # Use :to_sentence to list all errors for each field. 82 | # config.error_method = :first 83 | 84 | # Default tag used for error notification helper. 85 | config.error_notification_tag = :div 86 | 87 | # CSS class to add for error notification helper. 88 | config.error_notification_class = 'error_notification' 89 | 90 | # Series of attempts to detect a default label method for collection. 91 | # config.collection_label_methods = [ :to_label, :name, :title, :to_s ] 92 | 93 | # Series of attempts to detect a default value method for collection. 94 | # config.collection_value_methods = [ :id, :to_s ] 95 | 96 | # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none. 97 | # config.collection_wrapper_tag = nil 98 | 99 | # You can define the class to use on all collection wrappers. Defaulting to none. 100 | # config.collection_wrapper_class = nil 101 | 102 | # You can wrap each item in a collection of radio/check boxes with a tag, 103 | # defaulting to :span. 104 | # config.item_wrapper_tag = :span 105 | 106 | # You can define a class to use in all item wrappers. Defaulting to none. 107 | # config.item_wrapper_class = nil 108 | 109 | # How the label text should be generated altogether with the required text. 110 | # config.label_text = lambda { |label, required, explicit_label| "#{required} #{label}" } 111 | 112 | # You can define the class to use on all labels. Default is nil. 113 | # config.label_class = nil 114 | 115 | # You can define the default class to be used on forms. Can be overriden 116 | # with `html: { :class }`. Defaulting to none. 117 | # config.default_form_class = nil 118 | 119 | # You can define which elements should obtain additional classes 120 | # config.generate_additional_classes_for = [:wrapper, :label, :input] 121 | 122 | # Whether attributes are required by default (or not). Default is true. 123 | # config.required_by_default = true 124 | 125 | # Tell browsers whether to use the native HTML5 validations (novalidate form option). 126 | # These validations are enabled in SimpleForm's internal config but disabled by default 127 | # in this configuration, which is recommended due to some quirks from different browsers. 128 | # To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations, 129 | # change this configuration to true. 130 | config.browser_validations = false 131 | 132 | # Custom mappings for input types. This should be a hash containing a regexp 133 | # to match as key, and the input type that will be used when the field name 134 | # matches the regexp as value. 135 | # config.input_mappings = { /count/ => :integer } 136 | 137 | # Custom wrappers for input types. This should be a hash containing an input 138 | # type as key and the wrapper that will be used for all inputs with specified type. 139 | # config.wrapper_mappings = { string: :prepend } 140 | 141 | # Namespaces where SimpleForm should look for custom input classes that 142 | # override default inputs. 143 | # config.custom_inputs_namespaces << "CustomInputs" 144 | 145 | # Default priority for time_zone inputs. 146 | # config.time_zone_priority = nil 147 | 148 | # Default priority for country inputs. 149 | # config.country_priority = nil 150 | 151 | # When false, do not use translations for labels. 152 | # config.translate_labels = true 153 | 154 | # Automatically discover new inputs in Rails' autoload path. 155 | # config.inputs_discovery = true 156 | 157 | # Cache SimpleForm inputs discovery 158 | # config.cache_discovery = !Rails.env.development? 159 | 160 | # Default class for inputs 161 | # config.input_class = nil 162 | 163 | # Define the default class of the input wrapper of the boolean input. 164 | config.boolean_label_class = 'checkbox' 165 | 166 | # Defines if the default input wrapper class should be included in radio 167 | # collection wrappers. 168 | # config.include_default_input_wrapper_class = true 169 | 170 | # Defines which i18n scope will be used in Simple Form. 171 | # config.i18n_scope = 'simple_form' 172 | 173 | # Defines validation classes to the input_field. By default it's nil. 174 | # config.input_field_valid_class = 'is-valid' 175 | # config.input_field_error_class = 'is-invalid' 176 | end 177 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | actioncable (7.0.4) 5 | actionpack (= 7.0.4) 6 | activesupport (= 7.0.4) 7 | nio4r (~> 2.0) 8 | websocket-driver (>= 0.6.1) 9 | actionmailbox (7.0.4) 10 | actionpack (= 7.0.4) 11 | activejob (= 7.0.4) 12 | activerecord (= 7.0.4) 13 | activestorage (= 7.0.4) 14 | activesupport (= 7.0.4) 15 | mail (>= 2.7.1) 16 | net-imap 17 | net-pop 18 | net-smtp 19 | actionmailer (7.0.4) 20 | actionpack (= 7.0.4) 21 | actionview (= 7.0.4) 22 | activejob (= 7.0.4) 23 | activesupport (= 7.0.4) 24 | mail (~> 2.5, >= 2.5.4) 25 | net-imap 26 | net-pop 27 | net-smtp 28 | rails-dom-testing (~> 2.0) 29 | actionpack (7.0.4) 30 | actionview (= 7.0.4) 31 | activesupport (= 7.0.4) 32 | rack (~> 2.0, >= 2.2.0) 33 | rack-test (>= 0.6.3) 34 | rails-dom-testing (~> 2.0) 35 | rails-html-sanitizer (~> 1.0, >= 1.2.0) 36 | actiontext (7.0.4) 37 | actionpack (= 7.0.4) 38 | activerecord (= 7.0.4) 39 | activestorage (= 7.0.4) 40 | activesupport (= 7.0.4) 41 | globalid (>= 0.6.0) 42 | nokogiri (>= 1.8.5) 43 | actionview (7.0.4) 44 | activesupport (= 7.0.4) 45 | builder (~> 3.1) 46 | erubi (~> 1.4) 47 | rails-dom-testing (~> 2.0) 48 | rails-html-sanitizer (~> 1.1, >= 1.2.0) 49 | activejob (7.0.4) 50 | activesupport (= 7.0.4) 51 | globalid (>= 0.3.6) 52 | activemodel (7.0.4) 53 | activesupport (= 7.0.4) 54 | activerecord (7.0.4) 55 | activemodel (= 7.0.4) 56 | activesupport (= 7.0.4) 57 | activestorage (7.0.4) 58 | actionpack (= 7.0.4) 59 | activejob (= 7.0.4) 60 | activerecord (= 7.0.4) 61 | activesupport (= 7.0.4) 62 | marcel (~> 1.0) 63 | mini_mime (>= 1.1.0) 64 | activesupport (7.0.4) 65 | concurrent-ruby (~> 1.0, >= 1.0.2) 66 | i18n (>= 1.6, < 2) 67 | minitest (>= 5.1) 68 | tzinfo (~> 2.0) 69 | addressable (2.8.1) 70 | public_suffix (>= 2.0.2, < 6.0) 71 | ast (2.4.2) 72 | awesome_print (1.9.2) 73 | aws-eventstream (1.2.0) 74 | aws-partitions (1.660.0) 75 | aws-sdk-core (3.167.0) 76 | aws-eventstream (~> 1, >= 1.0.2) 77 | aws-partitions (~> 1, >= 1.651.0) 78 | aws-sigv4 (~> 1.5) 79 | jmespath (~> 1, >= 1.6.1) 80 | aws-sdk-kms (1.59.0) 81 | aws-sdk-core (~> 3, >= 3.165.0) 82 | aws-sigv4 (~> 1.1) 83 | aws-sdk-s3 (1.117.1) 84 | aws-sdk-core (~> 3, >= 3.165.0) 85 | aws-sdk-kms (~> 1) 86 | aws-sigv4 (~> 1.4) 87 | aws-sigv4 (1.5.2) 88 | aws-eventstream (~> 1, >= 1.0.2) 89 | bcrypt (3.1.18) 90 | bindex (0.8.1) 91 | bootsnap (1.13.0) 92 | msgpack (~> 1.2) 93 | builder (3.2.4) 94 | capybara (3.37.1) 95 | addressable 96 | matrix 97 | mini_mime (>= 0.1.3) 98 | nokogiri (~> 1.8) 99 | rack (>= 1.6.0) 100 | rack-test (>= 0.6.3) 101 | regexp_parser (>= 1.5, < 3.0) 102 | xpath (~> 3.2) 103 | childprocess (4.1.0) 104 | coderay (1.1.3) 105 | concurrent-ruby (1.1.10) 106 | crack (0.4.5) 107 | rexml 108 | crass (1.0.6) 109 | cssbundling-rails (1.1.1) 110 | railties (>= 6.0.0) 111 | database_cleaner (2.0.1) 112 | database_cleaner-active_record (~> 2.0.0) 113 | database_cleaner-active_record (2.0.1) 114 | activerecord (>= 5.a) 115 | database_cleaner-core (~> 2.0.0) 116 | database_cleaner-core (2.0.1) 117 | debug (1.6.2) 118 | irb (>= 1.3.6) 119 | reline (>= 0.3.1) 120 | devise (4.8.1) 121 | bcrypt (~> 3.0) 122 | orm_adapter (~> 0.1) 123 | railties (>= 4.1.0) 124 | responders 125 | warden (~> 1.2.3) 126 | diff-lcs (1.5.0) 127 | digest (3.1.0) 128 | docile (1.4.0) 129 | dotenv (2.8.1) 130 | dotenv-rails (2.8.1) 131 | dotenv (= 2.8.1) 132 | railties (>= 3.2) 133 | erubi (1.11.0) 134 | factory_bot (6.2.1) 135 | activesupport (>= 5.0.0) 136 | factory_bot_rails (6.2.0) 137 | factory_bot (~> 6.2.0) 138 | railties (>= 5.0.0) 139 | faker (2.23.0) 140 | i18n (>= 1.8.11, < 2) 141 | ffi (1.15.5) 142 | globalid (1.0.0) 143 | activesupport (>= 5.0) 144 | hashdiff (1.0.1) 145 | i18n (1.12.0) 146 | concurrent-ruby (~> 1.0) 147 | image_processing (1.12.2) 148 | mini_magick (>= 4.9.5, < 5) 149 | ruby-vips (>= 2.0.17, < 3) 150 | io-console (0.5.11) 151 | irb (1.4.1) 152 | reline (>= 0.3.0) 153 | jbuilder (2.11.5) 154 | actionview (>= 5.0.0) 155 | activesupport (>= 5.0.0) 156 | jmespath (1.6.1) 157 | jsbundling-rails (1.0.3) 158 | railties (>= 6.0.0) 159 | json (2.6.2) 160 | loofah (2.19.0) 161 | crass (~> 1.0.2) 162 | nokogiri (>= 1.5.9) 163 | mail (2.7.1) 164 | mini_mime (>= 0.1.1) 165 | marcel (1.0.2) 166 | matrix (0.4.2) 167 | method_source (1.0.0) 168 | mini_magick (4.11.0) 169 | mini_mime (1.1.2) 170 | minitest (5.16.3) 171 | msgpack (1.5.6) 172 | net-imap (0.2.3) 173 | digest 174 | net-protocol 175 | strscan 176 | net-pop (0.1.1) 177 | digest 178 | net-protocol 179 | timeout 180 | net-protocol (0.1.3) 181 | timeout 182 | net-smtp (0.3.1) 183 | digest 184 | net-protocol 185 | timeout 186 | nio4r (2.5.8) 187 | nokogiri (1.13.8-aarch64-linux) 188 | racc (~> 1.4) 189 | nokogiri (1.13.8-x86_64-linux) 190 | racc (~> 1.4) 191 | orm_adapter (0.5.0) 192 | parallel (1.22.1) 193 | parser (3.1.2.1) 194 | ast (~> 2.4.1) 195 | pg (1.4.3) 196 | pry (0.14.1) 197 | coderay (~> 1.1) 198 | method_source (~> 1.0) 199 | pry-rails (0.3.9) 200 | pry (>= 0.10.4) 201 | public_suffix (5.0.0) 202 | puma (5.6.5) 203 | nio4r (~> 2.0) 204 | pundit (2.2.0) 205 | activesupport (>= 3.0.0) 206 | racc (1.6.0) 207 | rack (2.2.4) 208 | rack-test (2.0.2) 209 | rack (>= 1.3) 210 | rails (7.0.4) 211 | actioncable (= 7.0.4) 212 | actionmailbox (= 7.0.4) 213 | actionmailer (= 7.0.4) 214 | actionpack (= 7.0.4) 215 | actiontext (= 7.0.4) 216 | actionview (= 7.0.4) 217 | activejob (= 7.0.4) 218 | activemodel (= 7.0.4) 219 | activerecord (= 7.0.4) 220 | activestorage (= 7.0.4) 221 | activesupport (= 7.0.4) 222 | bundler (>= 1.15.0) 223 | railties (= 7.0.4) 224 | rails-dom-testing (2.0.3) 225 | activesupport (>= 4.2.0) 226 | nokogiri (>= 1.6) 227 | rails-html-sanitizer (1.4.3) 228 | loofah (~> 2.3) 229 | railties (7.0.4) 230 | actionpack (= 7.0.4) 231 | activesupport (= 7.0.4) 232 | method_source 233 | rake (>= 12.2) 234 | thor (~> 1.0) 235 | zeitwerk (~> 2.5) 236 | rainbow (3.1.1) 237 | rake (13.0.6) 238 | regexp_parser (2.5.0) 239 | reline (0.3.1) 240 | io-console (~> 0.5) 241 | responders (3.0.1) 242 | actionpack (>= 5.0) 243 | railties (>= 5.0) 244 | rexml (3.2.5) 245 | rspec-core (3.11.0) 246 | rspec-support (~> 3.11.0) 247 | rspec-expectations (3.11.1) 248 | diff-lcs (>= 1.2.0, < 2.0) 249 | rspec-support (~> 3.11.0) 250 | rspec-mocks (3.11.1) 251 | diff-lcs (>= 1.2.0, < 2.0) 252 | rspec-support (~> 3.11.0) 253 | rspec-rails (5.1.2) 254 | actionpack (>= 5.2) 255 | activesupport (>= 5.2) 256 | railties (>= 5.2) 257 | rspec-core (~> 3.10) 258 | rspec-expectations (~> 3.10) 259 | rspec-mocks (~> 3.10) 260 | rspec-support (~> 3.10) 261 | rspec-support (3.11.1) 262 | rubocop (1.36.0) 263 | json (~> 2.3) 264 | parallel (~> 1.10) 265 | parser (>= 3.1.2.1) 266 | rainbow (>= 2.2.2, < 4.0) 267 | regexp_parser (>= 1.8, < 3.0) 268 | rexml (>= 3.2.5, < 4.0) 269 | rubocop-ast (>= 1.20.1, < 2.0) 270 | ruby-progressbar (~> 1.7) 271 | unicode-display_width (>= 1.4.0, < 3.0) 272 | rubocop-ast (1.21.0) 273 | parser (>= 3.1.1.0) 274 | ruby-progressbar (1.11.0) 275 | ruby-vips (2.1.4) 276 | ffi (~> 1.12) 277 | rubyzip (2.3.2) 278 | selenium-webdriver (4.4.0) 279 | childprocess (>= 0.5, < 5.0) 280 | rexml (~> 3.2, >= 3.2.5) 281 | rubyzip (>= 1.2.2, < 3.0) 282 | websocket (~> 1.0) 283 | shoulda-matchers (5.2.0) 284 | activesupport (>= 5.2.0) 285 | simple_form (5.1.0) 286 | actionpack (>= 5.2) 287 | activemodel (>= 5.2) 288 | simplecov (0.21.2) 289 | docile (~> 1.1) 290 | simplecov-html (~> 0.11) 291 | simplecov_json_formatter (~> 0.1) 292 | simplecov-html (0.12.3) 293 | simplecov_json_formatter (0.1.4) 294 | sprockets (4.1.1) 295 | concurrent-ruby (~> 1.0) 296 | rack (> 1, < 3) 297 | sprockets-rails (3.4.2) 298 | actionpack (>= 5.2) 299 | activesupport (>= 5.2) 300 | sprockets (>= 3.0.0) 301 | stimulus-rails (1.1.0) 302 | railties (>= 6.0.0) 303 | strscan (3.0.4) 304 | thor (1.2.1) 305 | timeout (0.3.0) 306 | turbo-rails (1.3.0) 307 | actionpack (>= 6.0.0) 308 | activejob (>= 6.0.0) 309 | railties (>= 6.0.0) 310 | tzinfo (2.0.5) 311 | concurrent-ruby (~> 1.0) 312 | unicode-display_width (2.3.0) 313 | vcr (6.1.0) 314 | warden (1.2.9) 315 | rack (>= 2.0.9) 316 | web-console (4.2.0) 317 | actionview (>= 6.0.0) 318 | activemodel (>= 6.0.0) 319 | bindex (>= 0.4.0) 320 | railties (>= 6.0.0) 321 | webdrivers (5.1.0) 322 | nokogiri (~> 1.6) 323 | rubyzip (>= 1.3.0) 324 | selenium-webdriver (~> 4.0) 325 | webmock (3.18.1) 326 | addressable (>= 2.8.0) 327 | crack (>= 0.3.2) 328 | hashdiff (>= 0.4.0, < 2.0.0) 329 | websocket (1.2.9) 330 | websocket-driver (0.7.5) 331 | websocket-extensions (>= 0.1.0) 332 | websocket-extensions (0.1.5) 333 | xpath (3.2.0) 334 | nokogiri (~> 1.8) 335 | zeitwerk (2.6.0) 336 | 337 | PLATFORMS 338 | aarch64-linux 339 | x86_64-linux 340 | 341 | DEPENDENCIES 342 | awesome_print 343 | aws-sdk-s3 344 | bootsnap 345 | capybara 346 | cssbundling-rails 347 | database_cleaner 348 | debug 349 | devise 350 | dotenv-rails 351 | factory_bot_rails 352 | faker 353 | image_processing (>= 1.2) 354 | jbuilder 355 | jsbundling-rails 356 | pg 357 | pry-rails 358 | puma (~> 5.0) 359 | pundit 360 | rails (~> 7.0.4) 361 | rspec-rails 362 | rubocop 363 | selenium-webdriver 364 | shoulda-matchers 365 | simple_form 366 | simplecov 367 | sprockets-rails 368 | stimulus-rails 369 | turbo-rails 370 | tzinfo-data 371 | vcr 372 | web-console 373 | webdrivers 374 | webmock 375 | 376 | RUBY VERSION 377 | ruby 3.1.2p20 378 | 379 | BUNDLED WITH 380 | 2.3.26 381 | -------------------------------------------------------------------------------- /config/initializers/devise.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Assuming you have not yet modified this file, each configuration option below 4 | # is set to its default value. Note that some are commented out while others 5 | # are not: uncommented lines are intended to protect your configuration from 6 | # breaking changes in upgrades (i.e., in the event that future versions of 7 | # Devise change the default values for those options). 8 | # 9 | # Use this hook to configure devise mailer, warden hooks and so forth. 10 | # Many of these configuration options can be set straight in your model. 11 | Devise.setup do |config| 12 | # The secret key used by Devise. Devise uses this key to generate 13 | # random tokens. Changing this key will render invalid all existing 14 | # confirmation, reset password and unlock tokens in the database. 15 | # Devise will use the `secret_key_base` as its `secret_key` 16 | # by default. You can change it below and use your own secret key. 17 | # config.secret_key = 'f83ea8236f71cc6d320d3aad2e56a838ddfbd72377890f5efc94f60be7ca6d13e687bdfab0dd9104e356c644ea99917010f9f20024da6a1f75634124b6cef6e6' 18 | 19 | # ==> Controller configuration 20 | # Configure the parent class to the devise controllers. 21 | # config.parent_controller = 'DeviseController' 22 | 23 | # ==> Mailer Configuration 24 | # Configure the e-mail address which will be shown in Devise::Mailer, 25 | # note that it will be overwritten if you use your own mailer class 26 | # with default "from" parameter. 27 | config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com' 28 | 29 | # Configure the class responsible to send e-mails. 30 | # config.mailer = 'Devise::Mailer' 31 | 32 | # Configure the parent class responsible to send e-mails. 33 | # config.parent_mailer = 'ActionMailer::Base' 34 | 35 | # ==> ORM configuration 36 | # Load and configure the ORM. Supports :active_record (default) and 37 | # :mongoid (bson_ext recommended) by default. Other ORMs may be 38 | # available as additional gems. 39 | require 'devise/orm/active_record' 40 | 41 | # ==> Configuration for any authentication mechanism 42 | # Configure which keys are used when authenticating a user. The default is 43 | # just :email. You can configure it to use [:username, :subdomain], so for 44 | # authenticating a user, both parameters are required. Remember that those 45 | # parameters are used only when authenticating and not when retrieving from 46 | # session. If you need permissions, you should implement that in a before filter. 47 | # You can also supply a hash where the value is a boolean determining whether 48 | # or not authentication should be aborted when the value is not present. 49 | # config.authentication_keys = [:email] 50 | 51 | # Configure parameters from the request object used for authentication. Each entry 52 | # given should be a request method and it will automatically be passed to the 53 | # find_for_authentication method and considered in your model lookup. For instance, 54 | # if you set :request_keys to [:subdomain], :subdomain will be used on authentication. 55 | # The same considerations mentioned for authentication_keys also apply to request_keys. 56 | # config.request_keys = [] 57 | 58 | # Configure which authentication keys should be case-insensitive. 59 | # These keys will be downcased upon creating or modifying a user and when used 60 | # to authenticate or find a user. Default is :email. 61 | config.case_insensitive_keys = [:email] 62 | 63 | # Configure which authentication keys should have whitespace stripped. 64 | # These keys will have whitespace before and after removed upon creating or 65 | # modifying a user and when used to authenticate or find a user. Default is :email. 66 | config.strip_whitespace_keys = [:email] 67 | 68 | # Tell if authentication through request.params is enabled. True by default. 69 | # It can be set to an array that will enable params authentication only for the 70 | # given strategies, for example, `config.params_authenticatable = [:database]` will 71 | # enable it only for database (email + password) authentication. 72 | # config.params_authenticatable = true 73 | 74 | # Tell if authentication through HTTP Auth is enabled. False by default. 75 | # It can be set to an array that will enable http authentication only for the 76 | # given strategies, for example, `config.http_authenticatable = [:database]` will 77 | # enable it only for database authentication. 78 | # For API-only applications to support authentication "out-of-the-box", you will likely want to 79 | # enable this with :database unless you are using a custom strategy. 80 | # The supported strategies are: 81 | # :database = Support basic authentication with authentication key + password 82 | # config.http_authenticatable = false 83 | 84 | # If 401 status code should be returned for AJAX requests. True by default. 85 | # config.http_authenticatable_on_xhr = true 86 | 87 | # The realm used in Http Basic Authentication. 'Application' by default. 88 | # config.http_authentication_realm = 'Application' 89 | 90 | # It will change confirmation, password recovery and other workflows 91 | # to behave the same regardless if the e-mail provided was right or wrong. 92 | # Does not affect registerable. 93 | # config.paranoid = true 94 | 95 | # By default Devise will store the user in session. You can skip storage for 96 | # particular strategies by setting this option. 97 | # Notice that if you are skipping storage for all authentication paths, you 98 | # may want to disable generating routes to Devise's sessions controller by 99 | # passing skip: :sessions to `devise_for` in your config/routes.rb 100 | config.skip_session_storage = [:http_auth] 101 | 102 | # By default, Devise cleans up the CSRF token on authentication to 103 | # avoid CSRF token fixation attacks. This means that, when using AJAX 104 | # requests for sign in and sign up, you need to get a new CSRF token 105 | # from the server. You can disable this option at your own risk. 106 | # config.clean_up_csrf_token_on_authentication = true 107 | 108 | # When false, Devise will not attempt to reload routes on eager load. 109 | # This can reduce the time taken to boot the app but if your application 110 | # requires the Devise mappings to be loaded during boot time the application 111 | # won't boot properly. 112 | # config.reload_routes = true 113 | 114 | # ==> Configuration for :database_authenticatable 115 | # For bcrypt, this is the cost for hashing the password and defaults to 12. If 116 | # using other algorithms, it sets how many times you want the password to be hashed. 117 | # The number of stretches used for generating the hashed password are stored 118 | # with the hashed password. This allows you to change the stretches without 119 | # invalidating existing passwords. 120 | # 121 | # Limiting the stretches to just one in testing will increase the performance of 122 | # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use 123 | # a value less than 10 in other environments. Note that, for bcrypt (the default 124 | # algorithm), the cost increases exponentially with the number of stretches (e.g. 125 | # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation). 126 | config.stretches = Rails.env.test? ? 1 : 12 127 | 128 | # Set up a pepper to generate the hashed password. 129 | # config.pepper = 'ef24c5b616738cbbb7d0707d6b03179dccc27027ddc4ba29962288764feca394169279892dbeb8c246904593313329ba4a4d31b5db64dc2cf3a7a258285a2804' 130 | 131 | # Send a notification to the original email when the user's email is changed. 132 | # config.send_email_changed_notification = false 133 | 134 | # Send a notification email when the user's password is changed. 135 | # config.send_password_change_notification = false 136 | 137 | # ==> Configuration for :confirmable 138 | # A period that the user is allowed to access the website even without 139 | # confirming their account. For instance, if set to 2.days, the user will be 140 | # able to access the website for two days without confirming their account, 141 | # access will be blocked just in the third day. 142 | # You can also set it to nil, which will allow the user to access the website 143 | # without confirming their account. 144 | # Default is 0.days, meaning the user cannot access the website without 145 | # confirming their account. 146 | # config.allow_unconfirmed_access_for = 2.days 147 | 148 | # A period that the user is allowed to confirm their account before their 149 | # token becomes invalid. For example, if set to 3.days, the user can confirm 150 | # their account within 3 days after the mail was sent, but on the fourth day 151 | # their account can't be confirmed with the token any more. 152 | # Default is nil, meaning there is no restriction on how long a user can take 153 | # before confirming their account. 154 | # config.confirm_within = 3.days 155 | 156 | # If true, requires any email changes to be confirmed (exactly the same way as 157 | # initial account confirmation) to be applied. Requires additional unconfirmed_email 158 | # db field (see migrations). Until confirmed, new email is stored in 159 | # unconfirmed_email column, and copied to email column on successful confirmation. 160 | config.reconfirmable = true 161 | 162 | # Defines which key will be used when confirming an account 163 | # config.confirmation_keys = [:email] 164 | 165 | # ==> Configuration for :rememberable 166 | # The time the user will be remembered without asking for credentials again. 167 | # config.remember_for = 2.weeks 168 | 169 | # Invalidates all the remember me tokens when the user signs out. 170 | config.expire_all_remember_me_on_sign_out = true 171 | 172 | # If true, extends the user's remember period when remembered via cookie. 173 | # config.extend_remember_period = false 174 | 175 | # Options to be passed to the created cookie. For instance, you can set 176 | # secure: true in order to force SSL only cookies. 177 | # config.rememberable_options = {} 178 | 179 | # ==> Configuration for :validatable 180 | # Range for password length. 181 | config.password_length = 6..128 182 | 183 | # Email regex used to validate email formats. It simply asserts that 184 | # one (and only one) @ exists in the given string. This is mainly 185 | # to give user feedback and not to assert the e-mail validity. 186 | config.email_regexp = /\A[^@\s]+@[^@\s]+\z/ 187 | 188 | # ==> Configuration for :timeoutable 189 | # The time you want to timeout the user session without activity. After this 190 | # time the user will be asked for credentials again. Default is 30 minutes. 191 | # config.timeout_in = 30.minutes 192 | 193 | # ==> Configuration for :lockable 194 | # Defines which strategy will be used to lock an account. 195 | # :failed_attempts = Locks an account after a number of failed attempts to sign in. 196 | # :none = No lock strategy. You should handle locking by yourself. 197 | # config.lock_strategy = :failed_attempts 198 | 199 | # Defines which key will be used when locking and unlocking an account 200 | # config.unlock_keys = [:email] 201 | 202 | # Defines which strategy will be used to unlock an account. 203 | # :email = Sends an unlock link to the user email 204 | # :time = Re-enables login after a certain amount of time (see :unlock_in below) 205 | # :both = Enables both strategies 206 | # :none = No unlock strategy. You should handle unlocking by yourself. 207 | # config.unlock_strategy = :both 208 | 209 | # Number of authentication tries before locking an account if lock_strategy 210 | # is failed attempts. 211 | # config.maximum_attempts = 20 212 | 213 | # Time interval to unlock the account if :time is enabled as unlock_strategy. 214 | # config.unlock_in = 1.hour 215 | 216 | # Warn on the last attempt before the account is locked. 217 | # config.last_attempt_warning = true 218 | 219 | # ==> Configuration for :recoverable 220 | # 221 | # Defines which key will be used when recovering the password for an account 222 | # config.reset_password_keys = [:email] 223 | 224 | # Time interval you can reset your password with a reset password key. 225 | # Don't put a too small interval or your users won't have the time to 226 | # change their passwords. 227 | config.reset_password_within = 6.hours 228 | 229 | # When set to false, does not sign a user in automatically after their password is 230 | # reset. Defaults to true, so a user is signed in automatically after a reset. 231 | # config.sign_in_after_reset_password = true 232 | 233 | # ==> Configuration for :encryptable 234 | # Allow you to use another hashing or encryption algorithm besides bcrypt (default). 235 | # You can use :sha1, :sha512 or algorithms from others authentication tools as 236 | # :clearance_sha1, :authlogic_sha512 (then you should set stretches above to 20 237 | # for default behavior) and :restful_authentication_sha1 (then you should set 238 | # stretches to 10, and copy REST_AUTH_SITE_KEY to pepper). 239 | # 240 | # Require the `devise-encryptable` gem when using anything other than bcrypt 241 | # config.encryptor = :sha512 242 | 243 | # ==> Scopes configuration 244 | # Turn scoped views on. Before rendering "sessions/new", it will first check for 245 | # "users/sessions/new". It's turned off by default because it's slower if you 246 | # are using only default views. 247 | # config.scoped_views = false 248 | 249 | # Configure the default scope given to Warden. By default it's the first 250 | # devise role declared in your routes (usually :user). 251 | # config.default_scope = :user 252 | 253 | # Set this configuration to false if you want /users/sign_out to sign out 254 | # only the current scope. By default, Devise signs out all scopes. 255 | # config.sign_out_all_scopes = true 256 | 257 | # ==> Navigation configuration 258 | # Lists the formats that should be treated as navigational. Formats like 259 | # :html, should redirect to the sign in page when the user does not have 260 | # access, but formats like :xml or :json, should return 401. 261 | # 262 | # If you have any extra navigational formats, like :iphone or :mobile, you 263 | # should add them to the navigational formats lists. 264 | # 265 | # The "*/*" below is required to match Internet Explorer requests. 266 | config.navigational_formats = ['*/*', :html, :turbo_stream] 267 | 268 | # The default HTTP method used to sign out a resource. Default is :delete. 269 | config.sign_out_via = :get 270 | 271 | # ==> OmniAuth 272 | # Add a new OmniAuth provider. Check the wiki for more information on setting 273 | # up on your models and hooks. 274 | # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo' 275 | 276 | # ==> Warden configuration 277 | # If you want to use other strategies, that are not supported by Devise, or 278 | # change the failure app, you can configure them inside the config.warden block. 279 | # 280 | # config.warden do |manager| 281 | # manager.intercept_401 = false 282 | # manager.default_strategies(scope: :user).unshift :some_external_strategy 283 | # end 284 | 285 | # ==> Mountable engine configurations 286 | # When using Devise inside an engine, let's call it `MyEngine`, and this engine 287 | # is mountable, there are some extra configurations to be taken into account. 288 | # The following options are available, assuming the engine is mounted as: 289 | # 290 | # mount MyEngine, at: '/my_engine' 291 | # 292 | # The router that invoked `devise_for`, in the example above, would be: 293 | # config.router_name = :my_engine 294 | # 295 | # When using OmniAuth, Devise cannot automatically set OmniAuth path, 296 | # so you need to do it manually. For the users scope, it would be: 297 | # config.omniauth_path_prefix = '/my_engine/users/auth' 298 | 299 | # ==> Turbolinks configuration 300 | # If your app is using Turbolinks, Turbolinks::Controller needs to be included to make redirection work correctly: 301 | # 302 | # ActiveSupport.on_load(:devise_failure_app) do 303 | # include Turbolinks::Controller 304 | # end 305 | 306 | # ==> Configuration for :registerable 307 | 308 | # When set to false, does not sign a user in automatically after their password is 309 | # changed. Defaults to true, so a user is signed in automatically after changing a password. 310 | # config.sign_in_after_change_password = true 311 | end 312 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@esbuild/android-arm@0.15.10": 6 | version "0.15.10" 7 | resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.15.10.tgz#a5f9432eb221afc243c321058ef25fe899886892" 8 | integrity sha512-FNONeQPy/ox+5NBkcSbYJxoXj9GWu8gVGJTVmUyoOCKQFDTrHVKgNSzChdNt0I8Aj/iKcsDf2r9BFwv+FSNUXg== 9 | 10 | "@esbuild/linux-loong64@0.15.10": 11 | version "0.15.10" 12 | resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.15.10.tgz#78a42897c2cf8db9fd5f1811f7590393b77774c7" 13 | integrity sha512-w0Ou3Z83LOYEkwaui2M8VwIp+nLi/NA60lBLMvaJ+vXVMcsARYdEzLNE7RSm4+lSg4zq4d7fAVuzk7PNQ5JFgg== 14 | 15 | "@hotwired/stimulus@^3.1.0": 16 | version "3.1.0" 17 | resolved "https://registry.yarnpkg.com/@hotwired/stimulus/-/stimulus-3.1.0.tgz#20215251e5afe6e0a3787285181ba1bfc9097df0" 18 | integrity sha512-iDMHUhiEJ1xFeicyHcZQQgBzhtk5mPR0QZO3L6wtqzMsJEk2TKECuCQTGKjm+KJTHVY0dKq1dOOAWvODjpd2Mg== 19 | 20 | "@hotwired/turbo-rails@^7.2.0": 21 | version "7.2.0" 22 | resolved "https://registry.yarnpkg.com/@hotwired/turbo-rails/-/turbo-rails-7.2.0.tgz#2081ed4e626fac9fd61ba5a4d1eeb53e6ea93b03" 23 | integrity sha512-RxJJGINeLa2lyI078LLSbqZDI7RarxTDMVlgKnsLvtFEn8Pa7ySEcDUxHp5YiLXGbLacAIH/dcfD0JfCWe5Dqw== 24 | dependencies: 25 | "@hotwired/turbo" "^7.2.0" 26 | "@rails/actioncable" "^7.0" 27 | 28 | "@hotwired/turbo@^7.2.0": 29 | version "7.2.0" 30 | resolved "https://registry.yarnpkg.com/@hotwired/turbo/-/turbo-7.2.0.tgz#4ff90d80fda17e69b04a12bbf0a42f09953504f6" 31 | integrity sha512-CYr6N9NfqsjhmZx1xVQ8zYcDo4hTm7sTUpJydbNgMRyG+YfF/9ADIQQ2TtcBdkl2zi/12a3OTWX0UMzNZnAK9w== 32 | 33 | "@popperjs/core@^2.11.6": 34 | version "2.11.6" 35 | resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.6.tgz#cee20bd55e68a1720bdab363ecf0c821ded4cd45" 36 | integrity sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw== 37 | 38 | "@rails/actioncable@^7.0": 39 | version "7.0.4" 40 | resolved "https://registry.yarnpkg.com/@rails/actioncable/-/actioncable-7.0.4.tgz#70a3ca56809f7aaabb80af2f9c01ae51e1a8ed41" 41 | integrity sha512-tz4oM+Zn9CYsvtyicsa/AwzKZKL+ITHWkhiu7x+xF77clh2b4Rm+s6xnOgY/sGDWoFWZmtKsE95hxBPkgQQNnQ== 42 | 43 | anymatch@~3.1.2: 44 | version "3.1.2" 45 | resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" 46 | integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== 47 | dependencies: 48 | normalize-path "^3.0.0" 49 | picomatch "^2.0.4" 50 | 51 | binary-extensions@^2.0.0: 52 | version "2.2.0" 53 | resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" 54 | integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== 55 | 56 | bootstrap-icons@^1.9.1: 57 | version "1.9.1" 58 | resolved "https://registry.yarnpkg.com/bootstrap-icons/-/bootstrap-icons-1.9.1.tgz#cf22d91a25447645e45c49ebde4e56eafdfe761b" 59 | integrity sha512-d4ZkO30MIkAhQ2nNRJqKXJVEQorALGbLWTuRxyCTJF96lRIV6imcgMehWGJUiJMJhglN0o2tqLIeDnMdiQEE9g== 60 | 61 | bootstrap@^5.2.1: 62 | version "5.2.1" 63 | resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-5.2.1.tgz#45f97ff05cbe828bad807b014d8425f3aeb8ec3a" 64 | integrity sha512-UQi3v2NpVPEi1n35dmRRzBJFlgvWHYwyem6yHhuT6afYF+sziEt46McRbT//kVXZ7b1YUYEVGdXEH74Nx3xzGA== 65 | 66 | braces@~3.0.2: 67 | version "3.0.2" 68 | resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" 69 | integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== 70 | dependencies: 71 | fill-range "^7.0.1" 72 | 73 | "chokidar@>=3.0.0 <4.0.0": 74 | version "3.5.3" 75 | resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" 76 | integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== 77 | dependencies: 78 | anymatch "~3.1.2" 79 | braces "~3.0.2" 80 | glob-parent "~5.1.2" 81 | is-binary-path "~2.1.0" 82 | is-glob "~4.0.1" 83 | normalize-path "~3.0.0" 84 | readdirp "~3.6.0" 85 | optionalDependencies: 86 | fsevents "~2.3.2" 87 | 88 | esbuild-android-64@0.15.10: 89 | version "0.15.10" 90 | resolved "https://registry.yarnpkg.com/esbuild-android-64/-/esbuild-android-64-0.15.10.tgz#8a59a84acbf2eca96996cadc35642cf055c494f0" 91 | integrity sha512-UI7krF8OYO1N7JYTgLT9ML5j4+45ra3amLZKx7LO3lmLt1Ibn8t3aZbX5Pu4BjWiqDuJ3m/hsvhPhK/5Y/YpnA== 92 | 93 | esbuild-android-arm64@0.15.10: 94 | version "0.15.10" 95 | resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.15.10.tgz#f453851dc1d8c5409a38cf7613a33852faf4915d" 96 | integrity sha512-EOt55D6xBk5O05AK8brXUbZmoFj4chM8u3riGflLa6ziEoVvNjRdD7Cnp82NHQGfSHgYR06XsPI8/sMuA/cUwg== 97 | 98 | esbuild-darwin-64@0.15.10: 99 | version "0.15.10" 100 | resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.15.10.tgz#778bd29c8186ff47b176c8af58c08cf0fb8e6b86" 101 | integrity sha512-hbDJugTicqIm+WKZgp208d7FcXcaK8j2c0l+fqSJ3d2AzQAfjEYDRM3Z2oMeqSJ9uFxyj/muSACLdix7oTstRA== 102 | 103 | esbuild-darwin-arm64@0.15.10: 104 | version "0.15.10" 105 | resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.10.tgz#b30bbefb46dc3c5d4708b0435e52f6456578d6df" 106 | integrity sha512-M1t5+Kj4IgSbYmunf2BB6EKLkWUq+XlqaFRiGOk8bmBapu9bCDrxjf4kUnWn59Dka3I27EiuHBKd1rSO4osLFQ== 107 | 108 | esbuild-freebsd-64@0.15.10: 109 | version "0.15.10" 110 | resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.10.tgz#ab301c5f6ded5110dbdd611140bef1a7c2e99236" 111 | integrity sha512-KMBFMa7C8oc97nqDdoZwtDBX7gfpolkk6Bcmj6YFMrtCMVgoU/x2DI1p74DmYl7CSS6Ppa3xgemrLrr5IjIn0w== 112 | 113 | esbuild-freebsd-arm64@0.15.10: 114 | version "0.15.10" 115 | resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.10.tgz#a5b09b867a6ff49110f52343b6f12265db63d43f" 116 | integrity sha512-m2KNbuCX13yQqLlbSojFMHpewbn8wW5uDS6DxRpmaZKzyq8Dbsku6hHvh2U+BcLwWY4mpgXzFUoENEf7IcioGg== 117 | 118 | esbuild-linux-32@0.15.10: 119 | version "0.15.10" 120 | resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.15.10.tgz#5282fe9915641caf9c8070e4ba2c3e16d358f837" 121 | integrity sha512-guXrwSYFAvNkuQ39FNeV4sNkNms1bLlA5vF1H0cazZBOLdLFIny6BhT+TUbK/hdByMQhtWQ5jI9VAmPKbVPu1w== 122 | 123 | esbuild-linux-64@0.15.10: 124 | version "0.15.10" 125 | resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.15.10.tgz#f3726e85a00149580cb19f8abfabcbb96f5d52bb" 126 | integrity sha512-jd8XfaSJeucMpD63YNMO1JCrdJhckHWcMv6O233bL4l6ogQKQOxBYSRP/XLWP+6kVTu0obXovuckJDcA0DKtQA== 127 | 128 | esbuild-linux-arm64@0.15.10: 129 | version "0.15.10" 130 | resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.10.tgz#2f0056e9d5286edb0185b56655caa8c574d8dbe7" 131 | integrity sha512-GByBi4fgkvZFTHFDYNftu1DQ1GzR23jws0oWyCfhnI7eMOe+wgwWrc78dbNk709Ivdr/evefm2PJiUBMiusS1A== 132 | 133 | esbuild-linux-arm@0.15.10: 134 | version "0.15.10" 135 | resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.15.10.tgz#40a9270da3c8ffa32cf72e24a79883e323dff08d" 136 | integrity sha512-6N8vThLL/Lysy9y4Ex8XoLQAlbZKUyExCWyayGi2KgTBelKpPgj6RZnUaKri0dHNPGgReJriKVU6+KDGQwn10A== 137 | 138 | esbuild-linux-mips64le@0.15.10: 139 | version "0.15.10" 140 | resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.10.tgz#90ce1c4ee0202edb4ac69807dea77f7e5804abc4" 141 | integrity sha512-BxP+LbaGVGIdQNJUNF7qpYjEGWb0YyHVSKqYKrn+pTwH/SiHUxFyJYSP3pqkku61olQiSBnSmWZ+YUpj78Tw7Q== 142 | 143 | esbuild-linux-ppc64le@0.15.10: 144 | version "0.15.10" 145 | resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.10.tgz#782837ae7bd5b279178106c9dd801755a21fabdf" 146 | integrity sha512-LoSQCd6498PmninNgqd/BR7z3Bsk/mabImBWuQ4wQgmQEeanzWd5BQU2aNi9mBURCLgyheuZS6Xhrw5luw3OkQ== 147 | 148 | esbuild-linux-riscv64@0.15.10: 149 | version "0.15.10" 150 | resolved "https://registry.yarnpkg.com/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.10.tgz#d7420d806ece5174f24f4634303146f915ab4207" 151 | integrity sha512-Lrl9Cr2YROvPV4wmZ1/g48httE8z/5SCiXIyebiB5N8VT7pX3t6meI7TQVHw/wQpqP/AF4SksDuFImPTM7Z32Q== 152 | 153 | esbuild-linux-s390x@0.15.10: 154 | version "0.15.10" 155 | resolved "https://registry.yarnpkg.com/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.10.tgz#21fdf0cb3494a7fb520a71934e4dffce67fe47be" 156 | integrity sha512-ReP+6q3eLVVP2lpRrvl5EodKX7EZ1bS1/z5j6hsluAlZP5aHhk6ghT6Cq3IANvvDdscMMCB4QEbI+AjtvoOFpA== 157 | 158 | esbuild-netbsd-64@0.15.10: 159 | version "0.15.10" 160 | resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.10.tgz#6c06b3107e3df53de381e6299184d4597db0440f" 161 | integrity sha512-iGDYtJCMCqldMskQ4eIV+QSS/CuT7xyy9i2/FjpKvxAuCzrESZXiA1L64YNj6/afuzfBe9i8m/uDkFHy257hTw== 162 | 163 | esbuild-openbsd-64@0.15.10: 164 | version "0.15.10" 165 | resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.10.tgz#4daef5f5d8e74bbda53b65160029445d582570cf" 166 | integrity sha512-ftMMIwHWrnrYnvuJQRJs/Smlcb28F9ICGde/P3FUTCgDDM0N7WA0o9uOR38f5Xe2/OhNCgkjNeb7QeaE3cyWkQ== 167 | 168 | esbuild-sunos-64@0.15.10: 169 | version "0.15.10" 170 | resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.15.10.tgz#5fe7bef267a02f322fd249a8214d0274937388a7" 171 | integrity sha512-mf7hBL9Uo2gcy2r3rUFMjVpTaGpFJJE5QTDDqUFf1632FxteYANffDZmKbqX0PfeQ2XjUDE604IcE7OJeoHiyg== 172 | 173 | esbuild-windows-32@0.15.10: 174 | version "0.15.10" 175 | resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.15.10.tgz#48e3dde25ab0135579a288b30ab6ddef6d1f0b28" 176 | integrity sha512-ttFVo+Cg8b5+qHmZHbEc8Vl17kCleHhLzgT8X04y8zudEApo0PxPg9Mz8Z2cKH1bCYlve1XL8LkyXGFjtUYeGg== 177 | 178 | esbuild-windows-64@0.15.10: 179 | version "0.15.10" 180 | resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.15.10.tgz#387a9515bef3fee502d277a5d0a2db49a4ecda05" 181 | integrity sha512-2H0gdsyHi5x+8lbng3hLbxDWR7mKHWh5BXZGKVG830KUmXOOWFE2YKJ4tHRkejRduOGDrBvHBriYsGtmTv3ntA== 182 | 183 | esbuild-windows-arm64@0.15.10: 184 | version "0.15.10" 185 | resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.10.tgz#5a6fcf2fa49e895949bf5495cf088ab1b43ae879" 186 | integrity sha512-S+th4F+F8VLsHLR0zrUcG+Et4hx0RKgK1eyHc08kztmLOES8BWwMiaGdoW9hiXuzznXQ0I/Fg904MNbr11Nktw== 187 | 188 | esbuild@^0.15.10: 189 | version "0.15.10" 190 | resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.15.10.tgz#85c2f8446e9b1fe04fae68daceacba033eedbd42" 191 | integrity sha512-N7wBhfJ/E5fzn/SpNgX+oW2RLRjwaL8Y0ezqNqhjD6w0H2p0rDuEz2FKZqpqLnO8DCaWumKe8dsC/ljvVSSxng== 192 | optionalDependencies: 193 | "@esbuild/android-arm" "0.15.10" 194 | "@esbuild/linux-loong64" "0.15.10" 195 | esbuild-android-64 "0.15.10" 196 | esbuild-android-arm64 "0.15.10" 197 | esbuild-darwin-64 "0.15.10" 198 | esbuild-darwin-arm64 "0.15.10" 199 | esbuild-freebsd-64 "0.15.10" 200 | esbuild-freebsd-arm64 "0.15.10" 201 | esbuild-linux-32 "0.15.10" 202 | esbuild-linux-64 "0.15.10" 203 | esbuild-linux-arm "0.15.10" 204 | esbuild-linux-arm64 "0.15.10" 205 | esbuild-linux-mips64le "0.15.10" 206 | esbuild-linux-ppc64le "0.15.10" 207 | esbuild-linux-riscv64 "0.15.10" 208 | esbuild-linux-s390x "0.15.10" 209 | esbuild-netbsd-64 "0.15.10" 210 | esbuild-openbsd-64 "0.15.10" 211 | esbuild-sunos-64 "0.15.10" 212 | esbuild-windows-32 "0.15.10" 213 | esbuild-windows-64 "0.15.10" 214 | esbuild-windows-arm64 "0.15.10" 215 | 216 | fill-range@^7.0.1: 217 | version "7.0.1" 218 | resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" 219 | integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== 220 | dependencies: 221 | to-regex-range "^5.0.1" 222 | 223 | fsevents@~2.3.2: 224 | version "2.3.2" 225 | resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" 226 | integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== 227 | 228 | glob-parent@~5.1.2: 229 | version "5.1.2" 230 | resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" 231 | integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== 232 | dependencies: 233 | is-glob "^4.0.1" 234 | 235 | immutable@^4.0.0: 236 | version "4.1.0" 237 | resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.1.0.tgz#f795787f0db780183307b9eb2091fcac1f6fafef" 238 | integrity sha512-oNkuqVTA8jqG1Q6c+UglTOD1xhC1BtjKI7XkCXRkZHrN5m18/XsnUp8Q89GkQO/z+0WjonSvl0FLhDYftp46nQ== 239 | 240 | inputmask@^5.0.7: 241 | version "5.0.7" 242 | resolved "https://registry.yarnpkg.com/inputmask/-/inputmask-5.0.7.tgz#b04d5d4e1c85018893c3c8edb1a9f074b051007f" 243 | integrity sha512-rUxbRDS25KEib+c/Ow+K01oprU/+EK9t9SOPC8ov94/ftULGDqj1zOgRU/Hko6uzoKRMdwCfuhAafJ/Wk2wffQ== 244 | 245 | is-binary-path@~2.1.0: 246 | version "2.1.0" 247 | resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" 248 | integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== 249 | dependencies: 250 | binary-extensions "^2.0.0" 251 | 252 | is-extglob@^2.1.1: 253 | version "2.1.1" 254 | resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" 255 | integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== 256 | 257 | is-glob@^4.0.1, is-glob@~4.0.1: 258 | version "4.0.3" 259 | resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" 260 | integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== 261 | dependencies: 262 | is-extglob "^2.1.1" 263 | 264 | is-number@^7.0.0: 265 | version "7.0.0" 266 | resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" 267 | integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== 268 | 269 | jquery@^3.6.1: 270 | version "3.6.1" 271 | resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.6.1.tgz#fab0408f8b45fc19f956205773b62b292c147a16" 272 | integrity sha512-opJeO4nCucVnsjiXOE+/PcCgYw9Gwpvs/a6B1LL/lQhwWwpbVEVYDZ1FokFr8PRc7ghYlrFPuyHuiiDNTQxmcw== 273 | 274 | normalize-path@^3.0.0, normalize-path@~3.0.0: 275 | version "3.0.0" 276 | resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" 277 | integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== 278 | 279 | picomatch@^2.0.4, picomatch@^2.2.1: 280 | version "2.3.1" 281 | resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" 282 | integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== 283 | 284 | readdirp@~3.6.0: 285 | version "3.6.0" 286 | resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" 287 | integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== 288 | dependencies: 289 | picomatch "^2.2.1" 290 | 291 | sass@^1.55.0: 292 | version "1.55.0" 293 | resolved "https://registry.yarnpkg.com/sass/-/sass-1.55.0.tgz#0c4d3c293cfe8f8a2e8d3b666e1cf1bff8065d1c" 294 | integrity sha512-Pk+PMy7OGLs9WaxZGJMn7S96dvlyVBwwtToX895WmCpAOr5YiJYEUJfiJidMuKb613z2xNWcXCHEuOvjZbqC6A== 295 | dependencies: 296 | chokidar ">=3.0.0 <4.0.0" 297 | immutable "^4.0.0" 298 | source-map-js ">=0.6.2 <2.0.0" 299 | 300 | "source-map-js@>=0.6.2 <2.0.0": 301 | version "1.0.2" 302 | resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" 303 | integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== 304 | 305 | to-regex-range@^5.0.1: 306 | version "5.0.1" 307 | resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" 308 | integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== 309 | dependencies: 310 | is-number "^7.0.0" 311 | --------------------------------------------------------------------------------