Healthy Meal Plans on Swiggy | High Level System Design

Bishal Chakraborty
5 min readApr 13, 2023

--

Problem Statement:

To come up with a detailed solution for Swiggy to address users’ pain points and needs and increase the WoW retention

Proposed High Level Solution:

Introduction of Healthy Meal Plans in Swiggy

Functional Requirements::

Users should be able to:

→ discover the “Healthy Meal Plans” feature on the app via browsing, search

→ see recommendations of a “Healthy Meal Plan”

→ browse and select meal plans from different restaurants.

→ view details of the meal plans, including meal items, nutrition facts, and prices.

→ subscribe to a weekly or monthly meal plan

→ view and manage my active subscriptions.

→ receive notifications about upcoming meal deliveries.

→ rate and review meal plans.

→ review my past purchased meal plans and Reorder them

Non-Functional Requirements:

→ Latency

→ Consistency

→ High Throughput

User Journey:

Overall Application Flow:

Let’s outline the flow of an application that utilizes a microservices-based architecture. The architecture includes various services that are depicted in a diagram. All requests from the user interface or mobile app are directed to these services via an API gateway. The API gateway handles load balancing, routing, and user authentication/authorization. A token ID is returned, which is subsequently used for further communication.

Transactional databases such as user registration and management service, order service, and payment service use Amazon Aurora relational database, which is highly scalable. Information about restaurants, their menus, prices, and offers are stored in ElasticSearch using JSON document storage in a multi-node cluster. ElasticSearch provides fast, scalable search options when a customer searches for a menu or cuisine.

When the user selects a meal plan from a restaurant, they proceed to filling the relevant details, checkout and payment. The system integrates with different payment gateways and options to ensure successful payment and order placement. Once the order is placed, information is sent to a central message queue like Kafka, where the subscription processing unit reads the information and notifies the selected restaurant about the meal plan subscription. The system also searches for available delivery partners to nearby locations to pick up the order, prior to the delivery time. It determines the best delivery partner based on location and other details and notifies them about the order and restaurant details.

The user receives push notifications about the order, and the order processing and tracking service work together to provide real-time order status and live location of the delivery person. Finally, the delivery person picks up the order and delivers it to the customer, who is notified in real-time with an estimated time of arrival. The high-level system design for the solution can be broken down into the following components:

User interface:

The user interface is the front-end component that enables users to interact with the app. It should be designed to provide a seamless and intuitive experience for users. This includes features such as menu navigation, search, order tracking, payment processing, and customer support.

When it comes to our solution, users should be able to explore healthy food options and find suitable meal plans based on their diet,

App UI

Website UI (Meal Plans)

Meal details and subscription

Database:

The database is the back-end component that stores all app-related information. It should be designed to support a high volume of data and provide quick access to relevant information. The database should include tables for user profiles, restaurants, menus, orders, payments, and delivery partners.

APIs:

APIs are the middle layer that connects the user interface and the database. APIs should be designed to enable seamless communication between the app’s front-end and back-end components. This includes authentication, authorization, and data transfer.

Payment gateway integration:

Payment gateway integration is a critical component of the app design. It should be designed to enable secure and seamless payment processing. This includes integrating with popular payment gateways such as PayPal, Stripe, or Braintree.

Restaurant management system:

The restaurant management system is the back-end component that enables restaurant owners to manage their menus, prices, and orders. It should be designed to provide a user-friendly interface for restaurant owners to add, edit, and delete menu items, manage pricing and discounts, and process orders.

Delivery partner management system:

The delivery partner management system is the back-end component that enables delivery partners to manage their orders and track their deliveries. It should be designed to provide a user-friendly interface for delivery partners to accept and reject orders, track their deliveries, and manage their earnings.

Analytics and reporting:

Analytics and reporting are important components of the app design. It should be designed to enable tracking of key performance indicators such as subscription volume, user engagement, and revenue. This includes providing real-time dashboards, generating reports, and analyzing user behavior.

Overall, the solution’s high-level system design should be carefully planned and executed to ensure that it meets the needs of users, restaurant owners, and delivery partners. It should be scalable, secure, and user-friendly, with features that enable seamless communication and efficient operations.

--

--