This is a full-stack e-commerce application built with Ruby on Rails as a learning project.
The goal is to deeply understand:
- Rails MVC architecture
- Database design & associations
- Real-world business logic (cart β order β checkout)
- Authentication & authorization
- Scalable app structure
By the end of this project, I should be able to:
- Design relational data models confidently
- Build full CRUD flows in Rails
- Handle sessions and state (cart system)
- Implement authentication and authorization
- Manage multi-step workflows (checkout)
- Structure a production-ready Rails app
- Ruby on Rails (Full Stack)
- PostgreSQL
- ERB (views)
- Tailwind
- Devise (authentication)
- Active Storage (file uploads)
- Payment processor integration --- Stripe or Pesapal or any alternative I figure out with time.
- Initialize Rails app
- Setup PostgreSQL
- Initial project structure ready
Goal: Users can browse products
-
Generate Category model
-
Generate Product model
-
Setup associations:
- Category has_many Products
- Product belongs_to Category
-
Add validations:
- Product: name, price, stock, description
- Category: name
-
Create ProductsController:
- index
- show
-
Setup routes:
- root β products#index
- products#index
- products#show
-
Build views:
- product listing page
- product detail page
-
Seed sample data (10+ products)
- Users can view products
- Each product has valid data
- Relationships work correctly
Goal: Admin can manage products and categories
-
Create Admin namespace
-
Admin::ProductsController (full CRUD)
-
Admin::CategoriesController (full CRUD)
-
Build forms:
- new/edit product
- new/edit category
-
Reuse form partials
- Admin can create/edit/delete products
- Categories are assignable to products
Goal: Introduce users and restrict admin access
-
Generate User model
-
Add fields:
- password_digest
- role
-
Implement authentication (Devise)
-
Add roles:
- admin
- customer
-
Protect admin routes
- Users can sign up and log in
- Only admins access admin panel
Goal: Users can add products to a cart
-
Implement session-based cart:
- session[:cart]
-
Cart actions:
- add item
- remove item
- update quantity
-
Create CartController:
- show
- add_item
- remove_item
- update_item
-
Build cart page:
- list items
- show totals
- Cart persists per session
- Totals calculate correctly
Goal: Convert cart into an order
-
Generate Order model
-
Generate OrderItem model
-
Setup associations:
- User has_many Orders
- Order has_many OrderItems
- OrderItem belongs_to Product
-
Add fields:
- Order: status, total_amount, address
- OrderItem: quantity, unit_price, subtotal
-
Implement checkout flow:
- create order
- move cart items β order items
- clear session cart
- Orders are created correctly
- Prices are stored at purchase time
Goal: Complete purchase process
-
Create checkout page
-
Capture:
- shipping address
- phone number
-
Add order confirmation page
-
Add order statuses:
- pending
- paid
- shipped
- cancelled
- User can complete an order end-to-end
Goal: Introduce payment logic
- Add payment_method
- Add payment_status
- Integrate Stripe
- Handle webhooks
- Orders track payment status correctly
Goal: Improve UX and realism
- Product search
- Category filtering
- Pagination
- Image uploads (Active Storage)
- Order history (user)
- Admin order management
- Email confirmations
- Stock updates after purchase
- App feels like a real product
- Build in small vertical slices
- Make it work β then clean β then improve
- Avoid over-engineering early
- Focus on understanding, not speed
Milestone 1: Product Catalog
- Browse products
- View product details
- Add to cart
- Place order
- View order history
- Manage products
- Manage categories
- View orders
- Update order status
This README is a living roadmap and will evolve as the project grows.