Skip to content

Commit 74dc59c

Browse files
teetanghclaude
andcommitted
chore: Remove SQLite and streamline dependencies
Removed unnecessary dependencies for API-only application using Couchbase: **Removed gems:** - sqlite3 (not needed - using Couchbase as database) - capybara (no system testing for API) - selenium-webdriver (no browser automation needed) - sprockets-rails (no asset pipeline for API) - importmap-rails (no JavaScript imports needed) - turbo-rails (no Hotwire features needed) - stimulus-rails (no Stimulus controllers needed) **Configuration changes:** - Updated config/application.rb to load only required Rails components - Excluded activerecord/railtie (using couchbase-orm instead) - Excluded active_storage/engine and action_cable/railtie (not needed) - Updated config/database.yml with clear note that it's not used - Commented out ActiveRecord configurations in spec/rails_helper.rb - Removed active_storage configuration from config/environments/test.rb **Removed directories/files:** - app/javascript/ (unused Stimulus controllers) - db/ (no migrations with Couchbase) - config/importmap.rb (not needed) - config/initializers/assets.rb (no asset pipeline) **Impact:** - Reduced gem count and bundle size - Faster boot time and bundle install - Clearer developer onboarding (no SQLite confusion) - All 27 tests passing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent bb899a9 commit 74dc59c

File tree

12 files changed

+41
-102
lines changed

12 files changed

+41
-102
lines changed

Gemfile

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,9 @@ ruby '3.4.1'
55
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
66
gem 'rails', '~> 7.1.3', '>= 7.1.3.2'
77

8-
# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
9-
gem 'sprockets-rails'
10-
11-
# Use sqlite3 as the database for Active Record
12-
gem 'sqlite3', '~> 1.4'
13-
148
# Use the Puma web server [https://github.com/puma/puma]
159
gem 'puma', '>= 5.0'
1610

17-
# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
18-
gem 'importmap-rails'
19-
20-
# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
21-
gem 'turbo-rails'
22-
23-
# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
24-
gem 'stimulus-rails'
25-
2611
# Build JSON APIs with ease [https://github.com/rails/jbuilder]
2712
gem 'jbuilder'
2813

@@ -72,7 +57,5 @@ group :development do
7257
end
7358

7459
group :test do
75-
# Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
76-
gem 'capybara'
77-
gem 'selenium-webdriver'
60+
# API-only testing with RSpec (no system/browser testing needed)
7861
end

app/javascript/application.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

app/javascript/controllers/application.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

app/javascript/controllers/hello_controller.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

app/javascript/controllers/index.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

config/application.rb

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
require_relative 'boot'
22

3-
require 'rails/all'
3+
# Load Rails components individually (excluding activerecord since we use Couchbase via couchbase-orm)
4+
require 'rails'
5+
%w(
6+
action_controller
7+
action_view
8+
action_mailer
9+
active_job
10+
).each do |framework|
11+
begin
12+
require "#{framework}/railtie"
13+
rescue LoadError
14+
end
15+
end
16+
17+
# Excluded components (using Couchbase instead of ActiveRecord):
18+
# - active_record/railtie - Using Couchbase via couchbase-orm
19+
# - active_storage/engine - Not needed for API-only app
20+
# - action_cable/railtie - Not using WebSockets
421

522
# Require the gems listed in Gemfile, including any gems
623
# you've limited to :test, :development, or :production.

config/database.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
1-
# SQLite. Versions 3.8.0 and up are supported.
2-
# gem install sqlite3
3-
#
4-
# Ensure the SQLite 3 gem is defined in your Gemfile
5-
# gem "sqlite3"
1+
# NOTE: This file is not used by the application.
2+
# This application uses Couchbase as its database through the couchbase-orm gem.
3+
# Database connections are configured in config/initializers/couchbase.rb
64
#
5+
# The configuration below is kept for Rails compatibility but is not actively used.
6+
# No SQL database (SQLite, PostgreSQL, MySQL) is required for this application.
7+
8+
# Minimal configuration to prevent Rails from attempting database connections
79
default: &default
8-
adapter: sqlite3
9-
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
10-
timeout: 5000
10+
adapter: nulldb
1111

1212
development:
1313
<<: *default
14-
database: storage/development.sqlite3
1514

16-
# Warning: The database defined as "test" will be erased and
17-
# re-generated from your development database when you run "rake".
18-
# Do not set this db to the same as development or production.
1915
test:
2016
<<: *default
21-
database: storage/test.sqlite3
2217

2318
production:
2419
<<: *default
25-
database: storage/production.sqlite3

config/environments/test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
config.action_controller.allow_forgery_protection = false
3636

3737
# Store uploaded files on the local file system in a temporary directory.
38-
config.active_storage.service = :test
38+
# config.active_storage.service = :test # Commented out - not using ActiveStorage
3939

4040
config.action_mailer.perform_caching = false
4141

config/importmap.rb

Lines changed: 0 additions & 7 deletions
This file was deleted.

config/initializers/assets.rb

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)