Example application of Restaurant Delivery system. Separate website areas for customers to place orders, for staff to track orders, and for vendors to manage menus. Built on top of Vue Inertia containing preparations for API usage (like Mobile applications).
How to install
- Clone the repository with
git clone
- Copy the
.env.example
file to.env
and edit database credentials there - Run
composer install
- Run
php artisan key:generate
- Run
php artisan storage:link
- Run
php artisan migrate --seed
(it has some seeded data for your testing) - Run
npm ci
andnpm run build
- Launch the main URL
/
. Log in with credentials for a user to desire:- Admin: [email protected] / password
- Vendor: [email protected] / password
- Customer: [email protected] / password
- That's it.
The project structure allows for a WEB application and an API endpoint, for example, for a mobile app.
Service classes have been chosen to reuse code. All services are in the app/Services
directory.
app/└── Services/ ├── CartService.php ├── CategoryService.php ├── OrderService.php ├── ProductService.php ├── RestaurantService.php └── StaffMemberService.php
Controllers are divided into a directory by a user's role. APIs also have a version directory. Below, you can see a tree structure for the Controllers.
app/└── Http/ └── Controllers/ ├── Admin/ │ └── RestaurantController.php ├── Api/ │ └── V1/ │ ├── Admin/ │ │ └── RestaurantController.php │ ├── Customer/ │ │ ├── CartController.php │ │ └── OrderController.php │ ├── Staff/ │ │ └── OrderController.php │ └── Vendor/ │ ├── CategoryController.php │ ├── ProductController.php │ └── StaffMemberController.php ├── Auth/ │ ├── AuthenticatedSessionController.php │ ├── ConfirmablePasswordController.php │ ├── EmailVerificationNotificationController.php │ ├── EmailVerificationPromtController.php │ ├── NewPasswordController.php │ ├── PasswordController.php │ ├── PasswordResetLinkController.php │ ├── RegisteredUserController.php │ └── VerifyEmailController.php ├── Customer/ │ ├── CartController.php │ └── OrderController.php ├── Staff/ │ └── OrderController.php ├── Vendor/ │ ├── CategoryController.php │ ├── MenuController.php │ ├── ProductController.php │ └── StaffMemberController.php ├── Controller.php ├── HomeController.php ├── ProfileController.php └── RestaurantController.php
Next in this example, we will show you how to handle Permissions and order creation