Laravel Next Shopping Cart System
A personal project to showcase Laravel REST API development and Firebase integration: sign in with Google, browse and search products, and keep a cart that survives a reload.
- Laravel
- PHP 8.3
- Next.js 14
- TypeScript
- Firebase Auth
- Redux Toolkit
- RTK Query
- MySQL
- Docker
- Type
- Personal project
- Date
- May 2026
- Auth
- Google via Firebase
- Runtime
- Docker or local WAMP
Overview
A shopper signs in with a Google account, browses a paginated and searchable product list, and manages a cart — add, increment, decrement, remove. The cart is stored in MySQL through the API rather than in the browser, so it persists across reloads and devices.
Tech Stack
Backend
Laravel REST API on PHP 8.3 with MySQL, served by Nginx in Docker. kreait/laravel-firebase verifies Firebase ID tokens.
Frontend
Next.js 14 (App Router) with TypeScript, Redux Toolkit for state, RTK Query for API calls, Tailwind CSS.
Auth & tools
Firebase Authentication with Google sign-in, Docker Compose, phpMyAdmin for inspecting the database.
Architecture
- Product routes are public. User and cart routes sit behind a middleware that verifies the Firebase token on every request, and the signed-in user is synced into the database.
- Optimistic cart: a click updates the Redux store immediately, so the interface never waits on the network.
- Debounced batch sync: cart changes are collected and sent to a single batch-update endpoint after a 1.5-second pause, instead of one request per click.
- Built as a single-page app with lazy loading, and with the Laravel ORM queries optimised.
Deployment
Docker Compose runs MySQL, the Laravel API, the Next.js front end and phpMyAdmin together. The one prerequisite is a Firebase project with Google sign-in enabled, whose credentials are supplied before starting.
docker-compose up -d --build
It can also run without Docker on a local WAMP stack. The database is seeded with 20 sample products. The project runs locally; there is no hosted demo.
Links
Have a system to build?
Tell me what it needs to do. I’m open to full stack, Laravel, backend and Node.js roles.
Start a conversationDhaka, Bangladesh · Available for remote opportunities