Lets Build Uber Eats Clone App 2022
Tags: ubereats, fullstack, node, nestjs
Published: 2022-03-17 00:11:37



## Lets Build Uber Eats Clone App 2022

#### Originally published here https://medium.com/tkssharma/lets-build-uber-eats-clone-app-2022-51ea2de77d2

Guys,

I am preparing a playlist to showcase full stake Production-ready application, Uber eats is a food ordering platform for restaurants and end-user who are ordering food

Let's think about what all we can build in this app using our own stack and technology

Let's think about architecture we can follow to build services

<figure class="it iu iv iw fq ix fe ff paragraph-image">

<div role="button" tabindex="0" class="iy iz cj ja dq jb">

<div class="fe ff is">![](https://miro.medium.com/max/1400/1*-NUVbht-bAOKipZaZ2NDhQ.jpeg)</div>

</div>

</figure>

{% youtube i1jcSwxUfdk %}

Technologies

*   FE for UI we can use simple React
*   BE for API and service development we can use Node JS with different SQL and no SQL Databases
*   The interface between UI and APIs can be REST or graphql based

<figure class="it iu iv iw fq ix fe ff paragraph-image">

<div role="button" tabindex="0" class="iy iz cj ja dq jb">

<div class="fe ff ju">![](https://miro.medium.com/max/1400/1*0CbdTxUg7ZwVAWsuNN_r8g.jpeg)</div>

</div>

</figure>

As we are doing this in a Microservice way, we can build different services that can be consumed by the UI layer.

UI layer will talk to the centralized gateway for any kind of request and API gateway will forward this request to the right set of services, a simple gateway based microservice architecture

<figure class="it iu iv iw fq ix fe ff paragraph-image">

<div role="button" tabindex="0" class="iy iz cj ja dq jb">

<div class="fe ff jv">![](https://miro.medium.com/max/1400/1*BWLD-2AXHS4NuZKPF-bq8g.jpeg)</div>

</div>

</figure>

In our case, we can decide if we want REST-based services or graphql based services

<figure class="it iu iv iw fq ix fe ff paragraph-image">

<div role="button" tabindex="0" class="iy iz cj ja dq jb">

<div class="fe ff jw">![](https://miro.medium.com/max/1400/1*GD9BJQD2URUifNCMp1PLfw.png)</div>

</div>

</figure>

Our Flow will be simple

UI layer to the gateway and from that to microservice, for authentication and authorization we will be using a simple auth service built in Node JS, and API gateway will also be a simple gateway in node js

Our Simple Requirements — based on a simple food ordering system

1.  Restaurants can register themselves.
2.  Users can create, update, delete, get their profiles.
3.  Users can search for the restaurant using a restaurant name, city name.
4.  Restaurants can add, update the food menu.
5.  Users can add remove food items from the cart
6.  Users can order food and can get the right communication and can also cancel the order in a pre-defined time.
7.  Users can track the delivery.
8.  Users should be able to make payments.
9.  Delivery boy can get all the deliveries made by him using his Id.
10.  Users can get the status of food anytime with all tracks.

Let's think in terms of services and Model Designing

### Restaurant Service

<figure class="it iu iv iw fq ix fe ff paragraph-image">

<div role="button" tabindex="0" class="iy iz cj ja dq jb">

<div class="fe ff kw">![](https://miro.medium.com/max/1400/1*mcysTrpysYfRDWHYqw-Z-A.png)</div>

</div>

</figure>

*   This service will deal with restaurant data only and will expose data for user search from UI, it like we can expose this data from elastic search
*   We need basic APIs from this service like adding a new menu item for restaurant Users or updating menu items.
*   Customers can search for menu items based on different search filters like item name or item name in a city
*   The restaurant owner can add new menu items to decide the price.

### User Service

*   User service to provide base authentication feature based on mobile no and OTP token
*   Post Login for new users we will allow to update Profile
*   For Users Mob No will be unique and the main profile identifier for authentication
*   Post Login user can update the profile and can populate User Profile data like location and set of addresses
*   Users can have multiple addresses where order delivery can happen with GPS location Coordinates.

### Food Menu Service

*   This looks like the same service as Restaurant but this has totally different business, it will land the information on UI when the user selects a particular restaurant and wants to see all menu items from that restaurant
*   Users can see all menu items provided by the restaurant
*   This service will be used by Admin and Customers as Admin can manage menu items and customer can search the menu items
*   admin can add more menu items or update existing menu items

### Cart Service

*   This service will manage the adding and removing items from the cart by the user
*   This service will talk to the food Menu service to fetch the details about the items ordered by the user.
*   Users can add and remove items before placing the order.

### Order Service

*   This service will manage orders and will expose to the customers and Admin of the system.
*   _Customers can place or cancel orders_
*   _Admin can search for the order_
*   _Customers can see their order history for a restaurant_
*   _Customers can see their all order history_

## Similarly, we are building a Payment and delivery service

The most important aspect of this whole system is domain level isolation so we don’t mix things in different services and there should be no too much decoupling of services

*   Managing authorization in services
*   Managing User sessions across different services
*   Providing Async Communication between services using messaging queues so we don’t lose any order due to some failure and provide retry mechanism
*   This will be an event-driven design as I can see lots of events as we can across different services and based on those events subscriber service can react like assigning a delivery partner, sending updates to customers, provide tracking real-time to the user.

> **_Next Part of this is design ERD and define Models for all these different services_**

I will keep adding all these videos in my YouTube playlist as I can’t explain and we can’t write whole complex things here in this Blog

The most challenging part of this whole design is —

*   Data synchronization and communication between services
*   Decoupled services where service A should know as less as possible about service B
*   Async communication to avoid any real-time failure using messaging bus platform (SQS, SNS, KAFKA, RABBIT MQ)
*   Build delivery guy assignment tooling based on GPS real-time.
*   Provider real-time tracking for customers (good to have).

References

*   [https://www.connecting-software.com/blog/what-is-an-api-gateway-how-it-can-actually-deliver-practical-results/](https://www.connecting-software.com/blog/what-is-an-api-gateway-how-it-can-actually-deliver-practical-results/)
*   [https://docs.microsoft.com/en-us/dotnet/architecture/microservices/architect-microservice-container-applications/direct-client-to-microservice-communication-versus-the-api-gateway-pattern](https://docs.microsoft.com/en-us/dotnet/architecture/microservices/architect-microservice-container-applications/direct-client-to-microservice-communication-versus-the-api-gateway-pattern)
*   tkssharma.com my own blogging platform

</div>

</div>

</section>