diff --git a/pricing_catalog_rails_app/.dockerignore b/pricing_catalog_rails_app/.dockerignore deleted file mode 100644 index 96123753a..000000000 --- a/pricing_catalog_rails_app/.dockerignore +++ /dev/null @@ -1,37 +0,0 @@ -# See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files. - -# Ignore git directory. -/.git/ - -# Ignore bundler config. -/.bundle - -# Ignore all environment files (except templates). -/.env* -!/.env*.erb - -# Ignore all default key files. -/config/master.key -/config/credentials/*.key - -# Ignore all logfiles and tempfiles. -/log/* -/tmp/* -!/log/.keep -!/tmp/.keep - -# Ignore pidfiles, but keep the directory. -/tmp/pids/* -!/tmp/pids/.keep - -# Ignore storage (uploaded files in development and any SQLite databases). -/storage/* -!/storage/.keep -/tmp/storage/* -!/tmp/storage/.keep - -# Ignore assets. -/node_modules/ -/app/assets/builds/* -!/app/assets/builds/.keep -/public/assets diff --git a/pricing_catalog_rails_app/.gitignore b/pricing_catalog_rails_app/.gitignore deleted file mode 100644 index 802489bb8..000000000 --- a/pricing_catalog_rails_app/.gitignore +++ /dev/null @@ -1,37 +0,0 @@ -!/log/.keep -!/storage/.keep -!/tmp/.keep -.byebug_history -.yarn-integrity -/.bundle -/config/master.key -/db/*.sqlite3* -/db/*.sqlite3-journal -/elm-stuff -/log/* -/node_modules -/public/assets -/public/packs -/public/packs-test -/storage/* -/tmp/* -/yarn-error.log -coverage -yarn-debug.log* - -/public/packs -/public/packs-test -/node_modules -/yarn-error.log -yarn-debug.log* -.yarn-integrity -.env*.local - -.idea -.ruby-version -/app/assets/builds/* -!/app/assets/builds/.keep - -# Event to handlers and handler to events mappings generated by big_picture.rb script -/lib/event_to_handlers.rb -/lib/handler_to_events.rb \ No newline at end of file diff --git a/pricing_catalog_rails_app/Dockerfile b/pricing_catalog_rails_app/Dockerfile deleted file mode 100644 index 0ffa0232b..000000000 --- a/pricing_catalog_rails_app/Dockerfile +++ /dev/null @@ -1,62 +0,0 @@ -# syntax = docker/dockerfile:1 - -# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile -ARG RUBY_VERSION=3.2.0 -FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base - -# Rails app lives here -WORKDIR /rails - -# Set production environment -ENV RAILS_ENV="production" \ - BUNDLE_DEPLOYMENT="1" \ - BUNDLE_PATH="/usr/local/bundle" \ - BUNDLE_WITHOUT="development" - - -# Throw-away build stage to reduce size of final image -FROM base as build - -# Install packages needed to build gems -RUN apt-get update -qq && \ - apt-get install --no-install-recommends -y build-essential git pkg-config - -# Install application gems -COPY Gemfile Gemfile.lock ./ -RUN bundle install && \ - rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git && \ - bundle exec bootsnap precompile --gemfile - -# Copy application code -COPY . . - -# Precompile bootsnap code for faster boot times -RUN bundle exec bootsnap precompile app/ lib/ - -# Precompiling assets for production without requiring secret RAILS_MASTER_KEY -RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile - - -# Final stage for app image -FROM base - -# Install packages needed for deployment -RUN apt-get update -qq && \ - apt-get install --no-install-recommends -y curl libsqlite3-0 && \ - rm -rf /var/lib/apt/lists /var/cache/apt/archives - -# Copy built artifacts: gems, application -COPY --from=build /usr/local/bundle /usr/local/bundle -COPY --from=build /rails /rails - -# Run and own only the runtime files as a non-root user for security -RUN useradd rails --create-home --shell /bin/bash && \ - chown -R rails:rails db log storage tmp -USER rails:rails - -# Entrypoint prepares the database. -ENTRYPOINT ["/rails/bin/docker-entrypoint"] - -# Start the server by default, this can be overwritten at runtime -EXPOSE 3000 -CMD ["./bin/rails", "server"] diff --git a/pricing_catalog_rails_app/Gemfile b/pricing_catalog_rails_app/Gemfile deleted file mode 100644 index 124d5f633..000000000 --- a/pricing_catalog_rails_app/Gemfile +++ /dev/null @@ -1,50 +0,0 @@ -source "https://rubygems.org" - -ruby "3.2.0" -gem "rails", "~> 7.1.3" -gem "sqlite3", "~> 1.4" - -# Use the Puma web server [https://github.com/puma/puma] -gem "puma", ">= 5.0" - -# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails] -gem "importmap-rails" - -# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev] -gem "turbo-rails" - -# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev] -gem "stimulus-rails" - -# Use Redis adapter to run Action Cable in production -gem "redis", ">= 4.0.1" - -# Windows does not include zoneinfo files, so bundle the tzinfo-data gem -gem "tzinfo-data", platforms: %i[ windows jruby ] - -# Reduces boot times through caching; required in config/boot.rb -gem "bootsnap", require: false - -group :development, :test do - # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem - gem "debug", platforms: %i[ mri windows ] -end - -group :development do - # Use console on exceptions pages [https://github.com/rails/web-console] - gem "web-console" - - # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler] - # gem "rack-mini-profiler" - - # Speed up commands on slow machines / big apps [https://github.com/rails/spring] - # gem "spring" -end - -group :test do - # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing] - gem "capybara" - gem "selenium-webdriver" -end -gem "rails_event_store", "~> 2.14.0" -gem "infra", path: "../infra" \ No newline at end of file diff --git a/pricing_catalog_rails_app/Gemfile.lock b/pricing_catalog_rails_app/Gemfile.lock deleted file mode 100644 index 0ddc0d01e..000000000 --- a/pricing_catalog_rails_app/Gemfile.lock +++ /dev/null @@ -1,337 +0,0 @@ -PATH - remote: ../infra - specs: - infra (1.0.0) - aggregate_root (~> 2.13) - arkency-command_bus - dry-struct - dry-types - rake - ruby_event_store (~> 2.13) - ruby_event_store-transformations - sidekiq - -GEM - remote: https://rubygems.org/ - specs: - actioncable (7.1.3) - actionpack (= 7.1.3) - activesupport (= 7.1.3) - nio4r (~> 2.0) - websocket-driver (>= 0.6.1) - zeitwerk (~> 2.6) - actionmailbox (7.1.3) - actionpack (= 7.1.3) - activejob (= 7.1.3) - activerecord (= 7.1.3) - activestorage (= 7.1.3) - activesupport (= 7.1.3) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.1.3) - actionpack (= 7.1.3) - actionview (= 7.1.3) - activejob (= 7.1.3) - activesupport (= 7.1.3) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp - rails-dom-testing (~> 2.2) - actionpack (7.1.3) - actionview (= 7.1.3) - activesupport (= 7.1.3) - nokogiri (>= 1.8.5) - racc - rack (>= 2.2.4) - rack-session (>= 1.0.1) - rack-test (>= 0.6.3) - rails-dom-testing (~> 2.2) - rails-html-sanitizer (~> 1.6) - actiontext (7.1.3) - actionpack (= 7.1.3) - activerecord (= 7.1.3) - activestorage (= 7.1.3) - activesupport (= 7.1.3) - globalid (>= 0.6.0) - nokogiri (>= 1.8.5) - actionview (7.1.3) - activesupport (= 7.1.3) - builder (~> 3.1) - erubi (~> 1.11) - rails-dom-testing (~> 2.2) - rails-html-sanitizer (~> 1.6) - activejob (7.1.3) - activesupport (= 7.1.3) - globalid (>= 0.3.6) - activemodel (7.1.3) - activesupport (= 7.1.3) - activerecord (7.1.3) - activemodel (= 7.1.3) - activesupport (= 7.1.3) - timeout (>= 0.4.0) - activestorage (7.1.3) - actionpack (= 7.1.3) - activejob (= 7.1.3) - activerecord (= 7.1.3) - activesupport (= 7.1.3) - marcel (~> 1.0) - activesupport (7.1.3) - base64 - bigdecimal - concurrent-ruby (~> 1.0, >= 1.0.2) - connection_pool (>= 2.2.5) - drb - i18n (>= 1.6, < 2) - minitest (>= 5.1) - mutex_m - tzinfo (~> 2.0) - addressable (2.8.6) - public_suffix (>= 2.0.2, < 6.0) - aggregate_root (2.14.0) - base64 - ruby_event_store (= 2.14.0) - arkency-command_bus (0.4.1) - concurrent-ruby - base64 (0.2.0) - bigdecimal (3.1.6) - bindex (0.8.1) - bootsnap (1.17.1) - msgpack (~> 1.2) - builder (3.2.4) - capybara (3.40.0) - addressable - matrix - mini_mime (>= 0.1.3) - nokogiri (~> 1.11) - rack (>= 1.6.0) - rack-test (>= 0.6.3) - regexp_parser (>= 1.5, < 3.0) - xpath (~> 3.2) - concurrent-ruby (1.2.3) - connection_pool (2.4.1) - crass (1.0.6) - date (3.3.4) - debug (1.9.1) - irb (~> 1.10) - reline (>= 0.3.8) - drb (2.2.0) - ruby2_keywords - dry-core (1.0.1) - concurrent-ruby (~> 1.0) - zeitwerk (~> 2.6) - dry-inflector (1.0.0) - dry-logic (1.5.0) - concurrent-ruby (~> 1.0) - dry-core (~> 1.0, < 2) - zeitwerk (~> 2.6) - dry-struct (1.6.0) - dry-core (~> 1.0, < 2) - dry-types (>= 1.7, < 2) - ice_nine (~> 0.11) - zeitwerk (~> 2.6) - dry-types (1.7.2) - bigdecimal (~> 3.0) - concurrent-ruby (~> 1.0) - dry-core (~> 1.0) - dry-inflector (~> 1.0) - dry-logic (~> 1.4) - zeitwerk (~> 2.6) - erubi (1.12.0) - globalid (1.2.1) - activesupport (>= 6.1) - i18n (1.14.1) - concurrent-ruby (~> 1.0) - ice_nine (0.11.2) - importmap-rails (2.0.1) - actionpack (>= 6.0.0) - activesupport (>= 6.0.0) - railties (>= 6.0.0) - io-console (0.7.2) - irb (1.11.1) - rdoc - reline (>= 0.4.2) - loofah (2.22.0) - crass (~> 1.0.2) - nokogiri (>= 1.12.0) - mail (2.8.1) - mini_mime (>= 0.1.1) - net-imap - net-pop - net-smtp - marcel (1.0.2) - matrix (0.4.2) - mini_mime (1.1.5) - minitest (5.21.2) - msgpack (1.7.2) - mutex_m (0.2.0) - net-imap (0.4.9.1) - date - net-protocol - net-pop (0.1.2) - net-protocol - net-protocol (0.2.2) - timeout - net-smtp (0.4.0.1) - net-protocol - nio4r (2.7.0) - nokogiri (1.16.0-aarch64-linux) - racc (~> 1.4) - nokogiri (1.16.0-arm-linux) - racc (~> 1.4) - nokogiri (1.16.0-arm64-darwin) - racc (~> 1.4) - nokogiri (1.16.0-x86-linux) - racc (~> 1.4) - nokogiri (1.16.0-x86_64-darwin) - racc (~> 1.4) - nokogiri (1.16.0-x86_64-linux) - racc (~> 1.4) - psych (5.1.2) - stringio - public_suffix (5.0.4) - puma (6.4.2) - nio4r (~> 2.0) - racc (1.7.3) - rack (3.0.8) - rack-session (2.0.0) - rack (>= 3.0.0) - rack-test (2.1.0) - rack (>= 1.3) - rackup (2.1.0) - rack (>= 3) - webrick (~> 1.8) - rails (7.1.3) - actioncable (= 7.1.3) - actionmailbox (= 7.1.3) - actionmailer (= 7.1.3) - actionpack (= 7.1.3) - actiontext (= 7.1.3) - actionview (= 7.1.3) - activejob (= 7.1.3) - activemodel (= 7.1.3) - activerecord (= 7.1.3) - activestorage (= 7.1.3) - activesupport (= 7.1.3) - bundler (>= 1.15.0) - railties (= 7.1.3) - rails-dom-testing (2.2.0) - activesupport (>= 5.0.0) - minitest - nokogiri (>= 1.6) - rails-html-sanitizer (1.6.0) - loofah (~> 2.21) - nokogiri (~> 1.14) - rails_event_store (2.14.0) - activejob (>= 6.0) - activemodel (>= 6.0) - activesupport (>= 6.0) - aggregate_root (= 2.14.0) - arkency-command_bus (>= 0.4) - rails_event_store_active_record (= 2.14.0) - ruby_event_store (= 2.14.0) - ruby_event_store-browser (= 2.14.0) - rails_event_store_active_record (2.14.0) - ruby_event_store-active_record (= 2.14.0) - railties (7.1.3) - actionpack (= 7.1.3) - activesupport (= 7.1.3) - irb - rackup (>= 1.0.0) - rake (>= 12.2) - thor (~> 1.0, >= 1.2.2) - zeitwerk (~> 2.6) - rake (13.1.0) - rdoc (6.6.2) - psych (>= 4.0.0) - redis (5.0.8) - redis-client (>= 0.17.0) - redis-client (0.19.1) - connection_pool - regexp_parser (2.9.0) - reline (0.4.2) - io-console (~> 0.5) - rexml (3.2.6) - ruby2_keywords (0.0.5) - ruby_event_store (2.14.0) - concurrent-ruby (~> 1.0, >= 1.1.6) - ruby_event_store-active_record (2.14.0) - activerecord (>= 6.0) - ruby_event_store (= 2.14.0) - ruby_event_store-browser (2.14.0) - rack - ruby_event_store (= 2.14.0) - ruby_event_store-transformations (0.1.0) - activesupport (>= 5.0) - ruby_event_store (>= 2.0.0, < 3.0.0) - rubyzip (2.3.2) - selenium-webdriver (4.17.0) - base64 (~> 0.2) - rexml (~> 3.2, >= 3.2.5) - rubyzip (>= 1.2.2, < 3.0) - websocket (~> 1.0) - sidekiq (7.2.1) - concurrent-ruby (< 2) - connection_pool (>= 2.3.0) - rack (>= 2.2.4) - redis-client (>= 0.19.0) - sqlite3 (1.7.1-aarch64-linux) - sqlite3 (1.7.1-arm-linux) - sqlite3 (1.7.1-arm64-darwin) - sqlite3 (1.7.1-x86-linux) - sqlite3 (1.7.1-x86_64-darwin) - sqlite3 (1.7.1-x86_64-linux) - stimulus-rails (1.3.3) - railties (>= 6.0.0) - stringio (3.1.0) - thor (1.3.0) - timeout (0.4.1) - turbo-rails (1.5.0) - actionpack (>= 6.0.0) - activejob (>= 6.0.0) - railties (>= 6.0.0) - tzinfo (2.0.6) - concurrent-ruby (~> 1.0) - web-console (4.2.1) - actionview (>= 6.0.0) - activemodel (>= 6.0.0) - bindex (>= 0.4.0) - railties (>= 6.0.0) - webrick (1.8.1) - websocket (1.2.10) - websocket-driver (0.7.6) - websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.5) - xpath (3.2.0) - nokogiri (~> 1.8) - zeitwerk (2.6.12) - -PLATFORMS - aarch64-linux - arm-linux - arm64-darwin - x86-linux - x86_64-darwin - x86_64-linux - -DEPENDENCIES - bootsnap - capybara - debug - importmap-rails - infra! - puma (>= 5.0) - rails (~> 7.1.3) - rails_event_store (~> 2.14.0) - redis (>= 4.0.1) - selenium-webdriver - sqlite3 (~> 1.4) - stimulus-rails - turbo-rails - tzinfo-data - web-console - -BUNDLED WITH - 2.5.9 diff --git a/pricing_catalog_rails_app/README.md b/pricing_catalog_rails_app/README.md deleted file mode 100644 index 7db80e4ca..000000000 --- a/pricing_catalog_rails_app/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# README - -This README would normally document whatever steps are necessary to get the -application up and running. - -Things you may want to cover: - -* Ruby version - -* System dependencies - -* Configuration - -* Database creation - -* Database initialization - -* How to run the test suite - -* Services (job queues, cache servers, search engines, etc.) - -* Deployment instructions - -* ... diff --git a/pricing_catalog_rails_app/Rakefile b/pricing_catalog_rails_app/Rakefile deleted file mode 100644 index 9a5ea7383..000000000 --- a/pricing_catalog_rails_app/Rakefile +++ /dev/null @@ -1,6 +0,0 @@ -# Add your own tasks in files placed in lib/tasks ending in .rake, -# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. - -require_relative "config/application" - -Rails.application.load_tasks diff --git a/pricing_catalog_rails_app/app/admin/read_models/admin_catalog/admin_catalog.rb b/pricing_catalog_rails_app/app/admin/read_models/admin_catalog/admin_catalog.rb deleted file mode 100644 index d7cc7575f..000000000 --- a/pricing_catalog_rails_app/app/admin/read_models/admin_catalog/admin_catalog.rb +++ /dev/null @@ -1,36 +0,0 @@ -module AdminCatalog - - class Migration - def change - ActiveRecord::Base.connection.create_table :admin_catalog_products do |t| - t.string :product_id - t.string :name - t.decimal :price - - t.timestamps - end - end - end - - class Product < ActiveRecord::Base - self.table_name = 'admin_catalog_products' - end - - class Configuration - def call(event_store) - event_store.subscribe( - -> (event) {Product.create(product_id: event.data[:product_id])}, - to: [ProductCatalog::ProductRegistered]) - event_store.subscribe( - -> (event) {Product.find_by(product_id: event.data[:product_id]).update(name: event.data[:name])}, - to: [ProductCatalog::ProductNamed]) - event_store.subscribe( - -> (event) {Product.find_by(product_id: event.data[:product_id]).update(price: event.data[:price])}, - to: [Pricing::PriceSet]) - end - - private - - end - -end \ No newline at end of file diff --git a/pricing_catalog_rails_app/app/admin/read_models/admin_catalog/index.html.erb b/pricing_catalog_rails_app/app/admin/read_models/admin_catalog/index.html.erb deleted file mode 100644 index 67a6aa093..000000000 --- a/pricing_catalog_rails_app/app/admin/read_models/admin_catalog/index.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -Admin Catalog - -<%= form_for new_product, url: {controller: "admin/catalog", action: "create"} do |f| %> -
- <%= f.label :name %> - <%= f.text_field :name %> -
-- <%= f.label :price %> - <%= f.text_field :price %> -
- <%= f.submit %> -<% end %> - -You may have mistyped the address or the page may have moved.
-If you are the application owner check the logs for more information.
-Maybe you tried to change something you didn't have access to.
-If you are the application owner check the logs for more information.
-If you are the application owner check the logs for more information.
-