1. Home
  2. Docs
  3. UberEats Clone – Documentation
  4. Navigating the Code
  5. Main Configurations

Main Configurations

In order to start getting familiar with the code, you should learn about our main components and design patterns – there are a few critical components that will make navigating the codebase so much easier.

Folder Structure

There are two main folders: Core and MultiVendorApp.

  • Core is used for all of our important modules, such as shopping cart, chat, push notifications, etc. In general, things that can be used in multiple apps. You should be able to understand what each module is about based on the name.
  • MultiVendorApp contains files that are specific to the UberEats Clone, things like configurations, UI colors, the main host view controller, etc.

AppDelegate.swift

This is the best place to start browsing our codebase, since it’s literally the application entry point at run time. You can find interesting classes and dig deeper into their definition. Most names and methods are self-explanatory, which is the reason high-quality iOS code doesn’t need a lot of comments.

MultiVendorServerConfig.swift

You can modify this class to:

  • rename Firebase tables
  • disable reviews
  • disable the backend entirely
  • disable phone authentication

Simply toggle the flags.

MultiVendorUIConfiguration.swift

This is the main UI component of the app. Its the place where all the fonts and colors are being set. Simply play around with the colors here to customize the app theme as you wish.

The responsibilities of this class are:

  • Provide the main colors
  • Provide the main fonts
  • Configure the navigation bar & tab bar colors (in configureUI method)

You’ll notice this object is injected into every single adapter of the app, which is how theming is performed.

MultiVendorDataSourceProvider.swift

This is one of the most important files of the app, since it provides the data sources for all the screens in the app. By default, our app is integrated with Firebase, so the data sources returned by default are Firebase. If you do disable the Firebase integration in the serverConfig, this class will return hardcoded data sources.

For example, this is how the data source provider for fetching the reviews of a restaurant looks like:

func reviewsDataSource(for vendor: ATCVendor) -> ATCGenericCollectionViewControllerDataSource {
    if serverConfig.isFirebaseDatabaseEnabled {
        return ATCFirebaseFirestoreDataSource<ATCReview>(tableName: serverConfig.firebaseVendorReviewsTableName,
                                                         conditions: ["entityID": vendor.id],
                                                         limit: nil,
                                                         additionalFilterBlock: nil)
    }
    return ATCGenericLocalDataSource<ATCReview>(items: [])
}

Notice how, if Firebase enabled, we return a Firestore data source fetching the reviews based on the vendor’s ID. If Firebase is not enabled, we’ll just show an empty list of reviews.

This is how you integrate a different backend into the app! All you need to do is return your own custom data source instead of these two, and you’re golden.

A few things you can customize here:

  • Edit the walkthrough screens
  • Change the app to a different backend
  • Edit the onboarding screens (Login, Registration, Landing, Phone SMS, etc)