Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hebaelshamy/cart-pricing-program
https://github.com/hebaelshamy/cart-pricing-program
Last synced: 29 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/hebaelshamy/cart-pricing-program
- Owner: HebaElshamy
- Created: 2023-11-20T21:07:30.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-22T11:09:04.000Z (about 1 year ago)
- Last Synced: 2023-11-22T22:37:57.762Z (about 1 year ago)
- Language: PHP
- Size: 166 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Cart Pricing Program
## Overview
This project presents a comprehensive solution for managing a shopping cart service, covering both the back-end and front-end aspects. Its purpose is to address the need for a robust and scalable system that enables users to seamlessly interact with their shopping carts. The focus is on delivering a user-friendly and efficient shopping experience.
## Description
This project addresses the challenge of pricing a cart of products with different shipping rates, discounts, and VAT. The solution is a PHP (Laravel+MySql) backend application that calculates the total cost, applies discounts, and generates a detailed invoice in USD.
## Solution Overview
- Problem: Pricing a cart with various products, each with different shipping fees, discounts, and VAT.
- Solution: Developed a PHP application using Laravel, adhering to Object-Oriented (OO) fundamentals, SOLID principles, and utilizing pre-defined design patterns.
## Features
- Accepts multiple products from different countries.
- Combines special offers and calculates discounts.
- Displays a detailed invoice in USD, including subtotal, shipping fees, VAT, and applicable discounts.
### Backend Highlights:
- **Comprehensive Logic**: The backend houses the core logic for cart pricing, ensuring accuracy and reliability.
- **Object-Oriented Design**: Leveraging OO fundamentals enhances code organization and readability.
- **Scalability**: The chosen technologies and design patterns allow for seamless scalability to accommodate future enhancements.
- **Layered Service Design**: The application follows a layered service design pattern, promoting modular development and ease of maintenance.
While the frontend utilizes jQuery and AJAX to enhance user interactions, the primary focus remains on delivering a robust backend solution. This choice aims to provide a foundation for a scalable and extendable system, ensuring a positive and efficient user experience.
## Technical Choices
- **Language/Framework**: PHP (Laravel+MySql) for backend development.
- **Frontend Interaction**: Utilized jQuery and AJAX to handle asynchronous requests, providing a seamless user experience without the need for page refresh.
- **Design Patterns**: Employed a layered service design pattern, adhering to Object-Oriented (OO) fundamentals, SOLID principles.
## How to Run the Program1. Clone the repository.
```bash
git clone https://github.com/HebaElshamy/Cart-Pricing-Program.git```
2. Install project dependencies using Composer:
```bash
composer install
```3. Copy the .env.example file and rename it to .env:
```bash
cp .env.example .env
```
4. Generate the application key:
```bash
php artisan key:generate
5. Configure the .env file with your database connection details
6. Run the database migrations to create tables:
```bash
php artisan migrate7. Populate the database with the required data.
```bash
php artisan db:seed
8. Start the local server:
```bash
php artisan serve
9. Open the project in the browser at http://localhost:8000.
10. To login as an user, use the following credentials:
- Email: [email protected]
- Password: 123456789
- Email: [email protected]
- Password: 123456789
11. Enjoy your experience!
## Review Guidelines
This project adheres to industry best practices, including:
- Object-Oriented fundamentals.
- SOLID principles.
- Well-structured and commented code.
- Error handling.
## Interview Task Link
https://github.com/momtazmeeenig/interview-task![Capture1](https://github.com/HebaElshamy/Cart-Pricing-Program/assets/46092804/2c33a025-5d38-4060-89b1-75762fbbf777)
![Capture2](https://github.com/HebaElshamy/Cart-Pricing-Program/assets/46092804/56d17dfc-7025-4672-87b5-13412a9b5c57)
![Capture3](https://github.com/HebaElshamy/Cart-Pricing-Program/assets/46092804/d13e6c59-6ea0-41db-9beb-ddfe7e5930de)