# ondc-official/seller-app-sdk architecture

> Architecture diagram of the GitHub repository ondc-official/seller-app-sdk, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ondc-official/seller-app-sdk
- Repository: https://github.com/ondc-official/seller-app-sdk

## Overview

##### Project type and purpose
- This is a full-stack, microservices-based Seller App for ONDC (Open Network for Digital Commerce).
- It provides a React frontend, multiple backend microservices (Node.js and Python), and infrastructure components (Nginx, Docker, Ansible) to manage seller order fulfillment, catalog, tracking, notifications, and integration with ONDC protocol and third-party services.

##### File structure
- Top-level infra & config:
- Docker Compose files for local/dev/production (`docker-compose-for-local.yaml`, `docker-compose-with-images.yaml`, etc.)
- `bpp-nginx/` submodule: nginx config, Dockerfiles, serves the React app
- `deploying_ansible/`: Ansible playbooks and hosts for prod deployment & SSL provisioning
- `init-letsencrypt.sh`: bootstraps Let’s Encrypt certificates
- Core microservices (each a Git submodule):
- `seller-app/`: Node.js REST API handling business logic
- `seller-app-frontend/`: React UI served via Nginx
- `seller-app-protocol/`: Python service implementing ONDC protocol messaging
- `seller-app-igm/`: Node.js IGM layer for gateway interactions
- `seller-bugzilla-service/`: Node.js service for Bugzilla integration
- Ancillary artifacts: `.env.example`, `.gitmodules`, assets/

##### Key insights from README
- Microservice architecture with clear separation: frontend, API, protocol layer, gateway integration, Bugzilla integration
- External dependencies: Firebase Authentication, SMTP, AWS S3 (assets), MapMyIndia (geocoding), ONDC registry/gateway, ngrok for local tunneling
- Deploys via Docker Compose (for local) and Ansible + Docker (for staging/prod) with automated SSL

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        User["User"]:::external
        Nginx["Nginx (Reverse Proxy)"]:::frontend
        ReactApp["React App"]:::frontend
    end

    %% Application Layer
    subgraph "Application Layer"
        direction TB
        SellerAPI["seller-app (Node.js API)"]:::micro
        Protocol["seller-app-protocol (Python ONDC)"]:::micro
        IGM["seller-app-igm (Node.js IGM)"]:::micro
        BugzillaService["seller-bugzilla-service"]:::micro
    end

    %% External Services
    subgraph "External Services"
        direction TB
        Firebase["Firebase Auth"]:::external
        SMTP["SMTP Server"]:::external
        AWSS3["AWS S3"]:::external
        MapMyIndia["MapMyIndia API"]:::external
        ONDCGateway["ONDC Gateway & Registry"]:::external
        BugzillaServer["Bugzilla Server"]:::external
    end

    %% Infrastructure & Deployment
    subgraph "Infrastructure & Deployment"
        direction TB
        LocalCompose["docker-compose-for-local.yaml"]:::infra
        StagingCompose["docker-compose-without-ssl.yaml"]:::infra
        ProdCompose["docker-compose-with-images.yaml"]:::infra
        Ansible["deploying_ansible/"]:::infra
        LetsEncrypt["init-letsencrypt.sh"]:::infra
        AssetsDir["assets/"]:::infra
        EnvExample[".env.example"]:::infra
        Gitmodules[".gitmodules"]:::infra
    end

    %% Connections: Presentation
    User -->|"HTTPS"| Nginx
    Nginx -->|"Serves Static & Proxy"| ReactApp
    ReactApp -->|"API Calls (HTTPS)"| SellerAPI

    %% Connections: Application interactions
    SellerAPI <-->|"gRPC/HTTP"| Protocol
    SellerAPI <-->|"HTTP"| IGM
    SellerAPI <-->|"HTTP"| BugzillaService

    %% Connections: External integrations
    SellerAPI -->|"OAuth2"| Firebase
    SellerAPI -->|"SMTP"| SMTP
    SellerAPI -->|"S3 API"| AWSS3
    SellerAPI -->|"Geocoding"| MapMyIndia
    SellerAPI -->|"Publish/Subscribe"| ONDCGateway
    Protocol -->|"Publish/Subscribe"| ONDCGateway
    BugzillaService -->|"REST API"| BugzillaServer

    %% Connections: Infrastructure orchestration
    LocalCompose -->|"Deploys Containers"| Nginx
    LocalCompose --> SellerAPI
    LocalCompose --> Protocol
    LocalCompose --> IGM
    LocalCompose --> BugzillaService

    StagingCompose -->|"Deploys Containers"| Nginx
    StagingCompose --> SellerAPI
    StagingCompose --> Protocol
    StagingCompose --> IGM
    StagingCompose --> BugzillaService

    ProdCompose -->|"Deploys Images"| Nginx
    ProdCompose --> SellerAPI
    ProdCompose --> Protocol
    ProdCompose --> IGM
    ProdCompose --> BugzillaService

    Ansible -->|"Provision & Deploy"| ProdCompose
    Ansible --> LetsEncrypt
    LetsEncrypt --> Nginx

    AssetsDir --> AWSS3
    EnvExample --> SellerAPI
    EnvExample --> ReactApp
    Gitmodules --> SellerAPI
    Gitmodules --> Protocol
    Gitmodules --> IGM
    Gitmodules --> BugzillaService
    Gitmodules --> ReactApp

    %% Styles
    classDef frontend fill:#DAE8FC,stroke:#6C8EBF,color:#274D7E;
    classDef micro fill:#D5E8D4,stroke:#82B366,color:#274D7E;
    classDef external fill:#F8CECC,stroke:#B85450,color:#582929;
    classDef infra fill:#E1D5E7,stroke:#9673A6,color:#442C4C;

    %% Click Events
    click ReactApp "https://github.com/ondc-official/seller-app-sdk/tree/logistics-api-integration/seller-app-frontend"
    click Nginx "https://github.com/ondc-official/seller-app-sdk/tree/logistics-api-integration/bpp-nginx/"
    click SellerAPI "https://github.com/ondc-official/seller-app-sdk/tree/logistics-api-integration/seller-app/"
    click Protocol "https://github.com/ondc-official/seller-app-sdk/tree/logistics-api-integration/seller-app-protocol/"
    click IGM "https://github.com/ondc-official/seller-app-sdk/tree/logistics-api-integration/seller-app-igm/"
    click BugzillaService "https://github.com/ondc-official/seller-app-sdk/tree/logistics-api-integration/seller-bugzilla-service/"
    click LocalCompose "https://github.com/ondc-official/seller-app-sdk/blob/logistics-api-integration/docker-compose-for-local.yaml"
    click StagingCompose "https://github.com/ondc-official/seller-app-sdk/blob/logistics-api-integration/docker-compose-without-ssl.yaml"
    click ProdCompose "https://github.com/ondc-official/seller-app-sdk/blob/logistics-api-integration/docker-compose-with-images.yaml"
    click Ansible "https://github.com/ondc-official/seller-app-sdk/tree/logistics-api-integration/deploying_ansible/"
    click LetsEncrypt "https://github.com/ondc-official/seller-app-sdk/blob/logistics-api-integration/init-letsencrypt.sh"
    click AssetsDir "https://github.com/ondc-official/seller-app-sdk/tree/logistics-api-integration/assets/"
    click EnvExample "https://github.com/ondc-official/seller-app-sdk/blob/logistics-api-integration/.env.example"
    click Gitmodules "https://github.com/ondc-official/seller-app-sdk/blob/logistics-api-integration/.gitmodules"
```
