A modern Ruby on Rails e-commerce platform offering official merchandise for the African Ruby Community (ARC), active since 2010 with over 4,000 members across East Africa.
Live Store: https://duka.nairuby.org
- 🛒 Browse products by category (Shirts, Hoodies, Mugs, Accessories, etc.)
- 🎨 Product variants (sizes, colors) with stock tracking
- 🛍️ Real-time shopping cart with instant updates
- 💳 Multiple payment methods (M-Pesa, Card, Bank Transfer, Cash on Delivery)
- 📱 Fully responsive mobile-first design
- 🔐 Secure checkout with guest and authenticated options
- 📧 Order confirmation and tracking
- 💱 Multi-currency support (KES, USD, EUR, GBP)
- 🎛️ Beautiful admin panel powered by Avo
- 📊 Stock management dashboard with low stock alerts
- 📦 Product and variant management
- 🛒 Order management and tracking
- 👥 User management with role-based access
- 📈 Sales and inventory metrics
- Framework: Ruby on Rails 8.1
- Database: PostgreSQL
- Styling: Tailwind CSS 4.0
- JavaScript: Hotwire (Turbo + Stimulus)
- Admin Panel: Avo 3.0
- Authentication: Devise
- Payment Ready: M-Pesa, Stripe, Paystack integration points
- Deployment: Kamal 2.0
- Ruby 3.4.7+
- Rails 8.1+
- PostgreSQL 14+
- Node.js 18+
- Yarn or npm
-
Clone the repository
git clone https://github.com/nairuby/duka.git cd duka -
Install dependencies
bundle install yarn install # or npm install -
Setup database
rails db:create rails db:migrate rails db:seed
-
Start the development server
bin/dev
-
Visit the application
- Store: http://localhost:3000
- Admin Panel: http://localhost:3000/avo
- Admin Login:
[email protected]/admin123456
This project includes a complete Dev Container setup for consistent development environments.
Requirements:
- Docker Desktop
- VS Code with Dev Containers extension
Steps:
- Clone the repository
- Open in VS Code
- Click "Reopen in Container" when prompted
- Run
rails db:setupin the terminal - Run
bin/devto start the server
Comprehensive documentation is available in the /docs directory:
- CONTRIBUTING.md - How to contribute to the project
- docs/ADMIN_PANEL.md - Admin panel guide
- docs/CHECKOUT_SYSTEM.md - Checkout architecture
- docs/PRODUCT_VARIANTS.md - Product & variant management
- docs/LOGIN_UI_FEATURES.md - Authentication UI details
- docs/DEVELOPMENT.md - Development guide (NEW)
- docs/ARCHITECTURE.md - System architecture (NEW)
# Run all tests
bundle exec rspec
# Run specific test file
bundle exec rspec spec/models/product_spec.rb
# Run with coverage
COVERAGE=true bundle exec rspec
# Lint Ruby code
bundle exec rubocop
# Auto-fix linting issues
bundle exec rubocop -aThis project follows:
- Ruby Style Guide via RuboCop
- Rails Best Practices
- Tailwind CSS for styling
- Stimulus for JavaScript interactions
duka/
├── app/
│ ├── avo/ # Admin panel resources
│ ├── controllers/ # Request handlers
│ ├── models/ # Business logic
│ ├── services/ # Service objects (CartService, etc.)
│ ├── views/ # Templates
│ └── javascript/ # Stimulus controllers
├── config/ # Configuration
├── db/ # Database migrations & seeds
├── docs/ # Documentation
├── spec/ # Tests
└── public/ # Static assets
We welcome contributions! Here's how to get started:
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Make your changes
- Write tests for new features
- Follow the code style guide
- Update documentation as needed
- Commit your changes
git commit -m 'Add amazing feature' - Push to your fork
git push origin feature/amazing-feature
- Open a Pull Request
See CONTRIBUTING.md for detailed guidelines.
Create a .env file in the root directory:
# Database
DATABASE_URL=postgresql://localhost/duka_development
# Rails
RAILS_ENV=development
SECRET_KEY_BASE=your_secret_key
# Admin
ADMIN_EMAIL=[email protected]
ADMIN_PASSWORD=change_me_in_production
# Payment (Optional - for production)
MPESA_CONSUMER_KEY=your_key
MPESA_CONSUMER_SECRET=your_secret
STRIPE_PUBLISHABLE_KEY=your_key
STRIPE_SECRET_KEY=your_secretThis project uses Kamal 2.0 for deployment:
# Setup deployment
kamal setup
# Deploy
kamal deploy
# Check status
kamal app logsSee deployment documentation for detailed instructions.
- Session-based cart (no login required)
- Real-time updates with Turbo Streams
- Optimistic UI for instant feedback
- Stock validation before checkout
- Add items to cart
- Enter shipping information
- Select payment method (M-Pesa, Card, Bank Transfer, COD)
- Confirm order
- Receive confirmation email
- Powered by Avo for beautiful UI
- Manage products, variants, and stock
- View and process orders
- User management with admin roles
- Dashboard with key metrics
ARC Duka supports the African Ruby Community, promoting open source and software craftsmanship in East Africa since 2010. Revenue from this shop helps fund:
- Monthly meetups and workshops
- Community swag and merchandise
- Conference sponsorships
- Educational initiatives
Distributed under the MIT License. See LICENSE for details.
- African Ruby Community members
- All contributors to this project
- Open source libraries and tools used
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Community: Nairuby Meetup
- Email: [email protected]
Made with ❤️ by the African Ruby Community