This project is a fully-functional Laravel-based e-commerce website built to facilitate online shopping with support for Stripe payment gateway integration. It provides a robust platform to manage products, categories, and subcategories, as well as a seamless shopping experience with features like product combos, a shopping cart, and checkout options.
- User-friendly shopping cart: Add, edit, and remove products in the cart.
- Product Management: Manage products in different categories and subcategories.
- Product Combos: Create product combos to provide bundle discounts and increase sales.
- Order Checkout: Supports both Stripe payments and Cash on Delivery (COD) options.
- Twilio Integration: Send SMS notifications to users for order confirmations and updates.
- Mail Integration: Automated email notifications for order status and confirmation.
- Category & Subcategory Management: Easily manage your product catalog through categories and subcategories.
- Responsive Design: Fully responsive and ready for production.
- Backend: Laravel (PHP framework)
- Frontend: Blade Templates (HTML, CSS, JS)
- Database: MySQL
- Payment Gateway: Stripe
- SMS Service: Twilio
- Email Service: SMTP (Mail)
Follow these instructions to get the project up and running on your local machine or server.
Make sure you have the following installed:
- PHP 8.0 or higher
- Composer (for managing PHP dependencies)
- MySQL or any other compatible database
- Node.js and NPM (for frontend assets compilation)
- Git (for cloning the repository)
To download the project, you need to clone the GitHub repository. Run the following command:
git clone https://github.com/your-username/Laravel-E-commerce-website-with-stripe-payment-gateway.git
cd Laravel-E-commerce-website-with-stripe-payment-gateway
-
Install the backend dependencies using Composer:
composer install
-
Install frontend dependencies using NPM:
npm install
- Copy the example environment file to create your own
.env
file:cp .env.example .env
- Open the
.env
file and configure the following variables:DB_DATABASE=your_database_name DB_USERNAME=your_database_username DB_PASSWORD=your_database_password
- Stripe Configuration:
STRIPE_KEY=your_stripe_key STRIPE_SECRET=your_stripe_secret
- Twilio Configuration:
TWILIO_SID=your_twilio_sid TWILIO_AUTH_TOKEN=your_twilio_auth_token TWILIO_PHONE_NUMBER=your_twilio_phone_number
- Mail Configuration (for sending emails):
MAIL_MAILER=smtp MAIL_HOST=smtp.gmail.com # Or your preferred mail service MAIL_PORT=587 MAIL_USERNAME=your-email@example.com MAIL_PASSWORD=your-email-password MAIL_FROM_ADDRESS=your-email@example.com MAIL_FROM_NAME="Your Store Name"
- Run the following command to generate your application's encryption key:
php artisan key:generate
- Next, run the database migrations to create the necessary tables in your database:
php artisan migrate
- To compile the frontend assets (CSS, JavaScript), run the following command:
npm run dev
- Run the Laravel development server:
php artisan serve
-
You can now access the application in your browser by navigating to:
http://127.0.0.1:8000
This will start the application at http://127.0.0.1:8000.
- Use Stripe's test keys and test card numbers (e.g.,
4242 4242 4242 4242
) for testing payments. - Ensure that the Stripe payment gateway works correctly by making a test purchase.
- The checkout process supports the Cash on Delivery (COD) option.
- Test this by selecting COD as the payment method during checkout.
- Twilio: Integration allows sending SMS notifications for order confirmations and updates.
- Mail: Email notifications are sent to users for order confirmations and status updates.
- Replace Placeholders: Ensure you replace all placeholder values (
your-...
) in the.env
file and the code with actual API keys, credentials, and values.