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 (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: Stripe, Paystack integration points [Tentative]
- Deployment: Kamal 2.0
- Ruby 4.0.0+
- Rails 8.1+
- PostgreSQL 14+
- Node.js 18+
- Yarn or pnpm
-
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:
admin@duka.com/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.
I'd add this immediately after the Rails Credentials section (or as a new subsection within it), since it's part of the payment gateway setup.
When testing payments locally, Quikk must be able to reach your application's callback endpoint. Since localhost is not publicly accessible, expose your local Rails server using a tunnel such as Cloudflare Tunnel.
For example:
cloudflared tunnel --url http://localhost:3000This will provide a public URL similar to:
https://wallpaper-plus-get-glass.trycloudflare.com
Configure the following callback URL in your Quikk Sandbox dashboard:
https://wallpaper-plus-get-glass.trycloudflare.com/payments/callback
The callback endpoint used by this application is:
/payments/callback
Note: Every time you start a new temporary Cloudflare Tunnel, the generated URL changes. Update the callback URL in the Quikk Sandbox dashboard accordingly, unless you are using a permanent tunnel or custom domain.
Quikk uses separate API credentials for Sandbox and Production.
When setting up the project for development:
- Create a new Sandbox application in Quikk.
- Generate fresh Sandbox API keys.
- Add them to your development Rails credentials.
quikk:
api_key: your_sandbox_api_key
api_secret: your_sandbox_api_secret
shortcode: "174379"Important: Quikk Sandbox API keys expire relatively quickly. If authentication suddenly begins failing, generate a new set of Sandbox API keys and update your Rails credentials.
For production deployments, use a separate set of Production API keys in config/credentials/production.yml.enc.
This project uses Rails encrypted credentials for sensitive configuration (including Quikk API keys), not plain .env secrets.
EDITOR="code --wait" rails credentials:edit --environment development- Keep
config/master.keyprivate and never commit it. config/credentials/*.yml.encfiles are safe to commit.- Non-sensitive local settings (if any) can still go in
.env.
This 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 (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: African Ruby Community
- Email: organisers@rubyconf.africa
Made with ❤️ by the African Ruby Community