# tejassushanth/demo-java architecture

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

- Interactive diagram: https://gitdiagram.com/tejassushanth/demo-java
- Repository: https://github.com/tejassushanth/demo-java

## Overview

1. **Project type**
   - This is a **minimal Java web application** packaged as a **WAR**.
   - It is built with **Maven** and intended to run in a **servlet container** such as Tomcat or Jetty.

2. **Core application shape**
   - The runtime application is very small: one Java servlet plus JSP-based web resources.
   - Main code lives in `src/main/java/com/example/HelloServlet.java`.
   - Web entry points live in `src/main/webapp`, with `index.jsp` as the landing page.

3. **Request/response flow**
   - A browser hits the web app through the servlet container.
   - `index.jsp` serves the initial page.
   - `HelloServlet` handles backend HTTP request processing and returns a response into the web layer.
   - `WEB-INF/web.xml` is the deployment descriptor that defines servlet wiring and URL mapping.

4. **Web layer boundary**
   - `src/main/webapp` is the presentation boundary for the app.
   - `WEB-INF/web.xml` keeps deployment configuration private to the server.
   - `index.jsp` is public-facing content, while the servlet is the server-side logic endpoint.

5. **Build and packaging**
   - `pom.xml` drives compilation, packaging, and dependency management.
   - The output artifact is `target/my-java-app-1.0-SNAPSHOT.war`.
   - The exploded WAR under `target/my-java-app-1.0-SNAPSHOT/` shows the final deployable structure that a servlet container would load.

6. **Generated build outputs**
   - Everything under `target/` is generated and not source-of-truth.
   - It contains compiled classes, Maven metadata, and the expanded WAR layout.
   - For an architecture diagram, this is the build output boundary between source and deployable artifact.

7. **Automation and CI/CD**
   - The repository includes a `Jenkinsfile`, so Jenkins is part of the delivery pipeline.
   - `.github/workflows/sonarbuild.yml` indicates GitHub Actions is also used for automated build/quality checks.
   - The README mentions webhook-triggered push deployment, sudo-based deployment, and email completion notifications, so the pipeline likely includes deployment and notification steps beyond just compilation.

8. **Local/operational script**
   - `run.sh` is likely the local start or convenience script for running the app or container.
   - This suggests a manual execution path in addition to CI/CD automation.

9. **Technology boundaries**
   - **Java + Servlet/JSP** define the application runtime model.
   - **Maven** defines the build/package model.
   - **Jenkins / GitHub Actions / Sonar** define the delivery and quality gates.
   - The actual production runtime boundary is the servlet container that consumes the WAR.

10. **What is not present**
   - There is no evidence of a database, message broker, REST API layer, or separate frontend framework.
   - The architecture is intentionally simple: a single-module server-rendered Java web app with CI/CD around it.

11. **How to draw it**
   - Show three main zones: **source code**, **CI/CD pipeline**, and **deployable WAR/runtime**.
   - Inside source code, place `HelloServlet`, `index.jsp`, and `web.xml`.
   - On the pipeline side, place Maven build, Sonar/quality checks, Jenkins/GitHub Actions, deployment, and email notification.
   - On the runtime side, show the WAR deployed to a servlet container serving browser requests.

Main entry points: [`pom.xml`](https://github.com/tejassushanth/demo-java/blob/main/pom.xml) (pom.xml), [`target/my-java-app-1.0-SNAPSHOT`](https://github.com/tejassushanth/demo-java/blob/main/target/my-java-app-1.0-SNAPSHOT) (Deployed app), [`Jenkinsfile`](https://github.com/tejassushanth/demo-java/tree/main/Jenkinsfile) (Jenkinsfile), [`target/my-java-app-1.0-SNAPSHOT.war`](https://github.com/tejassushanth/demo-java/blob/main/target/my-java-app-1.0-SNAPSHOT.war) (WAR artifact)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_source["Source code"]
  node_pom["pom.xml<br/>maven build<br/>[pom.xml]"]
  node_hello_servlet["HelloServlet<br/>[HelloServlet.java]"]
  node_index_jsp["index.jsp<br/>jsp view<br/>[index.jsp]"]
  node_web_xml["web.xml<br/>deployment descriptor<br/>[web.xml]"]
  node_webapp["Web app<br/>web resources"]
  node_java_src["Java source<br/>app code"]
end

subgraph group_build["Build output"]
  node_target_war[("WAR artifact<br/>deployable war")]
  node_exploded_war["Exploded WAR<br/>deploy layout"]
  node_target_classes["Compiled classes<br/>build output"]
  node_maven_meta["Maven meta<br/>build metadata"]
  node_maven_status["Compiler status<br/>build metadata"]
end

subgraph group_pipeline["CI/CD"]
  node_jenkinsfile["Jenkinsfile<br/>jenkins pipeline"]
  node_gha["Sonar workflow<br/>github actions<br/>[sonarbuild.yml]"]
  node_run_sh["run.sh<br/>run script<br/>[run.sh]"]
end

subgraph group_runtime["Runtime"]
  node_browser(("Browser<br/>client"))
  node_container["Servlet container<br/>runtime host"]
  node_deployed_app["Deployed app<br/>webapp runtime"]
end

node_browser -->|"HTTP request"| node_container
node_container -->|"loads WAR"| node_deployed_app
node_deployed_app -->|"serves page"| node_index_jsp
node_deployed_app -->|"dispatches to"| node_hello_servlet
node_web_xml -->|"maps servlet"| node_hello_servlet
node_webapp -->|"contains"| node_index_jsp
node_webapp -->|"contains"| node_web_xml
node_java_src -->|"contains"| node_hello_servlet
node_pom -->|"packages"| node_target_war
node_pom -->|"compiles"| node_target_classes
node_pom -->|"archives"| node_maven_meta
node_pom -->|"tracks"| node_maven_status
node_target_war -->|"expands to"| node_exploded_war
node_exploded_war -->|"deployed as"| node_deployed_app
node_jenkinsfile -->|"runs build"| node_pom
node_gha -->|"runs build"| node_pom
node_jenkinsfile -->|"publishes"| node_target_war
node_jenkinsfile -->|"deploys"| node_deployed_app
node_gha -->|"checks quality"| node_maven_status
node_run_sh -->|"starts"| node_container

click node_pom "https://github.com/tejassushanth/demo-java/blob/main/pom.xml"
click node_hello_servlet "https://github.com/tejassushanth/demo-java/blob/main/src/main/java/com/example/HelloServlet.java"
click node_index_jsp "https://github.com/tejassushanth/demo-java/blob/main/src/main/webapp/index.jsp"
click node_web_xml "https://github.com/tejassushanth/demo-java/blob/main/src/main/webapp/WEB-INF/web.xml"
click node_webapp "https://github.com/tejassushanth/demo-java/tree/main/src/main/webapp"
click node_java_src "https://github.com/tejassushanth/demo-java/tree/main/src/main/java"
click node_jenkinsfile "https://github.com/tejassushanth/demo-java/tree/main/Jenkinsfile"
click node_gha "https://github.com/tejassushanth/demo-java/blob/main/.github/workflows/sonarbuild.yml"
click node_run_sh "https://github.com/tejassushanth/demo-java/blob/main/run.sh"
click node_target_war "https://github.com/tejassushanth/demo-java/blob/main/target/my-java-app-1.0-SNAPSHOT.war"
click node_exploded_war "https://github.com/tejassushanth/demo-java/blob/main/target/my-java-app-1.0-SNAPSHOT"
click node_target_classes "https://github.com/tejassushanth/demo-java/tree/main/target/classes"
click node_maven_meta "https://github.com/tejassushanth/demo-java/tree/main/target/maven-archiver"
click node_maven_status "https://github.com/tejassushanth/demo-java/tree/main/target/maven-status"
click node_deployed_app "https://github.com/tejassushanth/demo-java/blob/main/target/my-java-app-1.0-SNAPSHOT"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_pom,node_hello_servlet,node_index_jsp,node_web_xml,node_webapp,node_java_src toneBlue
class node_target_war,node_exploded_war,node_target_classes,node_maven_meta,node_maven_status toneAmber
class node_jenkinsfile,node_gha,node_run_sh toneMint
class node_browser,node_container,node_deployed_app toneRose
```

## Components

### Source code

Authoritative application source and web resources.

- [pom.xml](https://github.com/tejassushanth/demo-java/blob/main/pom.xml): maven build · Maven project definition for compilation, packaging, and dependencies. · `pom.xml`
- [HelloServlet](https://github.com/tejassushanth/demo-java/blob/main/src/main/java/com/example/HelloServlet.java): servlet · Server-side HTTP request handler. · `src/main/java/com/example/HelloServlet.java`
- [index.jsp](https://github.com/tejassushanth/demo-java/blob/main/src/main/webapp/index.jsp): jsp view · Public landing page rendered by the web layer. · `src/main/webapp/index.jsp`
- [web.xml](https://github.com/tejassushanth/demo-java/blob/main/src/main/webapp/WEB-INF/web.xml): deployment descriptor · Private servlet wiring and URL mapping configuration. · `src/main/webapp/WEB-INF/web.xml`
- [Web app](https://github.com/tejassushanth/demo-java/tree/main/src/main/webapp): web resources · Presentation boundary containing JSPs and deployment metadata. · `src/main/webapp`
- [Java source](https://github.com/tejassushanth/demo-java/tree/main/src/main/java): app code · Main Java application source tree. · `src/main/java`

### Build output

Generated Maven artifacts and exploded WAR layout.

- [WAR artifact](https://github.com/tejassushanth/demo-java/blob/main/target/my-java-app-1.0-SNAPSHOT.war): deployable war · Packaged application artifact produced by Maven. · `target/my-java-app-1.0-SNAPSHOT.war`
- [Exploded WAR](https://github.com/tejassushanth/demo-java/blob/main/target/my-java-app-1.0-SNAPSHOT): deploy layout · Expanded deployable structure used by servlet containers. · `target/my-java-app-1.0-SNAPSHOT`
- [Compiled classes](https://github.com/tejassushanth/demo-java/tree/main/target/classes): build output · Compiled Java bytecode generated during the build. · `target/classes`
- [Maven meta](https://github.com/tejassushanth/demo-java/tree/main/target/maven-archiver): build metadata · Archived Maven packaging metadata. · `target/maven-archiver`
- [Compiler status](https://github.com/tejassushanth/demo-java/tree/main/target/maven-status): build metadata · Maven compiler plugin tracking files and inputs. · `target/maven-status`

### CI/CD

Automation for build, quality, deployment, and notifications.

- [Jenkinsfile](https://github.com/tejassushanth/demo-java/tree/main/Jenkinsfile): jenkins pipeline · Jenkins delivery pipeline definition. · `Jenkinsfile`
- [Sonar workflow](https://github.com/tejassushanth/demo-java/blob/main/.github/workflows/sonarbuild.yml): github actions · GitHub Actions workflow for automated build and quality checks. · `.github/workflows/sonarbuild.yml`
- [run.sh](https://github.com/tejassushanth/demo-java/blob/main/run.sh): run script · Local convenience script for manual execution or startup. · `run.sh`

### Runtime

Servlet-container deployment and request handling.

- **Browser**: client · User request source entering the web application.
- **Servlet container**: runtime host · Tomcat or Jetty-style container that loads the WAR.
- [Deployed app](https://github.com/tejassushanth/demo-java/blob/main/target/my-java-app-1.0-SNAPSHOT): webapp runtime · WAR deployed and expanded inside the servlet container. · `target/my-java-app-1.0-SNAPSHOT`

## Connections

- Browser → Servlet container: HTTP request · Browser traffic enters the servlet container.
- Servlet container → Deployed app: loads WAR · The container consumes the packaged application for deployment.
- Deployed app → index.jsp: serves page · The deployed webapp exposes the landing page.
- Deployed app → HelloServlet: dispatches to · Servlet mappings route requests to backend logic.
- web.xml → HelloServlet: maps servlet · Deployment descriptor defines servlet wiring and URL mapping.
- Web app → index.jsp: contains · Web resources include the public JSP entry point.
- Web app → web.xml: contains · Web resources include private deployment configuration.
- Java source → HelloServlet: contains · Main Java source tree holds the servlet implementation.
- pom.xml → WAR artifact: packages · Maven builds the deployable WAR artifact.
- pom.xml → Compiled classes: compiles · Maven compiles application classes into build output.
- pom.xml → Maven meta: archives · Maven writes packaging metadata during the build.
- pom.xml → Compiler status: tracks · Compiler plugin status files are generated during compilation.
- WAR artifact → Exploded WAR: expands to · The packaged WAR is expanded into deployable layout.
- Exploded WAR → Deployed app: deployed as · Expanded WAR structure matches what the container loads.
- Jenkinsfile → pom.xml: runs build · Jenkins orchestrates Maven build and packaging.
- Sonar workflow → pom.xml: runs build · GitHub Actions executes build and quality checks.
- Jenkinsfile → WAR artifact: publishes · Pipeline produces the deployable artifact.
- Jenkinsfile → Deployed app: deploys · Delivery pipeline promotes the app to runtime.
- Sonar workflow → Compiler status: checks quality · Automated workflow likely runs build and analysis gates.
- run.sh → Servlet container: starts · Local script provides a manual run path.
