A small Rails + Hotwire photo gallery application demonstrating server-rendered interactivity with Turbo Frames, Stimulus, and Tailwind CSS.
Users can authenticate, browse seeded photos, search by photographer, and like or unlike photos without full page reloads.
- Devise authentication with a seeded demo user
- Photo import from
db/photos.csv - Authenticated all-photos gallery
- Server-side photographer search
- Liked photos page
- Like/unlike interactions with Turbo Frames
- Immediate icon feedback with Stimulus
- Database-backed like persistence
- Unique database constraint so each user can like a photo once
- Counter-cached like counts
- Responsive card layout and accessible controls
- RSpec coverage for models, requests, and the like/unlike system flow
- GitHub Actions CI for specs, RuboCop, Brakeman, and gem audit
- Ruby 4.0.3
- Rails 8.1.3
- SQLite3
- Devise
- Turbo
- Stimulus
- Tailwind CSS
- RSpec
Install dependencies and prepare the database:
bundle install
bin/rails db:prepare
bin/rails db:seedEmail: demo@example.com
Password: password123
The demo user and seeded photo data are created from db/seeds.rb. Photo records are imported from db/photos.csv and persisted in the database rather than read at runtime.
bin/devThen visit:
http://localhost:3000
bundle exec rspecRun quality checks:
bin/rubocop
bundle exec brakeman --no-pager --url-safe-methods safe_source_url
bin/bundler-audit check --update --database tmp/ruby-advisory-dbAuthentication is implemented with Devise using a seeded demo user so the project stays focused on gallery behavior.
Photo data is imported from db/photos.csv during seeding and persisted in the database to avoid runtime CSV parsing.
Likes are modeled as a join table between users and photos.
A unique composite database index on [user_id, photo_id] ensures a user can only like a photo once while maintaining database-level integrity.
counter_cache keeps like counts cheap to render.
The like/unlike UI is isolated within a Turbo Frame so only the relevant portion of the page updates after interaction.
Turbo handles server-driven UI replacement, while a lightweight Stimulus controller provides immediate visual feedback during interactions.
The application includes focused RSpec coverage for core business rules and user flows rather than exhaustive framework-level testing.

