Skip to content
This repository was archived by the owner on Nov 25, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ gem 'rails', '~> 7.0.4'
# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
gem 'sprockets-rails'

# Use sqlite3 as the database for Active Record
gem 'sqlite3', '~> 1.4'

# Use the Puma web server [https://github.com/puma/puma]
gem 'puma', '~> 5.0'

Expand Down Expand Up @@ -54,6 +51,9 @@ gem 'bootsnap', require: false
# gem "image_processing", "~> 1.2"

group :development, :test do
# Use sqlite3 as the database for Active Record
gem 'sqlite3', '~> 1.4'

# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem 'debug', platforms: %i[mri mingw x64_mingw]
end
Expand All @@ -68,10 +68,10 @@ group :development do
# Speed up commands on slow machines / big apps [https://github.com/rails/spring]
# gem "spring"

gem 'solargraph'
gem 'reek', '~> 6.1'
gem 'rubocop', '~> 1.37'
gem 'rubocop-rails', '~> 2.17'
gem 'solargraph'
end

group :test do
Expand All @@ -81,6 +81,10 @@ group :test do
gem 'webdrivers'
end

group :production do
gem 'pg', '~> 1.4'
end

gem 'pagy', '~> 5.10'
gem 'rack-cors', '~> 1.1'
gem 'ransack', '~> 3.2'
Expand Down
6 changes: 6 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,14 @@ GEM
nio4r (2.5.8)
nokogiri (1.13.9-arm64-darwin)
racc (~> 1.4)
nokogiri (1.13.9-x86_64-linux)
racc (~> 1.4)
pagy (5.10.1)
activesupport
parallel (1.22.1)
parser (3.1.2.1)
ast (~> 2.4.1)
pg (1.4.5)
public_suffix (5.0.0)
puma (5.6.5)
nio4r (~> 2.0)
Expand Down Expand Up @@ -241,6 +244,7 @@ GEM
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sqlite3 (1.5.3-arm64-darwin)
sqlite3 (1.5.3-x86_64-linux)
stimulus-rails (1.1.0)
railties (>= 6.0.0)
thor (1.2.1)
Expand Down Expand Up @@ -279,6 +283,7 @@ GEM

PLATFORMS
arm64-darwin-21
x86_64-linux

DEPENDENCIES
bootsnap
Expand All @@ -288,6 +293,7 @@ DEPENDENCIES
jbuilder
jsbundling-rails
pagy (~> 5.10)
pg (~> 1.4)
puma (~> 5.0)
rack-cors (~> 1.1)
rails (~> 7.0.4)
Expand Down
2 changes: 2 additions & 0 deletions app/components/search_list_form_component.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require 'ransack/helpers'

module SearchListFormHelper
def form_tag(options = {}, &)
options.merge!({ builder: SearchListBuilder })
Expand Down
8 changes: 8 additions & 0 deletions bin/render-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
# exit on error
set -o errexit

bundle install
bundle exec rake assets:precompile
bundle exec rake assets:clean
bundle exec rake db:migrate
3 changes: 2 additions & 1 deletion config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ test:

production:
<<: *default
database: db/production.sqlite3
adapter: postgresql
url: <%= ENV['DATABASE_URL'] %>
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? || ENV['RENDER'].present?

# Compress CSS using a preprocessor.
# config.assets.css_compressor = :sass
Expand Down
4 changes: 2 additions & 2 deletions config/puma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
# Workers do not work on JRuby or Windows (both of which do not support
# processes).
#
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
workers ENV.fetch("WEB_CONCURRENCY") { 4 }

# Use the `preload_app!` method when specifying a `workers` number.
# This directive tells Puma to first boot the application and load code
# before forking the application. This takes advantage of Copy On Write
# process behavior so workers use less memory.
#
# preload_app!
preload_app!

# Allow puma to be restarted by `bin/rails restart` command.
plugin :tmp_restart
2 changes: 1 addition & 1 deletion db/migrate/20221022131756_create_kit_components.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class CreateKitComponents < ActiveRecord::Migration[7.0]
def change
create_table(:kit_components) do |t|
t.references(:product, null: false, foreign_key: true)
t.references(:product, null: false, foreign_key: { to_table: :kit_products })
t.string(:name)

t.timestamps
Expand Down
26 changes: 12 additions & 14 deletions db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/src/services.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios from "axios";

const api = axios.create({
baseURL: "http://localhost:3000/api/",
baseURL: process.env.NEXT_PUBLIC_API_URL,
timeout: 5000,
headers: {
Accept: "application/json",
Expand Down
18 changes: 18 additions & 0 deletions render.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
databases:
- name: rails-7-fullstack
databaseName: rails_7_fullstack
user: rails_7_fullstack_user

services:
- type: web
name: rails-7-fullstack
env: ruby
buildCommand: "./bin/render-build.sh"
startCommand: "bundle exec puma -C config/puma.rb"
envVars:
- key: DATABASE_URL
fromDatabase:
name: rails-7-fullstack
property: connectionString
- key: RAILS_MASTER_KEY
sync: false