Such a weird take. Of course "self hosting" means "self hosting".
Sure it could be easier/safer to manage, everything can be better.
Over the last couple of years hosting it I had a single issue with an upgrade but that was because I simply ignore the upgrade instructions and YOLOed the docker compose update.
Again, is it perfect? No.
Would I expect a non tech savy user to manage their own instance? Again no.
I like Hotwire but I admit its a bit confusing to get started with and the docs dont help.
Form submits + redirects are a bit weird, you cant really make the server "break out" of a frame during a redirect if the form was submitted from inside a frame (there are workarounds, see https://github.com/hotwired/turbo/issues/257).
Not that I think this is pratical or even looks good, but its also doable with rails
require 'bundler/inline'
gemfile(true) do
source 'https://rubygems.org'
gem 'rails', '~> 7.1'
gem "sqlite3", "~> 1.4"
end
require 'rails'
require 'active_record/railtie'
database = 'app_development.sqlite3'
ENV['DATABASE_URL'] = "sqlite3:#{database}"
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: database)
ActiveRecord::Schema.define do
create_table :my_table, force: true do |t|
t.integer :my_table_id
end
end
class App < Rails::Application
routes.append do
root to: 'home#index'
end
end
class HomeController < ActionController::Base
def index
render inline: 'HOME'
end
end
App.initialize!
run App
For very small apps on ruby land sinatra and roda are the right choices.
On python the choice would be flask instead of the single file django.
Not sure debian has (a modern) ruby installed by default, but I think you only need to have a working ruby installation and running the script. On a sidenote, this came out recently and could interest you https://dashbit.co/blog/announcing-phoenix-playground
1: apt install ruby
2: Put your code in test.rb
3: ruby test.rb
I then I got:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
\e[0m
current directory: /var/lib/gems/3.1.0/gems/stringio-3.1.1/ext/stringio
/usr/bin/ruby3.1 -I /usr/lib/ruby/vendor_ruby -r ./siteconf20240626-4044-iylnuy.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
You might have to install separate package for the ruby development
environment, ruby-dev or ruby-devel for example.
He seems a bit biased maybe?
Its fair that a rails controller does not exactly screams what its doing (implicit view rendering, routing etc).
But then, for someone not deep into react, a magic string like "use server" also does not clarify anything.
Also, he argues that just because you can it does not mean you should scatter sql queries around your views. But again, just because you can do a bunch of implicit stuff on a Rails controller it does not mean you should.