Tugas Pertemuan 7 PPL - Studi Kasus Aplikasi Restoran
Nama : 1. Frederick Yonatan Susanto / 5025211121
2. Akmal Sulthon Fathulloh / 5025211047
Tahun Ajaran : 2023/2024 (Genap)
Pada pertemuan ketujuh di kelas PPL A, kita diminta untuk mendeskripsikan bagaimana Low Level Design dan High Level Designnya dari sistem food delivery/restaurant. Referensi dapat dicari dari paperwork, jurnal, dokumentasi aplikasi, dll.
High Level Design and Low Level Design
Food Delivery System
A. Problem Statement
Design online food delivery system.
B. Functional Requirements
- User can search different restaurant based on his/her location
- User can select a restaurant
- User can see the menu of selected restraunt
- Restraunt can change the menu any time
- User selects restraunt and add different food items from the menu
- User orders the food by selecting different online payment modes
- Cash on delivery can be also option (Optional)
- User can track the order in real time
- User can cancel the order
- The restaurant process the orders by preparing the meal and packaging the orders.
- The restaurant contacts the delivery service or their personnel delivery staff to deliver.
- Daily allows users to schedule their meals in advance or opt for a daily, weekly or monthly subscription. (Not in scope but it will be good to have in future.)
- Customers will have different offers in the form of coupon, discounts, etc.
C. Non-functional Requirements
- No. of orders = 10,000 orders per minute
- No. of cities and towns operational = 500
- Total number of restraunts listed on the application = 140,000
- Total active delivery partners = 2,00000
- Total number of order cancellations = 1,500 daily
- System should be highly scalable and available.
- User should be able to get all features with minimal latency.
D. Scalability Estimation
a. Traffic Estimates
System is expecting 10,000 orders per minute. So, order requests per second will be:
10, 000 orders per minute/60 = ~ 167 Orders /Second
b. Storage Estimates
Since we are expecting 10,000 orders per minute so, per day will be:
Orders per day = 10, 000 orders/minute * 60 * 24 = 14,400,000 orders/day
Total expected orders in 5 years = 14,400,000 orders/day * 12 Months * 5 Years = 864,000,000
Lets assume the size of object = 500 bytes
Total storage in 5 years = 432 GB
c. Bandwidth Estimates
For order, since we are expecting 167 Orders /Second so, the total incoming data for the service will be:
167 Orders/Second * 500 bytes = ~ 1 MB/Second
E. High Level Design (HLD)
Food delivery system can be devided into three major components:
- Customer's Application
- Driver's Application or Delivery guy's application
- Admin Panel
a. Customer's Application
Selection of city and listing of restraunts
- Searching menu: Allow users to search for different restaurants, cafes, pubs, and bars by location and cuisines. Users can go through the menus and choose an item from using the search filter; users can easily find their favorite eating places.
- Order placement/Cancellation: The user can place an order of selected dishes and food with just a few simple taps on the screen. User can cancel order with a given allowed time.
- Tracking Drivers: Users can check how much time a driver will take to reach their food parcel.
- Payment gateway integration: It will be required for the payment by users. It will have multiple options of payment.
b. Driver's Application or Delivery guy's application
- Driver's profile: Driver can update his profile details like his name, email, address, phone number, photos, or any other details.
- Notification for orders: Through push notifications, drivers can get constant updates & alerts for new food orders online. It will help in the accurate delivery service of your restaurant.
- Map for the delivery route: Integrate Google Map or Waze and allow drivers to choose the shortest and fastest routes to reach the location.
c. Admin Panel
- Restaurant management: Being on the admin panel, one can directly manage all the restaurants by adding, updating, and removing any eating joint from the list. He can also check active restaurant status and also menu pricing.
- Analytics & report generation: Using the analysis and report feature, you can get real-time insights of reports and other accounting information, which helps you to identify the growth and opportunities to expand reach.
- Monitoring every action: Monitor all the drivers, changes in the menu, deliveries, ratings & reviews of drivers, canceled orders, and other important data related to the driver’s performance.
- Payment and commission management: Allow owners to set payment and commission rates and manage it directly from the panel with every single partner and make payments.
d. Other components can also be included (Not in current scope. This can be the part of future scope):
- Customer Relationship Management (CRM): This will be required to help and understand about customers. It will include the solution or query related to ordering or any problem related to order and delivery, likes-deslikes, transancation details, sales details, order patterns, etc.
- Estock Management: It can maintain raw material management, stock availability, consumption report (monthly/yearly), and stock expiration date, etc.
- High level design for each component or area can be very wide. Each component will have separate high level design. You should discuss about the area before the development and drawing of high-level design. Interviewer will ask you to pickup one from three of them. Lets say its customer's application.
High-level design in general is as below:
Explanation:
- User Interface: Customers engage with the system through mobile apps, web interfaces, or desktop applications.
- Authentication and Registration Services: This service handles user authentication and registration. All users, including customers, restaurant admins, and delivery agents, undergo authentication and registration processes.
- Database: Storing user data, restaurant details, menus, orders, and metadata, the database serves as the central repository for the system.
- Payment Services: Responsible for managing all payment-related data and services.
- Order Services: This service is tasked with placing orders at restaurants and managing all order-related processes.
- Delivery Services: Focused on delivery-related operations, this service locates delivery agents and facilitates real-time package tracking using Map Services.
- Restaurant Admin Services: Enabling restaurants to view and manage placed orders, this service also allows admins to modify menus, prices, and food images.
- Tracking Services: Tracking user and delivery agent locations, Map Services collaborate with Delivery Services and customers for real-time location tracking.
The data flow within the system would include the following:
Explanation:
- User selects the preferred payment option from the User Interface component.
- The User Interface component sends the user’s payment request to the Payment Options component.
- The Payment Options component selects the appropriate payment gateway and sends the payment request to the Payment Gateway component.
- The Payment Gateway component interacts with external payment providers and financial institutions to authorize and settle the transaction.
- The Payment Gateway component sends the payment confirmation to the Payment Options component.
- The Payment Options component sends the payment confirmation to the User Interface component.
- The User Interface component displays the payment confirmation to the user.
F. Low-Level Design (LLD)
a. Component and Interface
- Restaurants can register themselves — addRestaurant
- Customers can see the list of all the restaurants — getAllRestaurants
- Admin can search for the restaurant using Id — getRestaurantById
- Customers can search for restaurants using name — getRestaurantsByName
- Customers can search for restaurants using city — getRestaurantsByCity
2. User Service
- Users can register themselves — addUser
- Users can delete their profiles — deleteUser
- Users can update their profiles — updateUser
- Users can get info of their profiles — getUser
- Restaurants can add the food menu — addMenuByRestaurantId
- Admin can search for the food menu using Id — getMenuById
- Customers can see the menu — getMenuByRestaurantId
- Admin can add more items in the menu — addMenuItemsByMenuId
- Restaurants can add more items — addMenuItemsByRestaurantId
- Customers can search for the items using cuisine type — getMenuItemsByRestaurantIdAndCuisine
- Customers can search for the items using meal type — getMenuItemsByRestaurantIdAndMealType
- Admin can search for the item using Id — getMenuItemById
- Customers can see the bill details — getBill
- Customers can place or cancel orders — updateOrder
- Admin can search for the order — getOrderById
- Customers can see their order history for a restaurant — getAllOrdersByRestautantId
- Customers can see their all order history — getAllOrders
- Customers can pay for their orders — addPayment
- Admin can search for the payment using Id — getPaymentById
- Customers can see the payment made — getPaymentByOrderId
- Payment must match the bill — validatePayment
- Admin/Restaurants can add delivery — addDelivery
- Admin can get the delivery by Id — getDeliveryById
- Delivery boy can see all the deliveries made — getDeliveriesByDeliveryBoyId
- Customers can track the order status — getOrderStatus
b. Algorithm
d. Detail Implementation
- The code is implented using Java language
- The framework that will be used are: Spring Boost and Firebase (for the backend)
Komentar
Posting Komentar