Skip to content

syntaxmage05/myshop

Repository files navigation

MYSHOP

Empowering Seamless Commerce Through Innovation and Trust

last-commit repo-top-language repo-language-count

Built with the tools and technologies:

JSON Markdown npm Autoprefixer Ruby PostCSS JavaScript
Nodemon Yarn Docker GitHub%20Actions Bootstrap Sass


Table of Contents


Overview


Features

Component Details
⚙️ Architecture
  • Ruby on Rails MVC framework
  • RESTful API endpoints
  • Separation of concerns with views, controllers, models
🔩 Code Quality
  • Consistent Ruby style, adheres to Rails conventions
  • Uses Rake tasks for automation
  • Includes code comments and ERB templates for views
📄 Documentation
  • Dockerfile for containerization
  • CI/CD workflows via GitHub Actions
  • README likely includes setup and deployment instructions
🔌 Integrations
  • Docker for containerization
  • GitHub Actions for CI/CD
  • Yarn and npm for JavaScript package management
  • Devise gem for authentication
  • MPESA payment HTML templates for mobile payments
🧩 Modularity
  • Uses Rails partials (_footer.html.erb, _navbar.html.erb)
  • Separation of assets (CSS, JS, images)
  • Configurable via YAML files (database.yml, cache.yml, etc.)
🧪 Testing
  • Likely uses RSpec or Minitest (not explicitly shown but common in Rails)
  • CI workflows suggest automated tests run on push
⚡️ Performance
  • Containerized with Docker for consistent environments
  • Asset pipeline with PostCSS, Autoprefixer, Sass for optimized CSS
  • Potential caching strategies via cache.yml
🛡️ Security
  • Encrypted credentials (credentials.yml.enc)
  • Secure session management via Devise
  • Dependabot for dependency security updates
📦 Dependencies
  • Ruby gems managed via Gemfile and Gemfile.lock
  • JavaScript dependencies via package.json and yarn.lock
  • Dockerfile for environment consistency

Project Structure

└── myshop/
    ├── .github
    │   ├── dependabot.yml
    │   └── workflows
    ├── Dockerfile
    ├── Gemfile
    ├── Gemfile.lock
    ├── Procfile.dev
    ├── README.md
    ├── Rakefile
    ├── app
    │   ├── admin
    │   ├── assets
    │   ├── controllers
    │   ├── helpers
    │   ├── javascript
    │   ├── jobs
    │   ├── mailers
    │   ├── models
    │   ├── services
    │   └── views
    ├── config
    │   ├── application.rb
    │   ├── boot.rb
    │   ├── cable.yml
    │   ├── cache.yml
    │   ├── credentials.yml.enc
    │   ├── database.yml
    │   ├── deploy.yml
    │   ├── environment.rb
    │   ├── environments
    │   ├── importmap.rb
    │   ├── initializers
    │   ├── locales
    │   ├── puma.rb
    │   ├── queue.yml
    │   ├── recurring.yml
    │   ├── routes.rb
    │   └── storage.yml
    ├── config.ru
    ├── db
    │   ├── cable_schema.rb
    │   ├── cache_schema.rb
    │   ├── migrate
    │   ├── queue_schema.rb
    │   ├── schema.rb
    │   └── seeds.rb
    ├── lib
    │   └── tasks
    ├── log
    │   └── .keep
    ├── package.json
    ├── script
    │   └── .keep
    ├── spec
    │   ├── helpers
    │   ├── mailers
    │   ├── models
    │   ├── rails_helper.rb
    │   ├── requests
    │   ├── spec_helper.rb
    │   └── views
    ├── storage
    │   └── .keep
    └── yarn.lock

Project Index

