An e-commerce platform for selling books and managing orders with integrated payment processing.
- Features
- Tech Stack
- Requirements
- Installation
- Configuration
- Development
- Testing
- Deployment
- Project Structure
- Product Catalog: Browse and search books with detailed information
- Shopping Cart: Add, update, and remove items from cart
- User Authentication: Secure registration and login with email verification
- Order Management: Create and track orders
- Address Management: Save and manage shipping addresses with postal code validation
- Multi-language Support: Internationalization (i18n) ready
- Payment Integration: Stripe payment processing
- Dashboard: Overview of store statistics
- Product Management: CRUD operations for books and products
- Order Management: View and manage customer orders
- Label Price Management: Configure pricing for product labels by weight ranges
- File Uploads: Product cover images with Active Storage
- Framework: Ruby on Rails 8.1.1
- Ruby Version: 3.4.8
- Database: PostgreSQL with multiple databases:
- Primary (application data)
- Cache (Solid Cache)
- Queue (Solid Queue for background jobs)
- Cable (Solid Cable for WebSockets)
- Frontend:
- Hotwire (Turbo & Stimulus)
- TailwindCSS
- Importmap for JavaScript
- Background Jobs: Solid Queue with Mission Control
- Payment Processing: Stripe
- File Storage: Active Storage (AWS S3 compatible)
- Error Tracking: Sentry
- Testing: Minitest with FactoryBot, Capybara, and Selenium
- Code Quality: RuboCop, Brakeman, SimpleCov
- Ruby 3.4.8
- PostgreSQL (version 9.3+)
- Node.js (for asset compilation)
- Redis (optional, for caching)
- Libvips (for image processing)
-
Clone the repository
git clone <repository-url> cd ilv-store
-
Install dependencies
bundle install
-
Set up environment variables
Create a
.envfile in the project root with the following variables:cp .env.example .env
-
Create and setup databases
bin/rails db:create db:migrate db:seed
The application uses PostgreSQL with four separate databases:
ilv_store_development- Primary application databaseilv_store_development_cache- Cache storageilv_store_development_queue- Background job queueilv_store_development_cable- WebSocket connections
All databases are automatically created with db:create.
For local development, use Stripe CLI to forward webhooks:
stripe listen --forward-to localhost:3000/webhooks/stripeStart the development server with Foreman (runs Rails server and TailwindCSS watcher):
bin/devOr run services individually:
# Rails server
bin/rails server
# TailwindCSS watcher
bin/rails tailwindcss:watch
# Background job processor
bin/jobs startThe application will be available at http://localhost:3000
Monitor background jobs with Mission Control:
http://localhost:3000/jobs
Access the backoffice at /backoffice/dashboard (requires admin authentication).
bin/rails test:allbin/rails testbin/rails test:system# RuboCop (linting)
bundle exec rubocop
# Brakeman (security scanning)
bundle exec brakeman
# Database consistency checks
bundle exec database_consistency
# ERB linting
bundle exec erblint --lint-allThe application is configured for deployment with Kamal:
# Setup
kamal setup
# Deploy
kamal deploy
# Other commands
kamal app logs
kamal app exec 'bin/rails console'