snap-web
Rails application scaffold for the "snap" project.
This repository is a modern Rails 8 app (Propshaft assets, esbuild for JS, sass for CSS) using PostgreSQL and Sidekiq for background jobs. It includes production-focused Docker artifacts and a Render deploy configuration.
- At a glance
- Prerequisites
- Quick local setup
- Tests
- Docker
- Production & Deployment
- Asset compilation
- Background jobs
- Helpful files
- Contributing
- Contact / Maintainers
- Rails: ~> 8.0.3 (Gemfile)
- Ruby (recommended): 3.4.2 (matches Dockerfile ARG RUBY_VERSION)
- Node: 22.20.0 and Yarn 1.22.22 are used in the Dockerfile build stage
- DB: PostgreSQL
- App server: Puma (default) / Thruster used in Docker CMD
- Background jobs: Sidekiq
- JS bundler: esbuild (scripts in
package.json)
- Install a Ruby manager (rbenv, rvm, chruby). Use Ruby 3.4.2 to match the Dockerfile.
- Install Bundler (gem install bundler).
- Install Node (v22.x recommended) and Yarn (v1.x) if running assets locally.
- PostgreSQL (local dev DB) or access to a PostgreSQL instance.
- For image processing:
libvipsis used in the Dockerfile; install it locally if you need the same capabilities.
- Clone the repo:
git clone <repo-url> snap-web
cd snap-web- Install Ruby and set the correct version (example using rbenv):
rbenv install 3.4.2
rbenv local 3.4.2
gem install bundler- Install gems and JS dependencies:
bundle install
yarn install- Create and prepare the database:
bin/rails db:create db:migrate db:seed- Build assets (one-time for production-style build):
yarn build
yarn build:css- Run the app in development (recommended approach: use
Procfile.devto run multiple processes). The repository includes aProcfile.devwith common dev processes. Use a Procfile manager such asforeman,heroku local, orovermind.
Example using foreman:
# install foreman (if you don't have it)
gem install foreman
foreman start -f Procfile.devThis will start the Rails web server, js/css watchers and Sidekiq worker as defined in Procfile.dev:
- web:
env RUBY_DEBUG_OPEN=true bin/rails server - js:
yarn build --watch - css:
yarn build:css --watch - worker:
bundle exec sidekiq
Alternatively run just the web server for quick iteration:
bin/rails serverTo run Sidekiq separately:
bundle exec sidekiqRun the Rails test suite (the project uses the default Rails testing tools unless otherwise configured):
bin/rails testIf the repository adds RSpec later, use bundle exec rspec.
The provided Dockerfile is intended for production builds. Basic build/run example:
# build
docker build -t snap .
# run (you must provide RAILS_MASTER_KEY env value from config/master.key)
docker run -d -p 80:80 -e RAILS_MASTER_KEY=<your_master_key> --name snap snapNotes:
- The Dockerfile uses a multi-stage build and sets
RUBY_VERSION=3.4.2by default. - The image expects
RAILS_MASTER_KEYat runtime for credentials access.
- Kamal is included in the Gemfile and can be used for Docker/cluster deployments.
- A
render.yamlis included for deploying to Render.com. The Render configuration expects:- a managed PostgreSQL database (the
render.yamlreferencessnap-db) - the
RAILS_MASTER_KEYset in the Render environment variables (sync: false — set manually in the Render dashboard)
- a managed PostgreSQL database (the
Render build/start configuration (from render.yaml):
- buildCommand:
./bin/render-build.sh - startCommand:
./bin/rails server
When deploying anywhere, ensure:
RAILS_MASTER_KEYis provided by your hosting environment- Database credentials /
DATABASE_URLare configured WEB_CONCURRENCY/ process scaling are tuned for your plan
Two primary npm scripts are available in package.json:
yarn build— builds JS via esbuild intoapp/assets/builds(production bundle)yarn build:css— builds CSS (sass -> CSS)
For development use the watch modes in Procfile.dev.
Sidekiq is used for background processing. Start it with:
bundle exec sidekiqMake sure Redis is available if Sidekiq is configured to use it (check config/sidekiq.yml or environment).
Gemfile— Ruby dependenciespackage.json— JS/CSS build scripts & dependenciesDockerfile— production container imageProcfile.dev— processes for local developmentrender.yaml— Render.com service definition
Please open issues or PRs for bugs and feature requests. If you plan to work on larger changes, open an issue first so we can discuss the approach.
See repository maintainers via the hosting service or look in CONTRIBUTING.md if present.
If you'd like, I can also:
- add a short
bin/setupscript to automate local setup (bundle/yarn/db tasks), or - add a
Makefilewith common commands to simplify developer onboarding.
Tell me which of those you'd like next and I can implement it (no code changes to core app unless you ask). snap-web
Rails application scaffold for the "snap" project.
This repository is a modern Rails 8 app (Propshaft assets, esbuild for JS, sass for CSS) using PostgreSQL and Sidekiq for background jobs. It includes production-focused Docker artifacts and a Render deploy configuration.
- At a glance
- Prerequisites
- Quick local setup
- Tests
- Docker
- Production & Deployment
- Asset compilation
- Background jobs
- Helpful files
- Contributing
- Contact / Maintainers
- Rails: ~> 8.0.3 (Gemfile)
- Ruby (recommended): 3.4.2 (matches Dockerfile ARG RUBY_VERSION)
- Node: 22.20.0 and Yarn 1.22.22 are used in the Dockerfile build stage
- DB: PostgreSQL
- App server: Puma (default) / Thruster used in Docker CMD
- Background jobs: Sidekiq
- JS bundler: esbuild (scripts in
package.json)
- Install a Ruby manager (rbenv, rvm, chruby). Use Ruby 3.4.2 to match the Dockerfile.
- Install Bundler (gem install bundler).
- Install Node (v22.x recommended) and Yarn (v1.x) if running assets locally.
- PostgreSQL (local dev DB) or access to a PostgreSQL instance.
- For image processing:
libvipsis used in the Dockerfile; install it locally if you need the same capabilities.
- Clone the repo:
git clone <repo-url> snap-web
cd snap-web- Install Ruby and set the correct version (example using rbenv):
rbenv install 3.4.2
rbenv local 3.4.2
gem install bundler- Install gems and JS dependencies:
bundle install
yarn install- Create and prepare the database:
bin/rails db:create db:migrate db:seed- Build assets (one-time for production-style build):
yarn build
yarn build:css- Run the app in development (recommended approach: use
Procfile.devto run multiple processes). The repository includes aProcfile.devwith common dev processes. Use a Procfile manager such asforeman,heroku local, orovermind.
Example using foreman:
# install foreman (if you don't have it)
gem install foreman
foreman start -f Procfile.devThis will start the Rails web server, js/css watchers and Sidekiq worker as defined in Procfile.dev:
- web:
env RUBY_DEBUG_OPEN=true bin/rails server - js:
yarn build --watch - css:
yarn build:css --watch - worker:
bundle exec sidekiq
Alternatively run just the web server for quick iteration:
bin/rails serverTo run Sidekiq separately:
bundle exec sidekiqRun the Rails test suite (the project uses the default Rails testing tools unless otherwise configured):
bin/rails testIf the repository adds RSpec later, use bundle exec rspec.
The provided Dockerfile is intended for production builds. Basic build/run example:
# build
docker build -t snap .
# run (you must provide RAILS_MASTER_KEY env value from config/master.key)
docker run -d -p 80:80 -e RAILS_MASTER_KEY=<your_master_key> --name snap snapNotes:
- The Dockerfile uses a multi-stage build and sets
RUBY_VERSION=3.4.2by default. - The image expects
RAILS_MASTER_KEYat runtime for credentials access.
- Kamal is included in the Gemfile and can be used for Docker/cluster deployments.
- A
render.yamlis included for deploying to Render.com. The Render configuration expects:- a managed PostgreSQL database (the
render.yamlreferencessnap-db) - the
RAILS_MASTER_KEYset in the Render environment variables (sync: false — set manually in the Render dashboard)
- a managed PostgreSQL database (the
Render build/start configuration (from render.yaml):
- buildCommand:
./bin/render-build.sh - startCommand:
./bin/rails server
When deploying anywhere, ensure:
RAILS_MASTER_KEYis provided by your hosting environment- Database credentials /
DATABASE_URLare configured WEB_CONCURRENCY/ process scaling are tuned for your plan
Two primary npm scripts are available in package.json:
yarn build— builds JS via esbuild intoapp/assets/builds(production bundle)yarn build:css— builds CSS (sass -> CSS)
For development use the watch modes in Procfile.dev.
Sidekiq is used for background processing. Start it with:
bundle exec sidekiqMake sure Redis is available if Sidekiq is configured to use it (check config/sidekiq.yml or environment).
Gemfile— Ruby dependenciespackage.json— JS/CSS build scripts & dependenciesDockerfile— production container imageProcfile.dev— processes for local developmentrender.yaml— Render.com service definition
Please open issues or PRs for bugs and feature requests. If you plan to work on larger changes, open an issue first so we can discuss the approach.
See repository maintainers via the hosting service or look in CONTRIBUTING.md if present.