This is a full-stack application built with Laravel 8 that enables users to:
- Add and remove items from the cart (using Redis for cart storage).
- Place an order (with orders stored in MySQL/PostgreSQL).
- View past orders.
The project has been dockerized for ease of setup and deployment. It includes a REST API with proper error handling, tests for key features, and optional frontend styling for enhanced user experience.
- Cart Functionality: Uses Redis to manage cart items efficiently.
- Order Management: Orders are stored in a relational database (MySQL or PostgreSQL).
- API: Provides robust endpoints with proper error handling and clear HTTP status codes.
- Testing: Includes comprehensive tests for all core features.
- Styling: Applied to improve navigation and user experience.
- Frameworks: Optional use of React or Vue.js for the frontend.
- Fully dockerized for easy setup and deployment.
- Version-controlled with GitHub/GitLab.
- CI/CD pipelines implemented for testing and deployment using GitHub Actions.
- Deployed to DigitalOcean with SSH as the authorization method.
- User authentication-Implemented User and Admin Sessions Authentication
- Payment processing - Missing
- Additional enhancements to improve the application- Created printable order receipts and admin together with user dashboards
This project is an e-commerce platform with features tailored for user, guest, and admin roles. Below is a detailed list of the features implemented.
-
User, Guest, and Admin Sessions
- Users and admins can browse, add items to their cart, and complete checkout.
- Guests can only view products without add them to a cart but have to sign up to be able to check out.
-
User Authentication
- Secure login and registration functionality for new system users.
-
Shopping Cart and Checkout
- Users can select multiple items, add them to the cart, and proceed to checkout.
- Automatic PDF receipt generation upon successful checkout.Sample receipt at Generated-Receipts folder in the project
-
Product Management
- Product categories and catalogs are seeded into the system for testing and demonstration.
- Admins can add or delete products and categories through the admin dashboard.
-
Dashboards
- Admin Dashboard: Provides reports, product management, and category management tools.
- User Dashboard: Allows users to view their profiles and track their orders.
-
Pre-Seeded Test Users
- Two roles (Admin and User) are pre-seeded for testing purposes.
- Credentials can be found in the
DatabaseSeeder.php
file.
- Docker and Docker Compose installed.
- Redis and MySQL/PostgreSQL configured within the Docker environment.
- PHP (if running outside Docker).
-
Clone the repository:
git clone <repository-url> cd <repository-folder>
-
Start the Docker containers:
docker-compose up -d
-
Install dependencies:
docker-compose exec app composer install
-
Configure the environment:
- Copy
.env.example
to.env
:cp .env.example .env
- Update the
.env
file with database and Redis details.
- Copy
-
Run database migrations and seeders:
docker-compose exec app php artisan migrate:fresh --seed
-
Create symbolic links for storage:
docker-compose exec app php artisan storage:link
-
Start the application:
- Access the application at
http://localhost
.
- Access the application at
To run tests for the application:
docker-compose exec app php artisan test
- Push changes to the repository (GitHub/GitLab).
- GitHub Actions pipeline triggers automatically to:
- Run tests.
- Build Docker images.
- Deploy to DigitalOcean.
- Connect to the DigitalOcean droplet via SSH.
- Pull the latest Docker image from your container registry.
- Run the updated containers using
docker-compose
.
- Start containers:
docker-compose up -d
- Stop containers:
docker-compose down
- Install dependencies:
docker-compose exec app composer install
- Run migrations and seeders:
docker-compose exec app php artisan migrate:fresh --seed
- Create storage link:
docker-compose exec app php artisan storage:link
- Run tests:
docker-compose exec app php artisan test
Ensure the following documentation is available:
- User guide for the application.
- CI/CD setup and configuration details.
- Deployment scripts and troubleshooting guide.
Feel free to fork the repository and create pull requests with improvements or bug fixes.