Skip to content

Latest commit

Β 

History

History
140 lines (101 loc) Β· 3.61 KB

File metadata and controls

140 lines (101 loc) Β· 3.61 KB

CediPower πŸ‡¬πŸ‡­

CediPower is a Rails application that helps users track and compare prices of goods across various markets and stores in Ghana. The platform provides real-time price information, historical trends, and market comparisons to help consumers make informed purchasing decisions.

Features 🌟

  • Price Tracking: Monitor prices of various items across different markets
  • Market Directory: Browse through various markets and stores in Ghana
  • Category Navigation: Browse items by categories
  • Price History: View historical price trends with charts
  • User Roles:
    • Admin: Manage all aspects of the platform
    • Store Owner: Manage market prices and information
    • General User: Track prices and save favorite items
  • PWA Support: Progressive Web App capabilities for mobile users
  • SEO Optimized: Built-in SEO features with meta tags and sitemap generation

Technology Stack πŸ’»

  • Backend: Ruby 3.3.6, Rails 8.0.0
  • Database: PostgreSQL
  • Frontend: Tailwind CSS, Hotwire (Turbo & Stimulus)
  • Authentication: Devise
  • Authorization: Pundit
  • Charts: Chartkick & Groupdate
  • SEO: FriendlyId, meta-tags, sitemap_generator
  • Testing: Minitest, Capybara
  • Deployment: Docker, Kamal

Prerequisites πŸ“‹

Before you begin, ensure you have installed:

  • Ruby 3.3.6
  • PostgreSQL
  • Node.js & Yarn
  • Docker (for production deployment)

Development Setup πŸ› οΈ

  1. Clone the repository:
git clone https://github.com/smorttey/cedi_power.git
cd cedi_power
  1. Install dependencies:
bundle install
  1. Setup database:
bin/rails db:prepare
  1. Start the development server:
bin/dev

Visit http://localhost:3000 to see the application.

Testing πŸ§ͺ

Run the test suite:

bin/rails test                  # Run all tests
bin/rails test:system          # Run system tests
bin/rails test:controllers     # Run controller tests

Code Quality πŸ”

Run the linters:

bin/rubocop                    # Ruby code style checker
bin/brakeman                   # Security vulnerability scanner

Deployment πŸš€

Deploy using Kamal:

bin/kamal setup                # First-time setup
bin/kamal deploy               # Regular deployments

Environment Variables πŸ”

Required environment variables:

RAILS_MASTER_KEY=<your-master-key>
DATABASE_URL=postgresql://localhost/cedi_power_development
RAILS_ENV=development

Project Structure πŸ“

app/
β”œβ”€β”€ controllers/              # Application controllers
β”‚   β”œβ”€β”€ admin/               # Admin namespace
β”‚   └── store_owner/         # Store owner namespace
β”œβ”€β”€ models/                  # ActiveRecord models
β”œβ”€β”€ policies/               # Pundit authorization policies
β”œβ”€β”€ views/                  # View templates
└── javascript/            # JavaScript files
config/
β”œβ”€β”€ routes.rb              # Application routes
└── database.yml          # Database configuration

Troubleshooting πŸ”§

Common issues:

  • Database Connection: Ensure PostgreSQL is running
  • Asset Compilation: Run bin/rails assets:precompile
  • Test Database: Run bin/rails db:test:prepare

License πŸ“„

This project is proprietary software

Acknowledgments πŸ™


Made with ❀️ in Ghana πŸ‡¬πŸ‡­