Skip to content

yeha98555/ecommerce-laravel

Repository files navigation

Ecommerce API Server

Docker compose to setup php and mysql for Laravel 8.

Function:

  • Cart CRUD
  • Auth Signup, Login, Logout
  • Checkout
  • VIP Discount
  • Check Quantity

Demo:
https://www.youtube.com/watch?v=ko44wq1JANk

Environment

  • Ubuntu 22.04
  • Docker 20.10.18

Directory Structure

ecommerce-laravel
├── ...
├── Makefile
├── Dockerfile
├── docker-compose.yml
├── .env
├── php.ini
└── images
  • ... : Laravel files. Use Laravel-8.1.0.
  • images : README.md images.
  • .env : Copy and edit from .env.example.

Docker Images

  1. php → php:7.4-fpm-alpine
  2. mysql → mysql:5.7.22

Deployment using Docker

  1. Deploy php-fpm, and mysql using Makefile
    make up
  2. Stop all containers
    make stop
  3. Close all containers
    make down
  4. Remove all containers and images
    make rm
  5. Restart (Rebuild all images and containers)
    make restart

Development

  1. go in php
    docker exec -it ecommerce-backend sh
    /var/www $
    
    # write `php artisan` and `composer` code, for example:
    /var/www $ php artisan migrate
    /var/www $ composer dump-autoload
  2. go in mysql
    docker exec -it ecommerce-db mysql -u root -p
    Enter password: 
    mysql> 

SQL Structure

export the SQL structure

docker exec -it ecommerce-db mysqldump -u root -proot --no-data -d chart > chart.sql

draw diagram in dbdiagram db diagram

TODO

  • Swagger
  • UML
  • Add Contrained cart_id, product_id to cartItems
  • Create SuperUser
    • Set User Level API
    • Fix Product CUD
  • Review MVC and php artisan command
  • Nginx
  • Grafana + AlertManager

Reference

About

Implement E-Commerce Website in Laravel Docker

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages