Live Website: https://project-se-1-0d8c6f6dc1ab.herokuapp.com/
# Push code to Heroku
git push heroku change-repo-structure:main
# Run database migrations
heroku run rails db:migrate -a project-se-1
# Seed initial data
heroku run rails db:seed -a project-se-1Once deployed, visit: https://project-se-1-0d8c6f6dc1ab.herokuapp.com/
PC Builder is a full-stack Ruby on Rails web application that allows users to browse, filter, and assemble custom PC builds. It provides a modular architecture with clearly separated models, controllers, and views for scalability and maintainability.
- Browse PC components (CPU, GPU, Motherboard, Memory, Storage, Cooler, Case, PSU)
- View detailed specifications per component type
- Filter by type, brand, and keywords
- Create and manage PC builds
- Sample parts and recent builds displayed on the Home page
- Lightweight login system (Dev login / guest browsing)
- Attributes:
name,email - Validations: presence and uniqueness of
email - Associations:
has_many :builds
- Attributes:
name,total_wattage,user_id - Associations:
belongs_to :user, optional: truehas_many :build_itemshas_many :parts, through: :build_items - Validations: presence of
name
- Join model between
BuildandPart - Attributes:
quantity,note - Validations:
quantity > 0 - Associations:
belongs_to :build,belongs_to :part
-
Attributes:
name,brand,model_number,type,price_cents,wattage -
Subclasses:
Cpu– extra fields: cores, threads, base/boost GHz, socket, TDP, cache, iGPUGpu,Motherboard,Memory,Storage,Cooler,PcCase,Psu– placeholders
-
Note:
PcCasereplacesCaseto avoid Ruby keyword conflicts.
| Controller | Description |
|---|---|
| HomeController | Displays featured parts and recent builds |
| UsersController | Lists all users and user profiles |
| PartsController | Handles browsing and filtering of all PC parts (index, show) |
| BuildsController | CRUD for builds (index, show, new, create) with grouped quantity handling |
- Displays sample parts grouped by category
- Shows recent builds and login/logout buttons
indexandshowpages for user info
index.html.erb: parts table with type, brand, nameshow.html.erb: detailed specs per part- Dynamic partials for type-specific details (
_details_cpu.html.erb, etc.)
index: user builds overviewshow: lists selected parts per buildnew: form for creating a build with grouped inputs
Rails.application.routes.draw do
root "home#index"
resources :users, only: [:index, :show]
resources :parts, only: [:index, :show]
resources :builds
post "/dev_login", to: "sessions#create"
delete "/logout", to: "sessions#destroy"
end-
Default user: Harsh (harsh@example.com)
-
Example CPU: Ryzen 7 7800X3D
- 8 cores / 16 threads
- 4.2 GHz base / 5.0 GHz boost
- AM5 socket, 120W TDP, 104MB cache
-
Sample placeholder data for other components (GPU, Motherboard, Memory, etc.)
- Uses Single Table Inheritance (STI) for parts (
typecolumn) - Acronym models (
Cpu,Gpu,Psu) follow Zeitwerk autoloading conventions parts#showdynamically loads partials based on part type- Dev Login auto-creates a guest session (
harsh@example.com) - Build creation supports both
part_idsandquantities
git clone <repo_url>
cd pc_builder
bundle installPostgreSQL (recommended, matches Heroku):
rails db:drop db:create db:migrate db:seedSQLite (default local dev):
rails db:preparebin/rails serverThen visit http://localhost:3000
- Uses RSpec for model, controller, and integration tests.
- Coverage reports generated via SimpleCov.
Run tests:
bundle exec rspec- Extend component attributes (GPU, Motherboard, Memory, etc.)
- Compute
Build#total_priceandBuild#total_wattage - Add authentication with Devise
- Tailwind CSS for modern UI design
- Increase test coverage with RSpec
- Add JSON APIs for builds and parts
This repository also includes comprehensive technical documentation for both end-users and developers.
- User Guide — Complete guide for end-users on how to use the PC Builder application
- Deployment Guide — Detailed instructions for setting up, configuring, and deploying the application
- System Architecture — System, class, and component architecture diagrams
- Database Schema — Entity-relationship and schema documentation
- Logging Guide — Technical documentation for the logging and monitoring system
docs/
├── README.md # Documentation index (this section)
├── USER_GUIDE.md # End-user documentation
├── DEPLOYMENT_GUIDE.md # Zero-to-deployed setup guide
├── ARCHITECTURE.md # System and component architecture diagrams
├── DATABASE_SCHEMA.md # Database structure and ER diagrams
└── LOGGING_GUIDE.md # Logging system and configuration details
- Start Here: User Guide – Complete usage guide for PC Builder
- Deployment Guide – Setup and deploy from scratch
- System Architecture – Understand the architecture and design
- Database Schema – Explore database structure and relationships
- Logging Guide – Learn how logging is implemented and used
- System Diagram: High-level system architecture with layers
- Class Diagram: Object-oriented design and relationships
- Database Diagram: Entity-relationship diagrams and schema
- Component Architecture: Detailed component interactions
- API Flow Diagrams: Request/response flow visualization
- Zero to Deployed: Complete setup from fresh clone
- Development Setup: Local environment configuration
- Production Deployment: Docker, Kamal, or manual setups
- Environment Configuration: Database, SSL, and monitoring
- Troubleshooting: Common issues and their resolutions
- ADR-001: Technology Stack Selection
- ADR-002: Database Design Decisions
- ADR-003: Authentication Strategy
- ADR-004: API Design Approach
- API Documentation: REST API endpoints and usage
- Testing Strategy: Testing standards and practices
- Security Guide: Implementation and hardening guidelines
- Performance Guide: Optimization and monitoring strategies
Last Updated: October 6, 2025 Project: PC Builder Rails Application Documentation Version: 1.0