← All work

Case study

AADI

View as

AADI is a microservices-based application designed to streamline order management and dispatch in real-time. By leveraging modern technologies like AWS and a layered architecture, it enhances operational efficiency and provides a seamless user experience across web and mobile platforms.

Architecture

The architecture of AADI is built on microservices, ensuring scalability and reliability. Each service is dedicated to specific functionalities, such as orders, users, and restaurants, allowing for independent development and deployment, which enhances the overall system's resilience.

Stack

The technology stack of AADI includes mature frameworks and libraries that facilitate rapid development and deployment. By using AWS tools such as API Gateway and DynamoDB, the project ensures robust performance and scalability, making it a reliable solution for order management.

Deep dive

The AADI project tackles the challenge of real-time order dispatch through geofencing, ensuring timely deliveries. The capacity-aware orchestration feature optimizes resource allocation, while the admin portal and customer web app enhance operational management and user engagement.

AADI employs a microservices architecture with a layered pattern, utilizing AWS Lambda for backend services and React for the frontend. The project addresses complex challenges such as real-time order dispatch and capacity-aware orchestration through a well-structured codebase comprising 205 files.

Architecture

AADI's architecture is designed as a layered microservices system, with distinct services for orders, users, and restaurants. This separation allows for better maintainability and scalability. AWS Lambda is utilized for backend services, enabling serverless execution, while frontend applications are organized into separate packages for modular development.

Stack

AADI leverages a tech stack that includes JavaScript, TypeScript, and Python, with React and React Native for the frontend. The integration of AWS SDK, DynamoDB, and pytest enhances the backend capabilities, while tools like AWS SAM and CloudWatch support infrastructure management and monitoring.

Deep dive

AADI's implementation of geofencing for real-time order dispatch leverages AWS services to track location data efficiently. The capacity-aware order orchestration system dynamically adjusts to demand, ensuring optimal performance. The project also includes a comprehensive admin portal and customer-facing web and mobile applications, all built with a focus on modularity and maintainability.

Guided tour

  1. 01

    GPS-Powered Order Orchestration Platform

    Arrive is a capacity-aware order orchestration platform that ensures food is freshly prepared as customers approach restaurants. It leverages geofencing and real-time kitchen capacity evaluation to optimize dispatch timing.

    • Uses geofencing for order management
    • Built with React and Python
    • Supports just-in-time dispatch
  2. 02

    Microservice Architecture

    The project employs a layered microservice architecture using AWS Lambda for backend services, with separate services for orders, users, and restaurants. Shared utilities are deployed as a Lambda Layer to streamline functionality.

    • Utilizes AWS Lambda for backend
    • Follows microservice design pattern
    • !Has a layered architecture
  3. 03

    Key Utility: Geofencing Logic

    The file `services/orders/tests/test_geofence_events.py` contains tests for geofence event handling, showcasing the developer's focus on ensuring accurate location-based order management. This reflects a commitment to reliable service delivery.

    • !Contains tests for geofence logic
    • Focus on testing for critical features

    services/orders/tests/test_geofence_events.py

    import pytest
    
    @pytest.mark.parametrize('location, expected_event', [
        ("nearby", "dispatch_event"),
        ("far_away", "no_event")
    ])
    def test_geofence_events(location, expected_event):
        assert geofence_handler(location) == expected_event
    
  4. 04

    Well-Tested Codebase

    The project employs a comprehensive testing strategy with tests located in various services, including unit and integration tests. It uses pytest for Python tests and includes React testing with Jest.

    • !Tests with pytest for Python
    • Includes React testing with Jest
    • CI workflow for testing
  5. 05

    CI/CD Workflows for Deployment

    The project includes CI/CD workflows defined in GitHub Actions, facilitating automated testing and deployment processes. It targets AWS for deployment, leveraging services like API Gateway and Lambda.

    • CI/CD workflows configured
    • Uses AWS for deployment
    • Automated deployment scripts present
  6. 06

    Try It Out

    To explore the project further, you can clone the repository from GitHub. This will give you access to the full codebase and documentation.

    • !Clone the repository available
    git clone https://github.com/shashankcm95/AADI
Architecture
graph TD
    subgraph Clients
      C[Customer App<br/>React Native / iOS]
      A[Admin Portal<br/>React]
      W[Customer Web<br/>React]
    end

    subgraph AWS Cloud
      API[API Gateway]
      COG[Cognito Auth]
      
      subgraph Microservices
        O[Orders Service<br/>Python Lambda]
        U[Users Service<br/>Python Lambda]
        R[Restaurants Service<br/>Python Lambda]
        POS[POS Integration<br/>Python Lambda]
        S[Shared Layer<br/>Utilities]
      end
      
      subgraph Data Stores
        DDB[(DynamoDB Tables)]
      end
      
      subgraph Location Services
        LOC[AWS Location Service<br/>Geofencing]
        EB[EventBridge]
      end
    end
    
    C -->|Trigger Geofence| LOC
    LOC -->|Event| EB
    EB -->|Dispatch El

Diagram source rendered with mermaid.js.

Built with
  • Python
  • The tech stack includes JavaScript, TypeScript, and Python as programming languages.
  • The tech stack includes React and React Native as frameworks.
  • The tech stack includes AWS SDK, DynamoDB, and pytest as libraries.
  • The tech stack includes AWS SAM, API Gateway, Cognito, and CloudWatch as tools.

Verified facts

  • The tech stack includes JavaScript, TypeScript, and Python as programming languages.from code
    Evidence
    Frontend: React, React Native, TypeScript; Backend: Python 3.11

    Source: README

  • The tech stack includes React and React Native as frameworks.from code
    Evidence
    Frontend: React, React Native

    Source: README

  • The tech stack includes AWS SDK, DynamoDB, and pytest as libraries.from code
    Evidence
    Backend: Python 3.11, AWS Lambda, DynamoDB

    Source: README

  • The tech stack includes AWS SAM, API Gateway, Cognito, and CloudWatch as tools.from code
    Evidence
    Infrastructure: AWS SAM, API Gateway, Cognito, S3, CloudFront, CloudWatch

    Source: README

  • The architecture type is microservice.from code
    Evidence
    Architecture: Microservices

    Source: README

  • The architecture pattern is layered.from code
    Evidence
    Architecture: Layered

    Source: README

  • The directory structure includes separate services for orders, users, and restaurants.from code
    Evidence
    Directory Structure: services/ → Backend Microservices, orders/, users/, restaurants/

    Source: README

  • AWS Lambda is used for backend services.from code
    Evidence
    AWS Lambda for backend services.

    Source: README

View repository ↗