A modern e-commerce application built with Rails 8.1.0 and Ruby 3.3.6, showcasing the latest Rails 8 features including the complete "Solid" stack.
Originally based on the Agile Web Development with Rails 7 book by Sam Ruby, this project has been completely upgraded to Rails 8.1.0 with modern development practices, CI/CD, and containerization.
- 🚀 Solid Queue - Database-backed background jobs
- 💾 Solid Cache - Database-backed caching
- 🔌 Solid Cable - Database-backed WebSockets
- 🔐 Rails 8 Authentication - Modern session-based auth with rate limiting
- ✅ Ruby 3.3.6 with YJIT enabled
- ✅ Rails 8.1.0 with all latest features
- ✅ Tailwind CSS 4.x for styling
- ✅ Hotwire (Turbo + Stimulus) for interactivity
- ✅ SQLite3 for database (production-ready with proper configuration)
- 🐳 Docker support with multi-stage builds
- 🐳 Docker Compose for local development
- 🤖 Complete CI/CD Pipeline with GitHub Actions
- 🔒 Security scanning with Brakeman and Bundler Audit
- 📊 Code quality enforcement with RuboCop
- 🧪 Automated testing on every commit
- Ruby: 3.3.6
- Rails: 8.1.0
- Node.js: 18.x or later (for Tailwind CSS)
- Docker & Docker Compose: Latest (optional, for containerized development)
-
Install dependencies
bundle install
-
Set up databases
bin/rails db:setup
-
Run the development server
bin/dev
Access at http://localhost:3000
-
Start all services
docker compose up
Access at http://localhost:3000
-
Run commands in container
docker compose exec web bin/rails console docker compose exec web bin/rails test
Run the full test suite:
bin/rails testRun specific test types:
bin/rails test:models
bin/rails test:controllers
bin/rails test:systemThe application includes Rails 8's new authentication system:
- Session-based authentication with secure, httponly cookies
- Rate limiting (10 attempts per 3 minutes)
- Password reset via email
- Multi-session support with session tracking
Visit /session/new to sign in.
Check test/fixtures/users.yml for test credentials.
The application uses SQLite3 with separate databases for isolation:
db/development.sqlite3- Main application datadb/queue_development.sqlite3- Solid Queue jobsdb/cache_production.sqlite3- Solid Cache (production only)db/cable_production.sqlite3- Solid Cable (production only)
- Product - E-commerce products with validations
- User - Authenticated users with secure passwords
- Session - User sessions with IP and user agent tracking
- StoreController - Public storefront (unauthenticated)
- ProductsController - Product management (unauthenticated for demo)
- SessionsController - User authentication
- PasswordsController - Password reset flow
Background jobs are processed by Solid Queue:
bin/jobs # Start job workersdocker build -t depot:latest .
docker run -p 3000:3000 \
-e RAILS_ENV=production \
-e SECRET_KEY_BASE=$(bin/rails secret) \
depot:latest- Database: Consider PostgreSQL for high-traffic production use
- Assets: Assets are precompiled in Docker image
- Background Jobs: Run
bin/jobsas a separate process - Environment Variables: Set
SECRET_KEY_BASEsecurely - HTTPS: Use a reverse proxy (nginx, Caddy) for SSL
Automated workflows run on every PR and push to main:
- Testing - Full test suite with minitest
- Linting - RuboCop style and quality checks
- Security - Brakeman and bundler-audit scans
- Docker - Build and publish images to GHCR
bundle exec rubocop # Run linter
bundle exec rubocop --auto-correct-all # Auto-fix issuesbundle exec brakeman --no-pager # Rails security scan
bundle exec bundler-audit check # Dependency vulnerabilitiesbin/rails db:migrate # Run migrations
bin/rails db:rollback # Rollback last migration
bin/rails db:seed # Seed database
bin/rails db:reset # Reset databaseThis application demonstrates many Rails 8 features:
- ✅ Solid Queue - Background job processing without Redis
- ✅ Solid Cache - Database-backed caching
- ✅ Solid Cable - WebSocket pub/sub without Redis
- ✅ Authentication Generator - Secure session-based auth
- ✅ Rate Limiting - Built-in request throttling
- ✅ Kamal 2 Ready - Modern deployment configuration
- ✅ Propshaft - Modern asset pipeline (via Sprockets for compatibility)
- ✅ Tailwind CSS 4.x - JIT compilation
bin/rails db:test:prepare
bin/rails test# Find and kill process on port 3000
lsof -ti:3000 | xargs kill -9docker compose down -v # Remove volumes
docker compose build # Rebuild images
docker compose up # Start fresh- SECURITY.md - Security policies and practices
- MIGRATION_PLAN.md - Rails 8.1 upgrade journey
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Run tests (
bin/rails test) - Run linter (
bundle exec rubocop) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
All PRs are automatically tested by CI/CD pipeline.
This project is available for educational purposes.
- Sam Ruby for the excellent Agile Web Development with Rails book
- Chris Oliver for the Learn Ruby on Rails for Beginners course
- The Rails core team for Rails 8 and the amazing Solid* libraries
- 37signals for pioneering the Solid stack in production
Built with ❤️ using Rails 8.1.0 and Ruby 3.3.6