# jth0809/aws_free_tier_microservice architecture

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

- Interactive diagram: https://gitdiagram.com/jth0809/aws_free_tier_microservice
- Repository: https://github.com/jth0809/aws_free_tier_microservice

## Overview

##### Main Components
- Budget Service (handles budgeting functionalities)
- Cache Service (manages caching operations)
- Edge Service (likely acts as an API gateway, interfacing with clients and forwarding requests)
- Location Service (manages travel or location-based operations)
- Member Service (handles user or member management)
- Post Service (manages posts, comments, and related content)
- Orchestration Service (coordinates multi-service transactions, ensuring data integrity)
- Supporting Infrastructure:
- Nginx: As a reverse proxy to route external requests to the respective services.
- Docker-Compose: Indicates the containerization and simplified local deployment orchestration tool.
- (Optional) AWS Components: Include AWS Free Tier services if needed, or mark that the services are deployed on an AWS environment.
- (Future Scope) Kubernetes: Note that a future migration to Kubernetes is planned.

##### Relationships and Interactions
- Possible asynchronous messaging flows (e.g., RabbitMQ references from the README) for tasks like content validation or cross-service events.

##### Architectural Patterns and Key Technologies
- Microservices Architecture: Emphasize independent deployability and separation of concerns.
- API Gateway: With the Edge Service and Nginx acting together to manage external communication.
- Containerization: All services are containerized using Docker, managed via Docker-Compose.
- Security & Configuration: Note that each service has its own security configuration (e.g., SecurityConfig classes in multiple modules) and that environment configuration is managed via the .env file.
- Messaging: There is a messaging package in several services (e.g., BudgetFunctions, PostFunctions, TransactionFunctions) indicating use of event-driven or messaging patterns.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Client["Client"]:::client
    Nginx["Nginx (Reverse Proxy)"]:::entry
    Edge["Edge Service"]:::entry

    subgraph "Microservices"
        Budget["Budget Service"]:::micro
        Cache["Cache Service"]:::micro
        Location["Location Service"]:::micro
        Member["Member Service"]:::micro
        Post["Post Service"]:::micro
        Orchestration["Orchestration Service"]:::micro
    end

    subgraph "Infrastructure"
        DockerCompose["Docker-Compose"]:::infra
        AWS["AWS Free Tier Environment"]:::infra
        Kubernetes["Kubernetes (Planned)"]:::note
    end

    Client -->|"request"| Nginx
    Nginx -->|"forwards"| Edge

    Edge -->|"calls"| Budget
    Edge -->|"calls"| Cache
    Edge -->|"calls"| Location
    Edge -->|"calls"| Member
    Edge -->|"calls"| Post
    Edge -->|"calls"| Orchestration

    Orchestration -->|"coordinates"| Budget
    Orchestration -->|"coordinates"| Cache
    Orchestration -->|"coordinates"| Location
    Orchestration -->|"coordinates"| Member
    Orchestration -->|"coordinates"| Post

    DockerCompose ---|"containerizes"| Edge
    DockerCompose ---|"containerizes"| Budget
    DockerCompose ---|"containerizes"| Cache
    DockerCompose ---|"containerizes"| Location
    DockerCompose ---|"containerizes"| Member
    DockerCompose ---|"containerizes"| Post
    DockerCompose ---|"containerizes"| Orchestration

    AWS ---|"hosts"| DockerCompose
    Kubernetes ---|"future_migration"| AWS

    click Budget "https://github.com/jth0809/aws_free_tier_microservice/tree/main/budget/src/main/java/com/easy/budget/"
    click Cache "https://github.com/jth0809/aws_free_tier_microservice/tree/main/cache/src/main/java/com/cache/service/"
    click Edge "https://github.com/jth0809/aws_free_tier_microservice/tree/main/edge/src/main/java/com/easy/edge/"
    click Location "https://github.com/jth0809/aws_free_tier_microservice/tree/main/location/src/main/java/com/easy/location/"
    click Member "https://github.com/jth0809/aws_free_tier_microservice/tree/main/member/src/main/java/com/easy/member/"
    click Orchestration "https://github.com/jth0809/aws_free_tier_microservice/tree/main/orchestration/src/main/java/com/transaction/orchestration/"
    click Post "https://github.com/jth0809/aws_free_tier_microservice/tree/main/post/src/main/java/com/easy/post/"
    click Nginx "https://github.com/jth0809/aws_free_tier_microservice/tree/main/nginx/"
    click DockerCompose "https://github.com/jth0809/aws_free_tier_microservice/blob/main/docker-compose.yml"

    classDef client fill:#FDEBD0,stroke:#CA6F1E,stroke-width:2px;
    classDef entry fill:#AED6F1,stroke:#154360,stroke-width:2px;
    classDef micro fill:#F9E79F,stroke:#7D6608,stroke-width:2px;
    classDef infra fill:#D5F5E3,stroke:#239B56,stroke-width:2px;
    classDef note fill:#F4ECF7,stroke:#76448A,stroke-width:2px;
```
