# odiyar-github/kids-app-swt architecture

> Architecture diagram of the GitHub repository odiyar-github/kids-app-swt, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/odiyar-github/kids-app-swt
- Repository: https://github.com/odiyar-github/kids-app-swt

## Overview

##### Project type and purpose
- This is a full-stack, microservices-based community platform (“Kids App”) for discovering and giving feedback on events.
- It consists of three main runtime services—Frontend (Angular), BFF (NestJS), Backend (Spring Boot)—plus a messaging broker (RabbitMQ) and a NoSQL store (CouchDB).

##### File structure
- Top-level “apps” folder contains three subfolders:
- apps/frontend → Angular UI
- apps/bff → NestJS Backend-for-Frontend (HTTP API + RabbitMQ client)
- apps/backend → Spring Boot microservice (business logic, CouchDB client, RabbitMQ consumer/producer)
- “libs” holds shared TypeScript modules:
- libs/amqp → common wrapper for RabbitMQ patterns
- libs/share → shared DTOs, mock data, enums used by BFF and Frontend
- Root contains docker-compose.yaml and docker/ folder for building images.
- Configuration files (.env, application.properties, tsconfig, pom.xml, etc.) indicate environment variable–driven configuration, Docker orchestration, and polyglot tech stack.

##### README for additional insights
- Architecture section confirms microservices:
- Frontend (Angular)
- BFF (NestJS) as gateway/aggregator
- Backend (Spring Boot)
- RabbitMQ for asynchronous inter-service messaging
- CouchDB for persistence
- README details interactions (e.g. BFF → RabbitMQ → Backend → CouchDB) and exposes Swagger docs on BFF.

## Diagram (Mermaid)

```mermaid
graph TD
    Compose["Docker-Compose"]:::infra
    Browser["User Browser/Mobile"]:::external
    Frontend["Angular Frontend"]:::ui
    BFF["NestJS BFF API Gateway"]:::api
    Backend["Spring Boot Backend"]:::service
    RabbitMQ["RabbitMQ Broker"]:::broker
    CouchDB["CouchDB"]:::db
    SharedAmqp["AMQP Lib"]:::lib
    SharedDto["Shared DTOs & Utilities"]:::lib
    AngularDocker["angular.dockerfile"]:::infra
    NestDocker["nest.dockerfile"]:::infra

    Compose --> Frontend
    Compose --> BFF
    Compose --> Backend
    Compose --> RabbitMQ
    Compose --> CouchDB
    Compose --> AngularDocker
    Compose --> NestDocker

    Browser -->|HTTP/HTTPS| Frontend
    Frontend -->|HTTP REST /user,/event,/feedback| BFF
    BFF -->|AMQP Publish| RabbitMQ
    RabbitMQ -->|AMQP Consume| Backend
    Backend -->|Read/Write| CouchDB
    Backend -->|AMQP Publish| RabbitMQ
    RabbitMQ -->|AMQP Consume| BFF

    SharedAmqp -.-> BFF
    SharedAmqp -.-> Backend
    SharedDto -.-> Frontend
    SharedDto -.-> BFF

    click Frontend "https://github.com/odiyar-github/kids-app-swt/tree/main/kids-app/apps/frontend"
    click BFF "https://github.com/odiyar-github/kids-app-swt/tree/main/kids-app/apps/bff"
    click Backend "https://github.com/odiyar-github/kids-app-swt/tree/main/kids-app/apps/backend"
    click SharedAmqp "https://github.com/odiyar-github/kids-app-swt/tree/main/kids-app/libs/amqp/src/lib/amqp"
    click SharedDto "https://github.com/odiyar-github/kids-app-swt/tree/main/kids-app/libs/share"
    click Compose "https://github.com/odiyar-github/kids-app-swt/blob/main/kids-app/docker-compose.yml"
    click AngularDocker "https://github.com/odiyar-github/kids-app-swt/blob/main/kids-app/docker/angular.dockerfile"
    click NestDocker "https://github.com/odiyar-github/kids-app-swt/blob/main/kids-app/docker/nest.dockerfile"
    click RabbitMqConfig "https://github.com/odiyar-github/kids-app-swt/blob/main/kids-app/apps/backend/src/main/java/com/example/demo/config/RabbitMqConfig.java"
    click RabbitMqQueueConfig "https://github.com/odiyar-github/kids-app-swt/blob/main/kids-app/apps/backend/src/main/java/com/example/demo/config/RabbitMqQueueConfig.java"
    click CouchDbConfig "https://github.com/odiyar-github/kids-app-swt/blob/main/kids-app/apps/backend/src/main/java/com/example/demo/config/CouchDbConfig.java"

    classDef ui fill:#E8F1FF,stroke:#0366d6
    classDef api fill:#E6FFEC,stroke:#28a745
    classDef service fill:#FFF5E5,stroke:#d73a49
    classDef broker fill:#FFF0EB,stroke:#FFBF47
    classDef db fill:#E8F0FE,stroke:#1F6FEB
    classDef lib fill:#F1F8FF,stroke:#6f42c1,stroke-dasharray:5 5
    classDef infra fill:#F6F8FA,stroke:#586069
    classDef external fill:#F0F0F0,stroke:#BBBBBB
```
