An app to create and manage your favourite restaurants list
Prefê allows users to save, organize, and revisit their favourite restaurants through a simple web application.
The project focuses on Rails application architecture, asynchronous background processing, pagination, automated testing, and code quality, using a realistic domain to practice full-stack development.
- 🍽️ Save and manage favorite restaurants
- 📋 Paginated restaurant listings with Kaminari
- ⚙️ Asynchronous background processing with Sidekiq
- 🔴 Redis-backed job processing
- 🧪 Automated tests with RSpec
- 🏭 Test data with FactoryBot
- 📏 Code quality enforcement with RuboCop
- 🐳 Docker support
Backend
- Ruby
- Ruby on Rails
- Active Record
Database
- PostgreSQL
Background Processing
- Sidekiq
- Redis
Frontend
- Rails Views
- ERB
Testing & Code Quality
- RSpec
- FactoryBot
- RuboCop
Other
- Kaminari
- Docker
Prefê follows the conventional Ruby on Rails MVC Model–View–Controller architecture. Background processing is separated from the main request cycle and handled asynchronously through Sidekiq and Redis.
┌───────────────────┐
│ User / Browser │
└─────────┬─────────┘
│
▼
┌───────────────────┐
│ Rails Controllers │
└─────────┬─────────┘
│
┌─────────┴─────────┐
▼ ▼
┌────────────┐ ┌────────────┐
│ Models │ │ Views │
└─────┬──────┘ └────────────┘
│
▼
┌────────────┐
│ PostgreSQL │
└────────────┘
Background processing:
Rails Application
│
▼
┌───────────┐
│ Sidekiq │
└─────┬─────┘
│
▼
┌───────────┐
│ Redis │
└───────────┘
Background jobs allow operations that do not need to block the HTTP request to be processed asynchronously.
One of the main technical goals of Prefê is to demonstrate asynchronous processing with Sidekiq and Redis.
Instead of performing potentially expensive operations during the HTTP request, background jobs can be delegated to Sidekiq.
HTTP Request
│
▼
Rails Application
│
├──────────────► Immediate response
│
▼
Sidekiq
│
▼
Redis
│
▼
Background Job
This approach keeps the request/response cycle independent from tasks that do not need to block the user.
Restaurant listings use Kaminari to paginate records instead of loading the entire collection at once.
This provides a more scalable approach to displaying larger datasets.
The application uses RSpec and FactoryBot to test application behavior and domain logic and covers the application's main layers, including models and controllers.
Run the test suite with:
bundle exec rspecRuboCop is used to enforce Ruby style and maintain consistent code quality.
Run RuboCop with:
bundle exec rubocopThe project uses:
- RSpec for automated testing
- FactoryBot for test data
- Shoulda Matchers where applicable
- Database Cleaner for test database isolation
The test suite covers application behavior across models and controllers.
Run all tests:
bundle exec rspecFor more detailed output:
bundle exec rspec --format documentationMake sure you have installed:
- Ruby 3.x
- Rails 7.x
- PostgreSQL
- Redis
- Bundler
Or run with Docker in a containerized environment.
git clone https://github.com/digidweb/prefe.git
cd prefebundle installrails db:create
rails db:migrate
rails db:seedRedis is required for Sidekiq.
In a separate terminal:
redis-serverIn another terminal:
bundle exec sidekiqIn another terminal:
rails serverThe application will be available at:
http://localhost:3000
The application can also be run using Docker.
docker build -t prefe .docker run -p 3000:3000 prefeFor background processing, Redis and Sidekiq must also be available to the application.
Unlike a basic CRUD application, Prefê was designed to explore how a Rails application can handle operations that should not block the user's request.
The project therefore focuses on three complementary areas:
Web Application
│
┌──────┴──────┐
▼ ▼
PostgreSQL Background
Persistence Processing
│
Sidekiq + Redis
+
Automated Quality
RSpec + RuboCop
This combination provides practical experience with application architecture, asynchronous processing, automated testing, and maintainable Ruby code.
Possible next steps include:
- Add authentication and authorization
- Add request/integration test coverage
- Add GitHub Actions for automated tests and RuboCop
- Add restaurant search and filtering
- Add production deployment
- Add monitoring for background jobs
Prefê is part of a portfolio focused on Ruby on Rails backend and full-stack development.
The project demonstrates practical experience with:
Ruby on Rails · PostgreSQL · Active Record · Sidekiq · Redis · RSpec · FactoryBot · Kaminari · RuboCop · Docker
Rather than being only a CRUD application, Prefê explores how a Rails application can combine domain logic, asynchronous processing, pagination, automated testing, and code quality practices in a single project.