Warungku (My Shop) is a web-based e-commerce or point-of-sale application built with Laravel 12 and PHP 8.2+. It provides a customer-facing interface for browsing menus, adding items to a shopping cart, and proceeding to checkout.
- Backend Framework: Laravel 12.x
- Language: PHP 8.2+
- Frontend Bundler: Vite
- Styling: Tailwind CSS v4 (@tailwindcss/vite)
- Templating: Laravel Blade (
resources/views/customer/) - Database: Configured via Eloquent ORM (Models:
User,Role,Category,Item,Order,OrderItem).
This project follows the standard Laravel MVC architectural pattern:
- Controllers: The main logic for the customer interface is handled in
app/Http/Controllers/MenuController.php. - Models: Core business entities are located in
app/Models/and include structures for users, roles, menu items, categories, and orders. - Views: Customer-facing views are located in
resources/views/customer/and use Blade templating with layouts. - Routes: Defined in
routes/web.php, handling main pages like/menu,/cart, and/checkout. - Assets: Raw CSS and JS are in
resources/css/andresources/js/respectively, processed by Vite. Additional static assets might reside inpublic/assets/.
To run this application locally, you will need PHP, Composer, Node.js, and npm installed.
- Copy the environment file:
cp .env.example .env - Install PHP dependencies:
composer install - Generate application key:
php artisan key:generate - Set up the database (requires configuring
.envfirst):php artisan migrate --seed(assuming seeders are configured) - Install Node dependencies:
npm install
You can run the application using the predefined Composer script which uses Concurrently to start the Laravel server, Queue listener, and Vite dev server all at once:
composer run devAlternatively, you can run them manually:
- Start the Laravel backend server:
php artisan serve - Start the Vite frontend development server:
npm run dev
To compile frontend assets for production:
npm run build- Styling: Utility-first styling is enforced using Tailwind CSS.
- Routing: Standard Laravel route definitions utilizing named routes (e.g.,
Route::get('/menu')->name('menu')). - Testing: PHPUnit is configured for unit and feature testing (
tests/directory). Run tests viacomposer run testorphp artisan test. - Cart Logic: Cart operations (add, update, remove) are currently handled via POST requests to specific endpoints handled by
MenuController.