Laravel REST API backend for the AlgShop e-commerce marketplace.
AlgShop Backend provides the server-side API for AlgShop, handling authentication, shops, products, shopping carts, checkout, orders, addresses, reviews, and seller workflows.
The backend is built with Laravel 12, PHP, and a MySQL-compatible database.
https://github.com/amarmaruf6800-collab/algshop-frontend
The current demo uses simulated payment processing for development and demonstration purposes.
- User registration
- User login
- Laravel Sanctum authentication
- Protected API endpoints
- Authenticated user profile access
- Create a seller shop
- Manage seller shop data
- Associate products with individual shops
- Buyer and seller workflows
- Create products
- Update products
- Delete products
- Product pricing
- Discount management
- Stock management
- Multiple product images
- Product catalog API
- Add products to cart
- View cart
- Update cart data
- Remove cart items
- User-specific cart
- Prevent users from purchasing products from their own shop
- Add shipping addresses
- Edit addresses
- Delete addresses
- Set default address
- Manage user-specific addresses
- Checkout cart
- Select shipping address
- Group orders by seller/shop
- Generate invoice numbers
- Create order items
- Deduct product stock during checkout
- Buyer order history
- Seller incoming orders
- Seller order status management
- Invoice-based payment flow
- Simulated payment endpoint
- Payment status handling
Note: The current implementation uses a simulated payment endpoint and does not represent a live payment gateway integration.
- Product ratings from 1β5 stars
- Review comments
- Verified-purchase review validation
- Prevent duplicate reviews from the same user
ALGSHOP
ββββββββββββββββββββββββββββββββββββ
β React + Vite Frontend β
β β
β Catalog β’ Cart β’ Checkout β
β Orders β’ Seller Dashboard β
βββββββββββββββββ¬βββββββββββββββββββ
β
β HTTP / REST API
βΌ
ββββββββββββββββββββββββββββββββββββ
β Laravel 12 API β
β β
β Sanctum Authentication β
β Product β’ Shop β’ Cart APIs β
β Order β’ Address β’ Review APIs β
βββββββββββββββββ¬βββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββ
β MySQL-compatible DB β
β β
β Users β’ Shops β’ Products β
β Orders β’ Cart β’ Reviews β
ββββββββββββββββββββββββββββββββββββ
The frontend is deployed separately from the Laravel backend.
- PHP
- Laravel 12
- Laravel Sanctum
- Laravel Breeze
- Eloquent ORM
- MySQL / MariaDB-compatible database
- REST API
- JSON
- HTTP authentication
- VPS backend deployment
- Vercel frontend deployment
algshop-backend/
β
βββ app/
β βββ Http/
β βββ Models/
β βββ ...
β
βββ bootstrap/
βββ config/
βββ database/
β βββ migrations/
β βββ seeders/
β
βββ public/
βββ resources/
βββ routes/
β βββ api.php
β
βββ storage/
βββ artisan
βββ composer.json
βββ composer.lock
βββ README.md
The API is organized around the main marketplace workflows.
POST /api/login
POST /api/register
GET /api/katalog
GET /api/produk/{id}
GET /api/keranjang
POST /api/keranjang/{product_id}
POST /api/checkout-keranjang
GET /api/alamat
POST /api/alamat
PUT /api/alamat/{id}
DELETE /api/alamat/{id}
PUT /api/alamat/{id}/default
POST /api/bayar-simulasi
GET /api/riwayat-belanja
POST /api/produk/{id}/ulasan
POST /api/buka-toko
GET /api/toko-saya/produk
POST /api/toko-saya/produk
POST /api/toko-saya/produk/{id}
DELETE /api/toko-saya/produk/{id}
GET /api/pesanan-masuk
PUT /api/pesanan/{id}/status
- PHP 8.2+
- Composer
- MySQL / MariaDB-compatible database
- Node.js and npm for the frontend
git clone https://github.com/amarmaruf6800-collab/algshop-backend.git
cd algshop-backendcomposer installCreate the environment file:
cp .env.example .envConfigure the database and application settings in .env.
php artisan key:generatephp artisan migratephp artisan storage:linkphp artisan serveDo not commit production credentials or secrets to GitHub.
Configure environment-specific values in .env.
Example:
APP_NAME=AlgShop
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=algshop
DB_USERNAME=your-user
DB_PASSWORD=your-passwordAlgShop Backend demonstrates practical backend development through:
- REST API development with Laravel
- Authentication with Laravel Sanctum
- Role-based buyer and seller workflows
- Product and shop management
- Shopping cart implementation
- Checkout and order processing
- Stock deduction during checkout
- Shipping address management
- Product review validation
- Relational database integration
- Frontend/backend API integration
User
β
Authentication
β
Browse Catalog
β
Product Detail
β
Shopping Cart
β
Checkout
β
Payment Simulation
β
Order Creation
β
Stock Deduction
β
Seller Order Management
Amar
Junior Web Developer | Full-Stack Enthusiast
Information Technology / Web Development