MYSHOP/
__root__
⦿ __root__
File Name Summary
Gemfile - Defines project dependencies and libraries essential for building a robust, scalable Rails application
- Manages core frameworks, database adapters, frontend tools, and development utilities, ensuring seamless integration and performance
- Supports features like API development, asset management, user authentication, and background processing, forming the foundational layer that enables the entire applications functionality and maintainability.
Dockerfile - Defines the production environment setup for deploying the Rails-based open_shop application within Docker
- It orchestrates the installation of dependencies, gem and asset precompilation, and prepares a secure, optimized container image for running the web server
- This ensures consistent, efficient deployment aligned with the overall architecture, supporting scalable and reliable operation of the e-commerce platform.
Procfile.dev - Defines the development environment startup process by orchestrating the Rails server with debugging enabled and CSS asset watching
- It ensures a streamlined local development experience, allowing developers to run the backend and frontend asset compilation concurrently, facilitating efficient testing and debugging within the overall application architecture.
README.md - Provides essential guidance for setting up and deploying the application within the broader system architecture
- It outlines necessary steps for environment configuration, database initialization, and service integration, ensuring smooth onboarding and consistent operation across development, testing, and production environments
- This documentation facilitates understanding of deployment workflows and system dependencies critical to the project’s infrastructure.
Rakefile - Defines and loads custom Rake tasks for automating project-specific workflows within the Rails application
- It centralizes task registration, enabling streamlined execution of maintenance, deployment, and development commands, thereby enhancing overall project manageability and operational efficiency.
package.json - Defines project dependencies and scripts for styling workflows, enabling efficient compilation, autoprefixing, and watching of CSS assets
- Facilitates seamless integration of Bootstrap and related styles, ensuring consistent, optimized styling across the application
- Serves as the central configuration for managing CSS build processes within the overall architecture.
config.ru - Bootstraps the Rails application within a Rack server environment, enabling seamless startup and request handling
- It orchestrates the initialization process by loading the application environment and configuring server execution, ensuring the web service is ready to process incoming traffic efficiently within the overall architecture.
db
⦿ db
File Name Summary
queue_schema.rb - Defines the database schema for managing job queues, including tables for tracking active, scheduled, failed, and recurring jobs, as well as execution states and process management
- Facilitates reliable, organized, and scalable job scheduling and execution within the overall system architecture, ensuring efficient handling of background tasks and concurrency control.
schema.rb - Defines the database schema for an e-commerce platform, outlining core entities such as products, categories, orders, users, and payment transactions
- Facilitates data organization and relationships essential for managing product catalog, user accounts, shopping carts, order processing, and payment tracking within the applications architecture
- Ensures consistency and integrity across the systems data layer.
cache_schema.rb - Defines the schema for the solid cache storage, establishing the structure for caching entries within the database
- It facilitates efficient retrieval and management of cached data by specifying key attributes, data types, and indexes, thereby supporting the overall caching architecture and performance optimization of the application.
seeds.rb - Seeds the database with initial data by creating a default admin user, multiple categories, and a large set of products with randomized attributes and images
- Facilitates development and testing by providing a realistic dataset that reflects the applications core entities and their relationships within the overall architecture.
cable_schema.rb - Defines the database schema for storing real-time communication messages within the cable system
- It structures message data, including channel identifiers and payloads, enabling efficient message persistence and retrieval
- This schema supports the overall architecture by facilitating reliable message handling and ensuring data integrity across communication channels.
migrate
⦿ db.migrate
File Name Summary
20260222174804_create_carts.rb - Defines the database schema for shopping carts, establishing a dedicated table to store cart-related data
- Serves as a foundational component within the applications data architecture, enabling the creation, management, and persistence of user shopping cart instances to support e-commerce functionalities
- Ensures a structured and scalable approach to handling cart information across the platform.
20260222125041_add_slug_to_products.rb - Enhances product data management by adding a unique slug identifier to the products table, facilitating SEO-friendly URLs and improved product referencing within the application
- This migration supports the overall architecture by ensuring each product has a distinct, human-readable identifier, streamlining product retrieval and maintaining data integrity across the system.
20260227121651_create_orders.rb - Defines the database schema for storing customer order information within the application
- It establishes the structure for capturing essential order details such as customer names, contact information, shipping address, and payment status, supporting the overall e-commerce workflow and ensuring data integrity for order processing and management.
20260221203730_create_categories.rb - Defines the database schema for categories, enabling structured classification within the application
- Facilitates the organization and management of categorized data, supporting features that rely on categorization
- Integrates into the overall database architecture to ensure consistent and scalable handling of category-related information across the system.
20260304173101_create_mpesa_transactions.rb - Defines the database schema for storing Mpesa transaction records, linking each transaction to an associated order
- Facilitates tracking and management of mobile money payments, including transaction identifiers, amounts, statuses, and results
- Integrates seamlessly into the overall architecture to support reliable payment processing and reconciliation workflows.
20260307103552_add_product_count_to_category.rb - Enhances the database schema by adding a product count attribute to categories, enabling efficient tracking of the number of products associated with each category
- This migration supports optimized queries and data integrity within the overall e-commerce platform architecture, facilitating faster access to category-related product metrics and improving performance for category management features.
20260227121822_create_order_items.rb - Defines the database schema for order items, establishing relationships with orders and products
- Facilitates tracking of individual product details within customer orders, including pricing and quantity
- Supports the overall e-commerce architecture by enabling detailed order composition and ensuring data integrity across transactional records.
20260304173648_add_paid_at_to_orders.rb - Adds a paid_at timestamp to orders, enabling tracking of payment completion times
- This migration enhances the order management system by recording when payments are finalized, supporting accurate order status updates and historical data analysis within the overall architecture
- It ensures the database schema aligns with the applications need for precise payment tracking.
20260222165531_create_friendly_id_slugs.rb - Defines the database schema for storing friendly URL slugs, enabling human-readable and SEO-friendly URLs across various models
- It ensures efficient management and retrieval of slugs by establishing indexes and constraints, supporting consistent URL generation and lookup within the applications routing architecture
- This migration is integral to maintaining clean, user-friendly links throughout the system.
20260221203847_create_products.rb - Defines the database schema for products, establishing the structure for storing product details such as name, description, price, availability, and associated category
- Serves as a foundational component for managing product data within the applications architecture, enabling efficient data organization, retrieval, and integrity across the e-commerce platform.
20260222125025_add_slug_to_categories.rb - Enhances the categories data model by adding a unique slug attribute, facilitating SEO-friendly URLs and improved category identification within the application
- This migration supports the overall architecture by enabling more efficient and user-friendly navigation, ensuring categories are uniquely identifiable and easily accessible across the platform.
20260222192009_add_quantity_to_line_items.rb - Enhances the database schema by adding a quantity attribute to line items, enabling precise tracking of item quantities within orders
- This migration supports improved inventory management and order processing workflows, integrating seamlessly into the overall architecture to facilitate scalable and accurate e-commerce operations.
20260304180326_add_phone_to_orders.rb - Adds a phone number field to the orders table, enabling the system to capture and store customer contact information during the order process
- This migration enhances the data models completeness, supporting improved communication and order management within the overall application architecture.
20260221204948_create_active_storage_tables.active_storage.rb - Defines database schema for managing file uploads and media assets within the application
- Establishes tables for storing file metadata, attachments linked to various records, and image variations, enabling efficient handling, retrieval, and versioning of media content across the system
- Integrates seamlessly with Active Storage to support scalable, flexible media management.
20260221202220_create_active_admin_comments.rb - Defines the database schema for storing administrative comments within the application, enabling users and administrators to add, manage, and track contextual notes related to various resources
- This migration supports the overall architecture by facilitating comment association with diverse resource types, enhancing collaboration, auditability, and user engagement across the platform.
20260221202217_devise_create_users.rb - Defines the database schema for user accounts, establishing essential authentication fields such as email, encrypted password, and password recovery tokens
- Integrates core Devise modules to support secure user login, password management, and account recovery functionalities, forming the foundation for user identity management within the applications architecture.
20260222184830_create_line_items.rb - Defines the database schema for line items, establishing relationships between products and shopping carts
- Facilitates tracking individual product selections within user carts, supporting core e-commerce functionalities such as order composition and inventory management within the overall application architecture.
.github
⦿ .github
File Name Summary
dependabot.yml - Automates dependency management and security updates across the project by configuring Dependabot to monitor and automatically propose updates for Ruby gems and GitHub Actions
- Ensures the codebase remains current and secure through daily scheduled checks, maintaining compatibility and reducing manual update efforts within the overall architecture.
workflows
⦿ .github.workflows
File Name Summary
ci.yml - Defines the continuous integration workflow for the project, automating code quality and security checks on pull requests and main branch updates
- It orchestrates static analysis for Rails security vulnerabilities, JavaScript dependency audits, and style linting, ensuring consistent, secure, and maintainable code across the entire codebase architecture.
script
⦿ script
File Name Summary
.keep - Maintains the directory structure by ensuring the presence of a placeholder file, facilitating version control and repository organization
- Supports consistent project setup and prevents accidental deletion of essential directories, thereby maintaining the integrity of the overall codebase architecture.
log
⦿ log
File Name Summary
.keep - Maintains the directory structure by ensuring the log directory exists, facilitating organized storage of log files
- Supports the overall architecture by providing a designated location for logging data, which aids in debugging, monitoring, and maintaining the applications health across different environments
- Ensures the logging system functions reliably within the broader project framework.
spec
⦿ spec
File Name Summary
spec_helper.rb - Configure testing environment for a Rails application using RSpec
- It establishes expectations, mocking behaviors, and shared context handling to ensure consistent, reliable, and efficient test execution across the codebase
- This setup promotes best practices in testing, enabling developers to write clear, maintainable, and high-quality tests aligned with the overall architecture.
rails_helper.rb - Sets up the testing environment for the Rails application by configuring RSpec, ensuring database schema consistency, and loading necessary support files
- It facilitates reliable, isolated, and efficient testing of the codebase, supporting development and maintenance of robust features within the overall architecture.
helpers
⦿ spec.helpers
File Name Summary
line_items_helper_spec.rb - Provides testing scaffolding for the LineItemsHelper module, ensuring helper methods related to line items function correctly within the Rails application
- Supports the overall architecture by validating helper logic that facilitates accurate presentation and manipulation of line item data, contributing to reliable user interface behavior and data consistency across the project.
orders_helper_spec.rb - Provides testing scaffolding for the OrdersHelper module, ensuring helper methods related to order processing are correctly implemented
- Serves as a foundation for validating the functionality of utility functions that support order management within the applications architecture
- Facilitates maintainability and reliability of order-related features by enabling future test development.
carts_helper_spec.rb - Provides testing scaffolding for the CartsHelper module, ensuring helper methods related to shopping cart functionalities are correctly implemented
- Serves as a foundation for validating helper logic within the broader Rails application, supporting reliable user interactions and data handling in the e-commerce architecture
- Facilitates maintainability and correctness of cart-related features across the codebase.
categories_helper_spec.rb - Provides testing scaffolding for the CategoriesHelper module, ensuring helper methods related to category functionalities are verified within the Rails application
- Serves as a foundation for validating helper logic that supports category-related features, contributing to the overall robustness and correctness of the applications category management components.
mpesa_helper_spec.rb - Provides testing scaffolding for the MpesaHelper module, ensuring the helper functions related to Mpesa integrations are verified within the Rails application
- Serves as a foundation for validating utility methods that facilitate communication with Mpesa services, supporting the overall architecture by maintaining reliable and maintainable helper logic essential for payment processing workflows.
products_helper_spec.rb - Provides testing scaffolding for the ProductsHelper module, ensuring helper methods related to product functionalities are verified within the Rails application
- Serves as a foundation for validating helper logic, contributing to the overall robustness and correctness of product-related features in the codebase
- Facilitates maintainability and confidence in helper method implementations.
homepage_helper_spec.rb - Provides testing scaffolding for the HomepageHelper module within the Rails application
- It ensures helper methods related to the homepage are properly validated, supporting the overall architecture by maintaining code quality and facilitating future feature development
- This file integrates into the testing suite, contributing to reliable and maintainable frontend helper functionalities.
models
⦿ spec.models
File Name Summary
line_item_spec.rb - Defines the test suite for the LineItem model within the applications domain, ensuring the integrity and expected behavior of line item data handling
- Serves as a foundation for validating business logic related to individual line items, supporting overall system reliability and correctness in the context of the larger Rails-based architecture.
cart_spec.rb - Defines the test structure for the Cart model, serving as a foundation for validating core functionalities within the applications domain
- Ensures that the Carts behavior aligns with expected business logic, supporting reliable feature development and maintenance in the overall system architecture
- Acts as a placeholder for future test cases to uphold code quality standards.
mpesa_transaction_spec.rb - Defines the testing framework for the MpesaTransaction model, ensuring validation of its behavior within the application
- Serves as a foundational component for maintaining data integrity and correctness of transaction processing related to mobile money operations
- Integrates with the overall Rails architecture to support reliable financial interactions and future feature development.
product_spec.rb - Defines the test structure for the Product model, serving as a foundation for validating product-related data and behaviors within the application
- Ensures that future test cases can be added to verify the integrity and correctness of product functionalities, contributing to the overall robustness and maintainability of the codebase.
user_spec.rb - Defines the test structure for the User model, serving as a foundation for validating user-related data and behaviors within the application
- Ensures that user data adheres to expected standards, supporting overall data integrity and facilitating future test case development aligned with the applications architecture.
order_spec.rb - Defines the testing framework for the Order model, serving as a foundation for validating business logic and data integrity within the applications domain
- Ensures that the Order-related functionalities adhere to expected behaviors, supporting reliable and maintainable code as part of the overall system architecture
- Facilitates future test development to improve code quality and robustness.
category_spec.rb - Defines the test structure for the Category model, serving as a foundation for validating its behavior within the application
- It ensures that the models functionality aligns with expected standards, supporting the overall integrity and reliability of the codebase
- This test file is essential for maintaining quality and facilitating future feature development related to categories.
order_item_spec.rb - Defines the test structure for the OrderItem model within the applications domain, ensuring validation of its behavior and interactions
- Serves as a foundational component for maintaining data integrity and supporting business logic related to individual items within customer orders, contributing to the overall robustness of the order management system.
mailers
⦿ spec.mailers
File Name Summary
order_mailer_spec.rb - Defines the test suite for verifying email notifications related to orders within the application
- It ensures that the OrderMailer functions correctly by validating email delivery and content, contributing to the overall communication reliability of the system
- This spec file supports maintaining high-quality user interactions and seamless order-related messaging across the platform.
previews
⦿ spec.mailers.previews
File Name Summary
order_mailer_preview.rb - Provides a preview for the order confirmation email within the applications email testing environment, enabling developers to visualize and verify the email layout and content before deployment
- It supports quality assurance by simulating real order data, ensuring the email communication aligns with user expectations and maintains consistency across the platform.
requests
⦿ spec.requests
File Name Summary
carts_spec.rb - Defines request specifications for the carts endpoint, serving as a foundation for testing cart-related API interactions within the application
- Ensures the cart functionalities are verifiable and integrated into the overall system architecture, supporting reliable user experience and facilitating future test development
- Acts as a placeholder for expanding test coverage of cart operations in the project.
homepage_spec.rb - Validates the accessibility and proper functioning of the homepage endpoint within the web application
- Ensures that the root URL responds successfully, confirming the homepage loads correctly and is reachable, which is essential for maintaining a positive user experience and verifying core application routing
- This test supports overall system reliability by detecting potential routing or server issues early.
categories_spec.rb - Defines request specifications for the categories endpoint within the applications API layer, serving as a foundation for testing category-related functionalities
- Integrates with the broader test suite to ensure API consistency and reliability, supporting the overall architectures goal of maintaining robust, well-documented endpoints for client interactions.
line_items_spec.rb - Defines request specifications for the line items API endpoints, serving as a foundation for testing the integration and behavior of line item interactions within the application
- Supports ensuring API reliability and correctness, contributing to the overall robustness of the system’s request handling and data management processes.
products_spec.rb - Defines request specifications for the products endpoint within the test suite, serving as a foundation for validating API behavior related to product data retrieval
- Integrates with the broader testing framework to ensure the applications product-related functionalities operate correctly, supporting ongoing quality assurance and future feature development.
mpesa_spec.rb - Defines a request spec for the Mpesas feature within the Rails application, serving as a placeholder for testing the MPesa-related API endpoints
- It ensures the request handling aligns with expected behaviors, contributing to the overall robustness and reliability of the payment integration architecture
- The file supports future development and validation of MPesa transaction workflows.
orders_spec.rb - Defines request specifications for the Orders endpoint, serving as a foundation for testing the APIs order-related functionalities within the Rails application
- It ensures that order retrieval operations are validated, contributing to the overall robustness and reliability of the applications request handling and API architecture.
views
⦿ spec.views
homepage
⦿ spec.views.homepage
File Name Summary
index.html.erb_spec.rb - Defines a test scaffold for the homepage view, ensuring the visual rendering aligns with expected design and content standards
- Serves as a foundation for verifying user interface consistency within the overall application architecture, facilitating future test development to maintain quality and prevent regressions in the homepage presentation.
storage
⦿ storage
File Name Summary
.keep - Maintains the storage directory structure by ensuring the presence of a placeholder file, facilitating version control and directory tracking within the project
- Supports the overall architecture by preventing accidental deletion of essential storage folders, thereby ensuring consistent data organization and integrity across the codebase.
config
⦿ config
File Name Summary
storage.yml - Defines storage configurations for different environments and cloud providers, enabling flexible management of file storage options within the application
- Facilitates seamless switching between local, test, and cloud services like AWS S3, Google Cloud Storage, and Azure Storage, supporting scalable and secure file handling aligned with the overall architecture.
recurring.yml - Defines scheduled maintenance tasks for the applications background processes, ensuring timely cleanup and management of soft-deleted records and completed jobs
- These configurations automate routine operations, optimize system performance, and maintain data integrity by executing specific commands and jobs at designated intervals within the production environment.
database.yml - Defines database connection configurations for different environments within the application architecture
- Facilitates seamless integration with PostgreSQL, supporting development, testing, and production setups
- Ensures secure, environment-specific database access, enabling efficient data management and migration workflows across various deployment stages.
routes.rb - Defines the applications routing structure, mapping URL endpoints to corresponding controllers and actions
- Facilitates navigation and interaction within the e-commerce platform, including product browsing, cart management, order processing, and payment integration via M-Pesa
- Ensures seamless user flow and communication between frontend requests and backend functionalities across development and production environments.
puma.rb - Configures Puma server to efficiently handle web requests by setting thread pools, port, and process management parameters
- It optimizes application throughput and latency, supports seamless restarts, and integrates with deployment environments
- Additionally, it enables optional features like Solid Queue supervision for single-server deployments, ensuring scalable and reliable request processing within the overall architecture.
cache.yml - Defines cache storage configurations across different environments, establishing parameters such as maximum size and namespace
- Ensures efficient caching behavior aligned with environment-specific needs, supporting optimal performance and data retention policies within the overall application architecture
- Facilitates consistent cache management to improve response times and resource utilization across development, testing, and production stages.
environment.rb - Sets up the environment by loading and initializing the Rails application, establishing the foundational configuration necessary for the entire codebase to operate correctly
- It ensures that all components and dependencies are properly loaded, enabling the application to run smoothly across different environments and supporting the overall architectures stability and consistency.
importmap.rb - Defines and manages JavaScript dependencies for the application by pinning essential npm packages and controllers, ensuring streamlined asset loading and integration
- Facilitates efficient client-side behavior, including Turbo, Stimulus, and Bootstrap functionalities, contributing to a cohesive and responsive user interface within the overall project architecture.
cable.yml - Defines the configuration for Action Cable, enabling real-time WebSocket communication across different environments
- It specifies the appropriate adapter for each environment—async for development, test for testing, and solid_cable for production—ensuring reliable message delivery, connection handling, and performance tuning aligned with the overall applications architecture.
deploy.yml - Defines deployment configurations for the open_shop application, orchestrating containerized environments across servers, managing SSL, registry credentials, environment variables, and storage volumes
- Facilitates streamlined, secure, and scalable deployment processes, ensuring consistent application operation and integration within the broader architecture
- Supports flexible infrastructure setup, including auxiliary services and asset management, to maintain robust application performance.
application.rb - Defines the core application configuration for the Rails-based OpenShop project, establishing framework components, autoload paths, and asset pipeline settings
- It orchestrates the initialization process, ensuring the application loads necessary modules and dependencies correctly, thereby supporting a modular, scalable, and maintainable architecture aligned with Rails conventions.
queue.yml - Defines the configuration for background job processing, specifying dispatcher behavior and worker concurrency across different environments
- It orchestrates how queued tasks are dispatched and executed, ensuring scalable and efficient handling of asynchronous workloads within the overall system architecture
- This setup optimizes resource utilization and maintains consistent job processing performance across development, testing, and production environments.
credentials.yml.enc - Manages encrypted credential data essential for secure application configuration, enabling safe storage and retrieval of sensitive information within the project architecture
- Facilitates seamless access to credentials across different environments, supporting the overall security and operational integrity of the system
- Ensures that sensitive data remains protected while remaining accessible for authorized components.
boot.rb - Sets up the environment by configuring gem dependencies and optimizing application startup time
- It ensures that all necessary libraries are loaded efficiently, contributing to faster boot times and a smoother initialization process within the overall application architecture
- This foundational configuration supports reliable and performant deployment of the project.
environments
⦿ config.environments
File Name Summary
production.rb - Defines production environment configurations to optimize application performance, security, and reliability
- Sets caching strategies, logging, SSL enforcement, and asset management, ensuring the application operates securely and efficiently under high load
- Integrates with background job processing and storage services, supporting scalable deployment and robust request handling within the overall architecture.
development.rb - Configures the development environment to optimize debugging, caching, and live reloading, ensuring a smooth development workflow
- It integrates tools like Bullet for performance alerts, manages host access including ngrok, and sets up local storage, email handling, and error reporting
- Overall, it supports rapid iteration and effective troubleshooting within the applications architecture.
test.rb - Defines the configuration settings for the applications test environment, ensuring isolated, reliable, and efficient test execution
- It optimizes testing workflows by disabling unnecessary features, enabling debugging tools like Bullet, and configuring services such as email and storage to operate in test mode
- This setup supports comprehensive testing while maintaining performance and safety during development cycles.
initializers
⦿ config.initializers
File Name Summary
inflections.rb - Defines custom inflection rules to ensure consistent and correct pluralization, singularization, and acronym handling across the application
- By configuring locale-specific inflections, it enhances the readability and maintainability of model and resource names, supporting seamless integration and accurate data representation within the overall architecture.
filter_parameter_logging.rb - Defines security measures for logging by filtering sensitive parameters such as passwords, tokens, and personal information from application logs
- This enhances data privacy and compliance within the overall architecture, ensuring that confidential user data remains protected during system operation and troubleshooting.
friendly_id.rb - Configures global settings for friendly URL generation and model lookups, ensuring consistent and conflict-free slugs across the application
- It manages reserved words, slug behavior, and optional enhancements like friendly finders and transliteration, thereby streamlining user-friendly URL handling and improving overall navigation and resource identification within the codebase.
assets.rb - Defines asset management configurations to optimize frontend resource loading and versioning within the Rails application
- It specifies asset versioning for cache invalidation, extends asset load paths to include external libraries like Bootstrap icons and scripts, and precompiles essential JavaScript files to ensure efficient delivery and integration of third-party frontend assets across the project.
active_admin.rb - Configures the ActiveAdmin interface for the Open Shop project, establishing core administrative functionalities such as site branding, user authentication, logout procedures, and resource management
- It streamlines admin user interactions, enforces security protocols, and customizes the admin panels appearance and behavior to align with the overall application architecture.
devise.rb - Configures user authentication and account management within the application, leveraging Devise to streamline security workflows such as registration, login, password recovery, and email confirmation
- It establishes default behaviors for session handling, email communication, and security protocols, ensuring a robust and flexible authentication architecture aligned with the overall system design.
content_security_policy.rb - Defines the applications Content Security Policy to enhance security by restricting resource sources and preventing cross-site scripting attacks
- It establishes guidelines for safe content loading, including scripts, styles, images, and fonts, while allowing for violation reporting
- This configuration plays a crucial role in safeguarding the web applications integrity within the overall architecture.
locales
⦿ config.locales
File Name Summary
devise.en.yml - Provides localized user-facing messages for authentication workflows within the application
- Facilitates clear communication during sign-in, registration, password recovery, account confirmation, and account unlocking processes
- Enhances user experience by delivering consistent, translated notifications aligned with the overall authentication architecture, ensuring users receive appropriate guidance and feedback throughout their interaction with the system.
en.yml - Defines English localization strings for the application, supporting internationalization by providing translatable content
- Integrates seamlessly into the Rails architecture, enabling dynamic language switching and consistent user interface messaging across different locales
- Serves as a foundational component for delivering a multilingual user experience within the overall project framework.
lib
⦿ lib
tasks
⦿ lib.tasks
File Name Summary
.keep - Maintains the directory structure by ensuring the existence of a placeholder file within the tasks folder
- Supports the overall project architecture by preventing directory removal during cleanup processes, thereby facilitating organized task management and future task additions within the codebase.
reset_category_counters.rake - Provides a maintenance task to reset product counters for all categories, ensuring accurate tracking of associated products within the applications data integrity processes
- Integrates into the broader system by maintaining consistency in category-related metrics, supporting reliable reporting and data management across the platforms architecture.
app
⦿ app
admin
⦿ app.admin
File Name Summary
users.rb - Defines the administrative interface for managing user accounts within the application
- Facilitates user data viewing, filtering, and editing capabilities, ensuring streamlined user management for administrators
- Integrates with the broader admin dashboard to support user-related operations, maintaining consistency and security across the platform’s user management workflows.
categories.rb - Defines administrative interface for managing categories within the application, enabling creation, editing, and viewing of category details
- Facilitates association of products with categories, displays related products, and provides quick navigation for product management
- Integrates custom resource lookup to handle friendly URLs, ensuring streamlined category management aligned with overall application architecture.
orders.rb - Defines the administrative interface for managing customer orders within the application
- Facilitates viewing, creating, and editing orders, including customer details and associated order items
- Integrates with the overall architecture to streamline order processing workflows and ensure data consistency across the e-commerce platform.
dashboard.rb - Defines the main administrative dashboard interface within the application, providing a centralized overview for admin users
- It facilitates quick access to key metrics and features, serving as the entry point for managing content and system insights
- The dashboards structure supports customization with panels and columns, aligning with the overall architecture of the admin interface.
products.rb - Defines the administrative interface for managing products within the application, enabling users to create, view, and edit product details efficiently
- Integrates custom resource finding logic, filtering options, and image handling to streamline product management workflows, ensuring a user-friendly experience aligned with the overall system architecture.
controllers
⦿ app.controllers
File Name Summary
carts_controller.rb - Manages user shopping cart interactions within the application, enabling retrieval and deletion of cart data stored in user sessions
- Facilitates seamless cart handling by ensuring proper access and error handling, thereby supporting the overall e-commerce flow
- Integrates with session management and error recovery mechanisms to maintain a consistent shopping experience across the platform.
homepage_controller.rb - Manages homepage product display by retrieving, filtering, and sorting products based on user-selected categories, search terms, and price ranges
- Ensures efficient data loading through eager loading and provides total product count for interface elements
- Integrates seamlessly into the overall architecture to deliver dynamic, responsive product listings for the applications main entry point.
mpesa_controller.rb - Handles M-Pesa payment callbacks and status inquiries by processing transaction updates, logging payment outcomes, and updating order statuses accordingly
- Ensures secure, reliable communication with M-Pesa, facilitating seamless payment verification and transaction management within the broader e-commerce architecture.
orders_controller.rb - Handles order processing by validating cart contents, creating orders with associated items, and initiating mobile money payments via M-Pesa
- Manages payment responses, records transaction details, and guides users through order confirmation or payment completion, integrating seamlessly into the overall e-commerce architecture to facilitate secure, efficient transactions.
products_controller.rb - Provides product listing and detail retrieval functionalities, enabling users to browse, filter, and sort products efficiently
- Implements eager loading to optimize database queries and supports related product suggestions
- Serves as a core component for the e-commerce applications product browsing experience, ensuring responsive and relevant data presentation aligned with user preferences.
application_controller.rb - Establishes foundational controller behavior by managing shopping cart state and loading product categories for navigation, ensuring consistent user experience across the application
- Facilitates seamless access to cart data and category information for derived controllers and views, supporting core e-commerce functionalities and enhancing site navigation within the overall architecture.
categories_controller.rb - Manages category-related data retrieval and presentation within the application
- Facilitates displaying detailed information about a specific category and its associated products, ensuring efficient data loading and ordering
- Integrates seamlessly into the overall architecture by supporting user navigation and interaction with categorized product listings, enhancing the browsing experience and maintaining organized access to product data.
line_items_controller.rb - Manages the addition of products to the shopping cart within the e-commerce architecture
- Facilitates creating and updating cart items, ensuring seamless user experience during product selection
- Integrates with session management to maintain cart state across user interactions, supporting the overall flow of the online shopping process.
concerns
⦿ app.controllers.concerns
File Name Summary
.keep - Provides a placeholder to ensure the controllers directory remains tracked in version control, facilitating the organization and future expansion of controller concerns within the application architecture
- This minimal file supports maintaining a clean project structure, enabling seamless integration of shared logic across controllers as the codebase evolves.
current_cart.rb - Manages user shopping cart state across sessions by retrieving or creating a cart as needed
- Ensures a persistent and seamless shopping experience within the application, integrating with the broader e-commerce architecture to maintain cart continuity and support order processing workflows.
javascript
⦿ app.javascript
File Name Summary
application.js - Sets up the client-side JavaScript environment by importing essential libraries and frameworks, enabling dynamic page updates, interactive UI components, and controller integrations within the Rails application
- It ensures seamless integration of Turbo, Stimulus controllers, and Bootstrap, facilitating a responsive and feature-rich user experience aligned with the overall architecture.
controllers
⦿ app.javascript.controllers
File Name Summary
application.js - Initialize and configure the Stimulus application to enable dynamic, client-side interactions within the web interface
- By setting up the core Stimulus framework, it facilitates organized, maintainable JavaScript controllers that enhance user experience across the application
- This foundational setup integrates Stimulus into the overall architecture, supporting scalable and responsive frontend behavior.
hello_controller.js - Provides a Stimulus controller that initializes interactive behavior within the applications frontend
- It dynamically updates the associated elements content to display a greeting, serving as a foundational example of integrating JavaScript-driven interactivity into the overall web architecture
- This controller exemplifies how frontend components can be modularly managed within the project's structure.
mpesa_payment_controller.js - Facilitates real-time monitoring and handling of M-Pesa payment transactions within the application
- It manages polling for payment status updates, updates the user interface based on transaction progress, and redirects upon successful completion
- Integrates seamlessly into the overall architecture to ensure a smooth, responsive payment experience for users.
index.js - Registers and initializes Stimulus controllers within the application, enabling modular and organized management of frontend interactions
- Specifically, it loads all controllers from the designated directory and registers the Mpesa payment controller, facilitating seamless integration of mobile payment functionalities into the overall architecture
- This setup promotes scalable and maintainable frontend behavior across the project.
helpers
⦿ app.helpers
File Name Summary
homepage_helper.rb - Provides a placeholder module for homepage-related helper methods, serving as a foundation for organizing view logic specific to the homepage within the applications overall architecture
- It facilitates clean separation of concerns by enabling the addition of reusable helper functions that support the presentation layer of the homepage feature.
products_helper.rb - Provides a placeholder for helper methods related to product functionalities within the application
- Integrates into the overall architecture by supporting view logic and presentation layer enhancements for product-related features, ensuring clean separation of concerns and maintainability in the codebase
- Serves as a foundation for future extensions of product-specific helper methods.
carts_helper.rb - Provides a placeholder module for cart-related helper methods within the applications helper layer, supporting the overall architecture by facilitating the organization and potential extension of utility functions that assist in managing cart functionalities across the project
- Ensures a structured approach to enhancing user shopping experiences while maintaining code modularity.
categories_helper.rb - Provides a placeholder for category-related helper methods within the applications view layer, supporting the organization and presentation of category data
- Integrates into the overall architecture by enabling reusable, view-specific logic for categories, thereby enhancing maintainability and consistency across the user interface.
mpesa_helper.rb - Provides a placeholder for MPESA-related helper methods within the application, facilitating integration with MPESA services
- It serves as a foundational component for managing MPESA interactions, supporting the broader architecture by enabling streamlined access to MPESA functionalities across the codebase
- This module ensures organized and maintainable code for payment processing features involving MPESA.
application_helper.rb - Provides a foundational module for view-related helper methods within the application, serving as a central location for shared presentation logic
- It supports consistent UI rendering across the project by enabling the addition of reusable helper functions, thereby enhancing maintainability and reducing redundancy in the overall architecture.
orders_helper.rb - Provides a placeholder for helper methods related to order processing within the applications view layer, facilitating the organization and reuse of presentation logic associated with orders
- Integrates into the broader architecture by supporting the separation of concerns, ensuring that view-related functionalities are encapsulated and easily maintainable across the project.
line_items_helper.rb - Provides a placeholder for helper methods related to line items within the application, facilitating the organization and potential extension of functionality associated with line item operations
- Integrates into the overall architecture by supporting view logic and ensuring clean separation of concerns in managing line item data presentation and manipulation.
models
⦿ app.models
File Name Summary
product.rb - Defines the Product model within the application, encapsulating product attributes, relationships, and validation logic
- Facilitates product management by linking products to categories, order items, and orders, while ensuring data integrity through validation and referential checks
- Supports search and URL-friendly identifiers, serving as a core component for product catalog functionality within the overall architecture.
line_item.rb - Defines the LineItem model, representing individual products within a shopping cart
- It establishes associations with products and carts, enabling the calculation of total prices based on product prices and quantities
- This component is essential for managing and summarizing items in the e-commerce checkout process, supporting accurate order totals within the overall application architecture.
order.rb - Defines the Order model within the application, managing customer purchase data, associated items, and payment status
- Facilitates order tracking, validation, and payment processing, integrating with related entities like products and transactions
- Serves as a core component for handling e-commerce transactions, ensuring data integrity and supporting administrative querying and order lifecycle management.
user.rb - Defines the User model within the application, managing user authentication and account recovery functionalities through Devise modules
- It facilitates secure user login, password recovery, and session management, serving as a core component for user identity and access control within the overall system architecture.
mpesa_transaction.rb - Defines the MpesaTransaction model, managing mobile money payment records within the application
- Facilitates tracking transaction statuses—pending, completed, or failed—and links payments to orders
- Ensures data integrity through validations and provides methods to update transaction states, supporting seamless integration of M-Pesa payment workflows into the overall order processing architecture.
application_record.rb - Defines the base class for all database models, establishing a shared foundation for data interactions within the application
- It ensures consistent behavior and configurations across models, facilitating maintainability and scalability of the data layer in the overall architecture
- This central abstraction streamlines model development and enforces common conventions throughout the codebase.
category.rb - Defines the Category model, representing product categories within the application
- It manages category attributes, enforces name length constraints, and generates user-friendly URLs using slugs
- Establishes associations with products, enabling efficient categorization and retrieval, thereby supporting the overall organization and navigation structure of the e-commerce platform.
order_item.rb - Defines the structure and behavior of individual items within an order, linking each to specific products and orders
- Ensures accurate pricing, validates quantities, and provides mechanisms for calculating item costs
- Integral to the e-commerce system’s order management, facilitating precise tracking of purchased products and their associated costs within the overall order lifecycle.
cart.rb - Manages shopping cart functionality within the application, enabling addition of products, tracking item quantities, and calculating total prices
- Serves as a core component for e-commerce workflows by maintaining the state of user-selected items and facilitating order summaries, thereby supporting seamless shopping experiences and accurate transaction processing.
concerns
⦿ app.models.concerns
File Name Summary
.keep - Maintain the project’s modular architecture by serving as a placeholder within the models directory, ensuring the organization remains intact for future concern implementations
- Facilitates seamless integration of shared behaviors across models, promoting code reuse and consistency throughout the application’s data layer
- Supports scalable development by providing a structured point for adding concern-specific logic as the project evolves.
jobs
⦿ app.jobs
File Name Summary
application_job.rb - Defines the base class for background jobs, establishing common behavior and error handling strategies within the applications job processing framework
- It ensures reliable execution by managing retries for deadlocks and handling deserialization errors, thereby supporting robust and maintainable asynchronous task execution across the entire codebase.
mailers
⦿ app.mailers
File Name Summary
application_mailer.rb - Defines the base mailer class for the application, establishing default sender information and layout configuration
- Serves as the foundational component for all email communications, ensuring consistency and centralized management of email delivery settings within the overall application architecture.
order_mailer.rb - Facilitates the delivery of order confirmation emails by generating personalized messages for customers
- Integrates with the overall notification system to ensure timely communication of order details, supporting the e-commerce platform’s customer engagement and order tracking functionalities
- This component is essential for maintaining clear, automated communication between the system and users regarding their purchases.
services
⦿ app.services
File Name Summary
mpesa_service.rb - Facilitates integration with M-Pesa payment platform by managing payment initiation and status queries
- Ensures secure configuration validation, formats phone numbers appropriately, and logs transaction details for transparency
- Serves as a core component enabling seamless mobile money transactions within the application’s architecture.
views
⦿ app.views
shared
⦿ app.views.shared
File Name Summary
_navbar.html.erb - Defines the websites primary navigation bar, facilitating user access to key sections such as Home, Categories, Shop, Deals, and Contact
- Incorporates user account management, search functionality, and quick links to wishlist and cart, ensuring seamless navigation and enhanced user experience across the entire application architecture.
_footer.html.erb - Provides a reusable footer component integrated into the applications shared view layer, ensuring consistent branding and copyright information across all pages
- It enhances the overall user interface by delivering a standardized footer section, contributing to the cohesive design and user experience within the web applications architecture.
pwa
⦿ app.views.pwa
File Name Summary
manifest.json.erb - Defines the web apps Progressive Web App (PWA) manifest, specifying app metadata, icons, and display settings to enable a seamless, app-like experience for users
- It ensures consistent branding and functionality across devices by configuring how the application appears and behaves when installed or launched from a home screen within the overall architecture.
service-worker.js - Implements a service worker to handle Web Push notifications within the Progressive Web App
- It manages incoming notifications by displaying alerts and facilitates user interactions by focusing existing app windows or opening new ones
- This component enhances user engagement and ensures timely delivery and management of push notifications across the application.
homepage
⦿ app.views.homepage
File Name Summary
index.html.erb - Provides the main user interface for the homepage, enabling product discovery through search, filtering, sorting, and categorization
- Facilitates seamless navigation and interaction with product listings, including visual presentation, filtering options, and actions like adding items to the cart or wishlist, thereby supporting an engaging and efficient shopping experience within the overall e-commerce architecture.
products
⦿ app.views.products
File Name Summary
show.html.erb - Displays comprehensive product details, including images, pricing, descriptions, and stock status, to facilitate user engagement and purchasing decisions
- Integrates related products to enhance browsing experience and encourages adding items to the shopping cart, supporting seamless navigation within the e-commerce architecture.
index.html.erb - Displays a comprehensive product catalog page, showcasing all available products with images, names, and prices
- Facilitates user browsing by presenting products in a responsive grid layout, enabling quick access to individual product details
- Serves as a central view for customers to explore the store’s offerings, supporting seamless navigation within the e-commerce architecture.
layouts
⦿ app.views.layouts
File Name Summary
mailer.html.erb - Defines the email layout template for transactional communications within the application
- It ensures consistent branding and styling across all email notifications, such as order confirmations or support messages, by providing a structured HTML framework
- This layout integrates dynamic content, maintaining visual coherence and enhancing user engagement throughout the entire email communication architecture.
application.html.erb - Defines the main HTML layout for the web application, establishing the overall structure, styling, and metadata
- Facilitates consistent page rendering by embedding shared components like navigation and footer, while supporting Progressive Web App features and responsive design
- Serves as the foundational template that ensures a cohesive user interface across all pages within the project architecture.
mailer.text.erb - Defines the plain-text email layout by rendering dynamic content within the email body, ensuring consistent formatting across all outgoing messages
- Integrates seamlessly into the overall mailing architecture, supporting reliable and uniform delivery of email communications within the application’s user engagement and notification system.
order_mailer
⦿ app.views.order_mailer
File Name Summary
confirmation_order.html.erb - Generates a comprehensive order confirmation email that communicates purchase details, including order summary, shipping information, and next steps
- It ensures customers receive clear, well-structured notifications about their completed transactions, enhancing user experience and fostering trust within the overall e-commerce platform architecture.
carts
⦿ app.views.carts
File Name Summary
show.html.erb - Displays the users shopping cart, presenting item details, quantities, and total costs
- Facilitates cart management actions such as emptying the cart, continuing shopping, or proceeding to checkout
- Integrates seamlessly into the overall e-commerce architecture, providing a clear and interactive view of selected products to enhance the shopping experience.
orders
⦿ app.views.orders
File Name Summary
mpesa_payment.html.erb - Facilitates seamless M-Pesa payment processing within the order flow by guiding users through payment initiation, status updates, and confirmation or failure handling
- Integrates visual progress indicators and real-time status feedback to enhance user experience, ensuring secure and efficient transaction completion aligned with the overall e-commerce architecture.
thank_you.html.erb - Displays a personalized order confirmation page, summarizing payment status, order details, and purchased items
- It provides users with clear feedback on transaction success or pending status, along with options to continue shopping or view all orders, thereby enhancing the post-purchase experience within the overall e-commerce architecture.
new.html.erb - Facilitates the user checkout experience by capturing shipping details and payment preferences via M-Pesa, while presenting an order summary
- Integrates form validation and error handling to ensure accurate data collection, enabling seamless transaction processing within the overall e-commerce architecture
- Supports smooth user interaction from cart review to order placement, emphasizing secure and efficient payment flow.
index.html.erb - Displays a user’s order history, presenting individual order details such as date, total cost, item count, and payment status
- Facilitates navigation to order specifics and payment completion when applicable
- Enhances the shopping experience by providing clear, organized access to past transactions and actionable options within the overall e-commerce architecture.

Getting Started

Prerequisites

This project requires the following dependencies:

  • Programming Language: Ruby
  • Package Manager: Bundler, Rake, Npm, Yarn
  • Container Runtime: Docker

Installation

Build myshop from the source and install dependencies:

  1. Clone the repository:

    ❯ git clone https://github.com/syntaxmage05/myshop
  2. Navigate to the project directory:

    cd myshop
  3. Install the dependencies:

Using docker:

❯ docker build -t syntaxmage05/myshop .

Using bundler:

❯ bundle install

Using npm:

❯ npm install

Using yarn:

❯ yarn install

Usage

Run the project with:

Using docker:

docker run -it {image_name}

Using bundler:

bundle exec ruby {entrypoint}

Using npm:

npm start

Using yarn:

yarn start

Testing

Myshop uses the {test_framework} test framework. Run the test suite with:

Using docker:

echo 'INSERT-TEST-COMMAND-HERE'

Using bundler:

bundle exec rspec

Using npm:

npm test

Using yarn:

yarn test


mpesa
Open.Shop.-.Brave.2026-04-11.12-32-17.mp4

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors