# oussamabouchikhi/udagram-microservices architecture

> Architecture diagram of the GitHub repository oussamabouchikhi/udagram-microservices, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/oussamabouchikhi/udagram-microservices
- Repository: https://github.com/oussamabouchikhi/udagram-microservices

## Overview

##### Main Components Identification

a. Frontend Layer:
- Ionic/Angular web application (udagram-frontend)
- User interface components (auth, feed, home modules)

b. Backend Layer (Microservices):
- Feed API Service (udagram-api-feed)
- Users API Service (udagram-api-users)
- Reverse Proxy (nginx)

c. External Services:
- AWS S3 for image storage
- PostgreSQL database
- AWS RDS (if using cloud database)

**[Client Tier]**

**[Load Balancer/Reverse Proxy]**

**[Microservices Tier]**

**[Data Tier]**

##### Specific Component Details

Frontend (Top Layer):
- Main Angular/Ionic application
- Modules: Auth, Feed, Home
- REST API communications

API Gateway/Reverse Proxy (Middle Layer):
- Nginx reverse proxy
- Routing logic to microservices

Microservices (Service Layer):
- Feed Service: Handles image posts and feed management
- User Service: Manages authentication and user operations
- Independent deployment units

Data Layer (Bottom Layer):
- PostgreSQL Database
- S3 Bucket for image storage
- Data flow connections

##### Infrastructure Components

Kubernetes/Docker deployment elements:
- Container boundaries
- Pod groupings
- Service definitions
- Load balancer services

##### Connection Types

Interactions:
- Load balancer routing (thick lines)

##### Additional Elements

Include:
- Environment configurations
- Security groups
- Authentication flows
- Scaling components

##### Specific Implementation Notes

- Microservice independence
- Containerized deployment
- Kubernetes orchestration
- AWS service integration
- Security boundaries

Into these sections:

- Client Layer       |

- API Gateway       |

- Microservices Layer   |

- Data Layer        |

##### Technical Details

For each service, show:
- Port numbers
- API versions
- Environment configurations
- Service dependencies

Remember to:
- Use consistent styling
- Both synchronous and asynchronous communications
- Scalability points
- Security boundaries and authentication flows

## Diagram (Mermaid)

```mermaid
graph TB
    %% Client Layer
    subgraph Client
        Frontend["Frontend Application"]:::frontend
        Auth["Auth Module"]:::frontend
        Feed["Feed Module"]:::frontend
        Home["Home Module"]:::frontend
        Frontend --> Auth
        Frontend --> Feed
        Frontend --> Home
    end

    %% API Gateway Layer
    subgraph Gateway
        Nginx["Nginx Reverse Proxy"]:::proxy
    end

    %% Microservices Layer
    subgraph Services
        FeedAPI["Feed API Service"]:::service
        UsersAPI["Users API Service"]:::service
    end

    %% Data Layer
    subgraph Data
        PostgreSQL[(PostgreSQL)]:::database
        S3[("AWS S3")]:::storage
    end

    %% Kubernetes/Docker Layer
    subgraph Deployment
        DockerConfig["Docker Configurations"]:::config
        K8sConfig["Kubernetes Deployments"]:::config
        FeedDeploy["Feed Service Deployment"]:::deployment
        UsersDeploy["Users Service Deployment"]:::deployment
        FrontDeploy["Frontend Deployment"]:::deployment
        ProxyDeploy["Reverse Proxy Deployment"]:::deployment
        EnvConfig["Environment Configurations"]:::config
        AWSConfig["AWS Configurations"]:::config
    end

    %% Connections
    Frontend --> Nginx
    Nginx --> FeedAPI
    Nginx --> UsersAPI
    FeedAPI --> PostgreSQL
    FeedAPI --> S3
    UsersAPI --> PostgreSQL

    %% Deployment Connections
    DockerConfig --> K8sConfig
    K8sConfig --> FeedDeploy
    K8sConfig --> UsersDeploy
    K8sConfig --> FrontDeploy
    K8sConfig --> ProxyDeploy
    K8sConfig --> EnvConfig
    K8sConfig --> AWSConfig

    %% Click Events
    click Frontend "https://github.com/oussamabouchikhi/udagram-microservices/tree/master/udagram-frontend/"
    click Auth "https://github.com/oussamabouchikhi/udagram-microservices/tree/master/udagram-frontend/src/app/auth/"
    click Feed "https://github.com/oussamabouchikhi/udagram-microservices/tree/master/udagram-frontend/src/app/feed/"
    click Home "https://github.com/oussamabouchikhi/udagram-microservices/tree/master/udagram-frontend/src/app/home/"
    click FeedAPI "https://github.com/oussamabouchikhi/udagram-microservices/tree/master/udagram-api-feed/"
    click UsersAPI "https://github.com/oussamabouchikhi/udagram-microservices/tree/master/udagram-api-users/"
    click Nginx "https://github.com/oussamabouchikhi/udagram-microservices/blob/master/deployment/docker/nginx.conf"
    click DockerConfig "https://github.com/oussamabouchikhi/udagram-microservices/tree/master/deployment/docker/"
    click K8sConfig "https://github.com/oussamabouchikhi/udagram-microservices/tree/master/deployment/k8s/"
    click FeedDeploy "https://github.com/oussamabouchikhi/udagram-microservices/blob/master/deployment/k8s/backend-feed-deployment.yaml"
    click UsersDeploy "https://github.com/oussamabouchikhi/udagram-microservices/blob/master/deployment/k8s/backend-user-deployment.yaml"
    click FrontDeploy "https://github.com/oussamabouchikhi/udagram-microservices/blob/master/deployment/k8s/frontend-deployment.yaml"
    click ProxyDeploy "https://github.com/oussamabouchikhi/udagram-microservices/blob/master/deployment/k8s/reverseproxy_deployment.yaml"
    click EnvConfig "https://github.com/oussamabouchikhi/udagram-microservices/blob/master/deployment/k8s/env-secret.yaml"
    click AWSConfig "https://github.com/oussamabouchikhi/udagram-microservices/blob/master/deployment/k8s/aws-secret.yaml"

    %% Styles
    classDef frontend fill:#2196F3,stroke:#1565C0,color:white
    classDef proxy fill:#FF9800,stroke:#F57C00,color:white
    classDef service fill:#4CAF50,stroke:#388E3C,color:white
    classDef database fill:#FFC107,stroke:#FFA000,color:black
    classDef storage fill:#9C27B0,stroke:#7B1FA2,color:white
    classDef config fill:#607D8B,stroke:#455A64,color:white
    classDef deployment fill:#795548,stroke:#5D4037,color:white
```
