# juan-beltran0518/arepserverarchitectures architecture

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

- Interactive diagram: https://gitdiagram.com/juan-beltran0518/arepserverarchitectures
- Repository: https://github.com/juan-beltran0518/arepserverarchitectures

## Overview

##### Project type and purpose
- This is a lightweight, full-stack Java web server with a custom IoC (Inversion of Control) framework.
- Purpose: serve static assets (HTML/JS/CSS/images) and dynamic content via annotated POJO controllers using reflection.

##### File structure
- Top level:
· pom.xml + run.sh – build and startup scripts (Maven build).
· src/main/java/com/edu/esuelaing/arep/ – core packages:
– annotations/ – custom annotations (@RestController, @GetMapping, etc.).
– controllers/ – GreetingController, HelloController (business logic).
– ioc/ – BeanContainer, ReflectionLoader, MicroSpringBoot (IoC container & bootstrap).
– SimpleHttpServer, Request, RouteHandler, Main – HTTP server core + request routing.
· src/main/resources/public/ – static assets (index.html, app.js, style.css, images).
· src/test – unit tests for IoC and HTTP server.

##### README for additional insights
- Confirms:
- serves HTML and PNG, handles non-concurrent requests
- custom IoC container loads annotated classes by reflection
- routing defined by @GetMapping/@PostMapping
- No external DB; purely in-memory and file resources.

## Diagram (Mermaid)

```mermaid
flowchart TD
    client["Client (Browser)"]:::client

    subgraph "Build & Bootstrap"
        pom["pom.xml"]:::artifact
        runSh["run.sh"]:::artifact
        Main["Main"]:::ioc
        MicroSpringBoot["MicroSpringBoot"]:::ioc
        ReflectionLoader["ReflectionLoader"]:::ioc
        BeanContainer["BeanContainer"]:::ioc
    end

    client -->|"start app"| runSh
    runSh -->|"mvn exec"| Main
    Main -->|"bootstrap"| MicroSpringBoot
    MicroSpringBoot -->|"scan annotations"| ReflectionLoader
    ReflectionLoader -->|"register beans"| BeanContainer

    subgraph "Runtime Request Flow"
        SimpleHttpServer["SimpleHttpServer"]:::httpCore
        StaticHandler["StaticResourceHandler"]:::static
        RequestObj["Request"]:::httpCore
        RouteHandler["RouteHandler"]:::httpCore
        GreetingController["GreetingController"]:::controller
        HelloController["HelloController"]:::controller
        ResponseSerializer["ResponseSerializer"]:::httpCore
        PublicAssets["/public"]:::static
    end

    Main --> SimpleHttpServer
    client -->|"HTTP Request"| SimpleHttpServer
    SimpleHttpServer -->|"if /public"| StaticHandler
    StaticHandler -->|"read file"| PublicAssets
    StaticHandler -->|"HTTP Response"| client
    SimpleHttpServer -->|"else"| RequestObj
    RequestObj -->|"parse URL"| RouteHandler
    RouteHandler -->|"get bean"| BeanContainer
    BeanContainer -->|"invoke method"| GreetingController
    BeanContainer -->|"invoke method"| HelloController
    GreetingController -->|"return data"| ResponseSerializer
    HelloController -->|"return data"| ResponseSerializer
    ResponseSerializer -->|"HTTP Response"| client

    classDef httpCore fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef ioc fill:#98FB98,stroke:#333,stroke-width:1px
    classDef controller fill:#FFA500,stroke:#333,stroke-width:1px
    classDef static fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef client fill:#F0E68C,stroke:#333,stroke-width:1px
    classDef artifact fill:#CCCCCC,stroke:#333,stroke-width:1px

    click SimpleHttpServer "https://github.com/juan-beltran0518/arepserverarchitectures/blob/main/arep-ioc-server/src/main/java/com/edu/esuelaing/arep/SimpleHttpServer.java"
    click Main "https://github.com/juan-beltran0518/arepserverarchitectures/blob/main/arep-ioc-server/src/main/java/com/edu/esuelaing/arep/Main.java"
    click RequestObj "https://github.com/juan-beltran0518/arepserverarchitectures/blob/main/arep-ioc-server/src/main/java/com/edu/esuelaing/arep/Request.java"
    click RouteHandler "https://github.com/juan-beltran0518/arepserverarchitectures/blob/main/arep-ioc-server/src/main/java/com/edu/esuelaing/arep/RouteHandler.java"
    click RestController "https://github.com/juan-beltran0518/arepserverarchitectures/blob/main/arep-ioc-server/src/main/java/com/edu/esuelaing/arep/annotations/RestController.java"
    click GetMapping "https://github.com/juan-beltran0518/arepserverarchitectures/blob/main/arep-ioc-server/src/main/java/com/edu/esuelaing/arep/annotations/GetMapping.java"
    click PostMapping "https://github.com/juan-beltran0518/arepserverarchitectures/blob/main/arep-ioc-server/src/main/java/com/edu/esuelaing/arep/annotations/PostMapping.java"
    click RequestParam "https://github.com/juan-beltran0518/arepserverarchitectures/blob/main/arep-ioc-server/src/main/java/com/edu/esuelaing/arep/annotations/RequestParam.java"
    click MicroSpringBoot "https://github.com/juan-beltran0518/arepserverarchitectures/blob/main/arep-ioc-server/src/main/java/com/edu/esuelaing/arep/ioc/MicroSpringBoot.java"
    click ReflectionLoader "https://github.com/juan-beltran0518/arepserverarchitectures/blob/main/arep-ioc-server/src/main/java/com/edu/esuelaing/arep/ioc/ReflectionLoader.java"
    click BeanContainer "https://github.com/juan-beltran0518/arepserverarchitectures/blob/main/arep-ioc-server/src/main/java/com/edu/esuelaing/arep/ioc/BeanContainer.java"
    click GreetingController "https://github.com/juan-beltran0518/arepserverarchitectures/blob/main/arep-ioc-server/src/main/java/com/edu/esuelaing/arep/controllers/GreetingController.java"
    click HelloController "https://github.com/juan-beltran0518/arepserverarchitectures/blob/main/arep-ioc-server/src/main/java/com/edu/esuelaing/arep/controllers/HelloController.java"
    click PublicAssets "https://github.com/juan-beltran0518/arepserverarchitectures/tree/main/arep-ioc-server/src/main/resources/public"
    click pom "https://github.com/juan-beltran0518/arepserverarchitectures/blob/main/arep-ioc-server/pom.xml"
    click runSh "https://github.com/juan-beltran0518/arepserverarchitectures/blob/main/arep-ioc-server/run.sh"
```
