https://github.com/alanalvarez21/ecommerce-boilerplate
Ruby on Rails Ecommerce template
https://github.com/alanalvarez21/ecommerce-boilerplate
ruby ruby-app ruby-application ruby-apps ruby-gem ruby-gems ruby-lib ruby-on-rails rubygem rubyonrails
Last synced: 14 days ago
JSON representation
Ruby on Rails Ecommerce template
- Host: GitHub
- URL: https://github.com/alanalvarez21/ecommerce-boilerplate
- Owner: AlanAlvarez21
- Created: 2024-09-18T04:05:53.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-25T21:16:44.000Z (10 months ago)
- Last Synced: 2025-07-26T02:02:55.876Z (10 months ago)
- Topics: ruby, ruby-app, ruby-application, ruby-apps, ruby-gem, ruby-gems, ruby-lib, ruby-on-rails, rubygem, rubyonrails
- Language: Ruby
- Homepage:
- Size: 568 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ E-commerce Boilerplate - Rails Template
> **A complete e-commerce template built with Rails 8 to launch your online store in minutes**
[](https://rubyonrails.org/)
[](https://www.ruby-lang.org/)
[](https://www.docker.com/)
[](https://github.com/AlanAlvarez21/ecommerce-boilerplate/actions)
## ๐ฏ What is this project?
This is a complete e-commerce **boilerplate/template** designed to help you **launch your online store quickly**. It includes all the essential features you need to start selling products online, from inventory management to payment processing.
### โก **Why use this boilerplate?**
- ๐ **5-minute setup** - Uses Docker and devcontainers for development without complex configurations
- ๐ณ **Ready payments** - Complete integration with MercadoPago
- ๐ฑ **Responsive** - Modern design with Tailwind CSS
- ๐ **Admin panel** - Complete administration panel
- ๐ **Analytics** - Dashboard with sales metrics and reports
- ๐ **Multi-language** - Support for Spanish and English
- โ
**Tested** - Complete test suite with RSpec
---
## ๐๏ธ Main Features
### **For Customers (Frontend)**
- ๐ช **Product catalog** with categories and filters
- ๐ **Shopping cart** with session management
- ๐ณ **Integrated checkout** with MercadoPago
- ๐ฑ **Responsive design** optimized for mobile
- ๐ **Intuitive search and navigation**
### **For Administrators (Backend)**
- ๐ **Dashboard with metrics** for sales and analytics
- ๐ฆ **Product management** (full CRUD)
- ๐ **Category management** with images
- ๐ **Order management** and status tracking
- ๐ **Inventory control** and stock management
- ๐ฅ **Admin user system** with Devise
### **Technical**
- ๐ **Rails 8.0.1** with latest improvements
- ๐ **PostgreSQL** as database
- โก **Stimulus + Turbo** for interactivity
- ๐จ **Tailwind CSS** for styling
- ๐ณ **Docker** with devcontainers
- ๐งช **RSpec** for testing
- ๐ **Brakeman** for security
- ๐ **GitHub Actions** CI/CD
---
## ๐ Quick Start
### **1. Prerequisites**
```bash
# Install Docker
https://www.docker.com/
# Install Devcontainers CLI
npm install -g @devcontainers/cli
# or with npx
npx install -g @devcontainers/cli
```
### **2. Clone and run**
```bash
# Clone the repository
git clone https://github.com/AlanAlvarez21/ecommerce-boilerplate.git
cd ecommerce-boilerplate
# Build the container (includes DB setup)
bin/build_container
# Seed the database with sample data
bin/rails db:seed
# Start the application
bin/dev
```
### **3. Ready! ๐**
- **Frontend**: http://localhost:3000
- **Admin Panel**: http://localhost:3000/admin
- **Admin Credentials**:
- Email: `admin@coinsapp.com`
- Password: `password123`
---
## ๐ Project Structure
```
โโโ app/
โ โโโ controllers/
โ โ โโโ admin/ # Administration panel
โ โ โโโ application_controller.rb
โ โ โโโ cart_controller.rb
โ โ โโโ checkout_controller.rb
โ โ โโโ ...
โ โโโ models/
โ โ โโโ admin.rb # Admin users (Devise)
โ โ โโโ category.rb # Product categories
โ โ โโโ product.rb # Products
โ โ โโโ order.rb # Purchase orders
โ โ โโโ stock.rb # Inventory control
โ โ โโโ ...
โ โโโ views/
โ โ โโโ admin/ # Admin panel views
โ โ โโโ layouts/ # Layouts (app and admin)
โ โ โโโ ...
โ โโโ services/
โ โโโ mercado_pago_sdk.rb # Payment integration
โโโ config/
โ โโโ routes.rb # Application routes
โ โโโ ...
โโโ db/
โ โโโ migrate/ # Migrations
โ โโโ seeds.rb # Sample data
โโโ spec/ # Tests with RSpec
```
---
## ๐ณ Payment Setup (MercadoPago)
### **1. Get credentials**
1. Create account at [MercadoPago Developers](https://www.mercadopago.com/developers)
2. Get your `ACCESS_TOKEN` and `PUBLIC_KEY`
### **2. Configure environment variables**
```bash
# In .env or in your system
export MERCADOPAGO_ACCESS_TOKEN="your_access_token"
export MERCADOPAGO_PUBLIC_KEY="your_public_key"
```
### **3. Configure webhook**
```bash
# Webhook URL for notifications
https://your-domain.com/webhooks/mercadopago
```
---
## ๐ ๏ธ Development Commands
```bash
# Development
bin/dev # Server + Tailwind watcher
bin/rails server # Rails server only
bin/rails tailwindcss:watch # Tailwind watcher only
# Database
bin/rails db:create # Create database
bin/rails db:migrate # Run migrations
bin/rails db:seed # Seed with sample data
bin/rails db:reset # Reset and seed
# Testing
bundle exec rspec # Run tests
bin/brakeman # Security analysis
bin/rubocop # Code linting
# Assets
bin/rails assets:precompile # Compile assets for production
bin/rails tailwindcss:build # Build Tailwind CSS
```
---
## ๐จ Customization
### **1. Change visual theme**
```scss
// In app/assets/stylesheets/application.tailwind.css
// Customize main colors
:root {
--primary-color: #3b82f6;
--secondary-color: #64748b;
}
```
### **2. Modify default products**
```ruby
# In db/seeds.rb
# Change categories and products according to your business
categories = Category.create!([
{
name: "Your Category",
description: "Your category description",
# ...
}
])
```
### **3. Customize texts**
```yaml
# In config/locales/en.yml
en:
app_name: "Your Store"
meta_title: " - The best online store"
# ...
```
---
## ๐ Administration Panel
The admin panel includes:
- **๐ Dashboard**: Sales metrics, recent orders, best-selling products
- **๐๏ธ Products**: Full CRUD with image management
- **๐ Categories**: Organization with catalog images
- **๐ Orders**: Status management and tracking
- **๐ฆ Inventory**: Stock control per product
- **๐ฅ Admins**: Administrator user management
### **Access**
- URL: `/admin`
- Authentication: Devise
- Permissions: Admin users only
---
## ๐งช Testing
Complete test suite:
```bash
# Unit tests
bundle exec rspec spec/models/
# Controller tests
bundle exec rspec spec/controllers/
# Request tests
bundle exec rspec spec/requests/
# System tests (E2E)
bundle exec rspec spec/system/
# Coverage report
open coverage/index.html
```
---
## ๐ Deployment
### **Heroku**
```bash
# Create application
heroku create your-store
# Configure variables
heroku config:set RAILS_MASTER_KEY=your_master_key
heroku config:set MERCADOPAGO_ACCESS_TOKEN=your_token
# Deploy
git push heroku main
# Initial setup
heroku run rails db:migrate
heroku run rails db:seed
```
๐ฏ Seeds summary:
๐ Categories: 6
๐ช Products: 15
๐ฆ Stock entries: 15
๐ค Admins: 1
๐ Orders: 5
๐ Order products: 11
๐ Admin credentials:
Email: admin@coinsapp.com
Password: password123
### **Docker Production**
```bash
# Build image
docker build -t your-store .
# Run
docker run -p 3000:3000 \
-e RAILS_ENV=production \
-e DATABASE_URL=postgres://... \
your-store
```
---
## ๐ค Contributing
1. **Fork** the repository
2. **Create** a feature branch (`git checkout -b feature/AmazingFeature`)
3. **Commit** your changes (`git commit -m 'Add some AmazingFeature'`)
4. **Push** to the branch (`git push origin feature/AmazingFeature`)
5. **Create** a Pull Request
---
## ๐ Ideal Use Cases
This boilerplate is perfect for:
- ๐ช **Small/medium stores** that need quick online presence
- ๐ **Specialized products** (jewelry, collectibles, crafts)
- ๐จ **Artists and makers** who want to sell their creations
- ๐ **Educational or niche stores**
- ๐ **E-commerce MVPs** to validate business ideas
- ๐จโ๐ป **Developers** who need a solid starting point
---
## ๐ Roadmap
### **Upcoming features:**
- [ ] ๐ Advanced search with filters
- [ ] โญ Review and rating system
- [ ] ๐ง Integrated email marketing
- [ ] ๐ฑ PWA (Progressive Web App)
- [ ] ๐ More payment gateways
- [ ] ๐ฆ Shipping system integration
- [ ] ๐ค Basic chatbot
- [ ] ๐ Advanced analytics
---
## ๐ License
This project is under the MIT license. See `LICENSE` for more details.
---
## ๐ Support
- ๐ **Documentation**: [Project Wiki](https://github.com/AlanAlvarez21/ecommerce-boilerplate/wiki)
- ๐ **Issues**: [Report problems](https://github.com/AlanAlvarez21/ecommerce-boilerplate/issues)
- ๐ฌ **Discussions**: [GitHub Discussions](https://github.com/AlanAlvarez21/ecommerce-boilerplate/discussions)
---
**๐ Launch your e-commerce today!** This boilerplate saves you weeks of initial development.