E-Canteen
Introduction
The E-Canteen project is a web application developed using Laravel and Inertia.js with Svelte. It aims to provide a convenient and efficient way for users to order food from a canteen online.
Features
- User Registration and Authentication: Users can create an account and log in to access the application.
- Menu Display: The application displays the available food items and their prices.
- Cart Management: Staff can add items to their cart, view the cart, and proceed to checkout.
- Order History: Staff can view their past orders.
- Admin Panel: Administrators have access to an admin panel to manage user accounts.
Technologies Used
- Laravel: A PHP framework used for backend development.
- Inertia.js: A library that allows you to build single-page applications using server-side routing and controllers.
- Svelte: A JavaScript framework for building user interfaces.
Installation
- Clone the repository:
git clone https://github.com/your-repo.git
- Install dependencies:
composer install && npm install
- Configure the environment variables: Copy the
.env.example file to .env and update the necessary variables.
- Generate the application key:
php artisan key:generate
- Run database migrations:
php artisan migrate
- Start the development server:
php artisan serve
Usage
- Access the application in your web browser at
http://localhost:8000.
- Register a new user account or log in with an existing account.
- Browse the menu, add items to your cart, and proceed to checkout.
- Place an order and receive a confirmation.
- View your order history.
Contributing
If you would like to contribute to the project, please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-feature-name
- Make your changes and commit them:
git commit -m 'Add some feature'
- Push to the branch:
git push origin feature/your-feature-name
- Submit a pull request.
License
This project is licensed under the MIT License.
Contributors
Previews
Login
Register
Dashboard
Product Table
Dev Note
Maintenance
- Websockets Implementation
- Products
- User Notification
User Interface
Security
Frontend
- Convert sweetalert helper to global modules (resources/js/app.js)
Backend
Data Management
- Supplier
- Reject Validation check if phone number starts from 0
- Automatically append 62 when entering supplier phone number
Business Process
Logic
- Listen when product stock changes
- Calculate stock with the restock threshold
- Example:
restock && stock <= min_stock
- Notify user
- Send a page which contain message to supplier
- or better, use whatsapp api to automate processes
Main Process
- Add to cart
- handled if cart stock is available
- handled if cart stock is empty
- Finish/Checkout transaction
- handled if posted order is valid, e.g. stock availability, etc.
- checked if ordered products needs restock, if yes, send notification to supplier
- Delete transaction only today
- If transaction gets deleted, it will softDeleted, then product stock will be updated/restocked with its pivot data/ordered products
- After product stock refreshed, it will check if it dont need restock, if yes remove the notification(if available)
Testing
Segments
- Data Availability (Null check, etc)
- CRUD
- Error Handling (Fail data validation, etc)
Authentication
- Register
- Login
- Manual Login
- Google Login
- Forgot Password
Products
Supplier
User
Transactions
- Create (POS)
- Stock check
- TransactionCreatedEvent triggered
- Delete
- Stock check
- TransactionCreatedEvent triggered
Deployment