# metatheory-res/javabackend architecture

> Architecture diagram of the GitHub repository metatheory-res/javabackend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/metatheory-res/javabackend
- Repository: https://github.com/metatheory-res/javabackend

## Overview

Moby-Games is a Java EE online game-purchasing site, with JSP pages and Java servlets and MySQL persistence. The intended user journey is browsing games, adding selections to a cart, and placing an order; the tree also shows account registration, login, history, contact, and administrative features. The sampled code confirms login validation and registration persistence, but most purchasing, history, and administration handlers were not excerpted, so those connections are shown only as unverified. The README describes the product at a high level and does not document detailed routing.

Main entry points: [`src/AdminLoginServlet.java`](https://github.com/metatheory-res/javabackend/blob/master/src/AdminLoginServlet.java) (Admin login), [`src/UserImp.java`](https://github.com/metatheory-res/javabackend/blob/master/src/UserImp.java) (Registration persistence), [`src/LoginServlet.java`](https://github.com/metatheory-res/javabackend/blob/master/src/LoginServlet.java) (User login), [`src/LoginValidate.java`](https://github.com/metatheory-res/javabackend/blob/master/src/LoginValidate.java) (Credential check)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_storefront["Game storefront<br/>[index.jsp]"]
  node_welcome["Welcome page<br/>[Welcome.jsp]"]
  node_contact["Contact handling"]
end

subgraph group_accounts["Accounts"]
  node_loginpage["Login page<br/>[login.jsp]"]
  node_registerpage["Registration page<br/>[Registration.jsp]"]
  node_loginhandler["User login<br/>[LoginServlet.java]"]
  node_logincheck["Credential check<br/>[LoginValidate.java]"]
  node_registration["Registration handling<br/>[RegServlet.java]"]
  node_userrecord["User record<br/>[User.java]"]
  node_password["Password change<br/>[ChangePwd.java]"]
end

subgraph group_commerce["Game commerce"]
  node_cartpage["Shopping cart<br/>[Cart.jsp]"]
  node_invoice["Invoice page<br/>[invoice.jsp]"]
  node_cartflow["Cart processing<br/>[CartServlet.java]"]
  node_search["Order feedback<br/>[SearchServlet.java]"]
end

subgraph group_admin["Administration and records"]
  node_gameadmin["Game management<br/>[Addgame.java]"]
  node_adminpage["Admin dashboard<br/>[AdminDashboard.jsp]"]
  node_adminlogin["Admin login"]
  node_admincheck["Admin credential check"]
  node_adminrecord["Admin record<br/>[Admin.java]"]
  node_gamehistory["Game history"]
  node_userhistory["User history"]
  node_gameadminpage["Game administration page<br/>[Admin.jsp]"]
end

subgraph group_data["Persistence"]
  node_userwriter["Registration persistence<br/>[UserImp.java]"]
  node_dbconnection["Database connection<br/>[DBconnection.java]"]
  node_gamedb[("Gaming-site database")]
end

node_visitor(("Site visitor"))

node_visitor -.->|"browses"| node_storefront
node_visitor -.->|"signs in"| node_loginpage
node_visitor -.->|"registers"| node_registerpage
node_visitor -.->|"shops"| node_cartpage
node_loginhandler -->|"validates with"| node_logincheck
node_loginhandler -->|"forwards to"| node_welcome
node_logincheck -->|"queries users"| node_gamedb
node_registration -.->|"persists user"| node_userwriter
node_userwriter -->|"reads fields"| node_userrecord
node_userwriter -->|"gets connection"| node_dbconnection
node_dbconnection -->|"connects to"| node_gamedb
node_visitor -.->|"submits cart"| node_cartflow
node_cartflow -.->|"processes purchase"| node_gamedb
node_visitor -.->|"admin signs in"| node_adminlogin
node_adminlogin -->|"validates with"| node_admincheck
node_adminlogin -->|"forwards to"| node_adminpage
node_admincheck -->|"queries admin"| node_gamedb
node_adminpage -.->|"manages games"| node_gameadminpage
node_gameadmin -.->|"updates catalog"| node_gamedb
node_gamehistory -.->|"updates history"| node_gamedb
node_userhistory -.->|"updates history"| node_gamedb
node_visitor -.->|"sends inquiry"| node_contact
node_visitor -.->|"submits order"| node_search
node_visitor -.->|"changes password"| node_password

click node_storefront "https://github.com/metatheory-res/javabackend/blob/master/WebContent/index.jsp"
click node_welcome "https://github.com/metatheory-res/javabackend/blob/master/WebContent/Welcome.jsp"
click node_cartpage "https://github.com/metatheory-res/javabackend/blob/master/WebContent/Cart.jsp"
click node_invoice "https://github.com/metatheory-res/javabackend/blob/master/WebContent/invoice.jsp"
click node_loginpage "https://github.com/metatheory-res/javabackend/blob/master/WebContent/login.jsp"
click node_registerpage "https://github.com/metatheory-res/javabackend/blob/master/WebContent/Registration.jsp"
click node_loginhandler "https://github.com/metatheory-res/javabackend/blob/master/src/LoginServlet.java"
click node_logincheck "https://github.com/metatheory-res/javabackend/blob/master/src/LoginValidate.java"
click node_registration "https://github.com/metatheory-res/javabackend/blob/master/src/RegServlet.java"
click node_userrecord "https://github.com/metatheory-res/javabackend/blob/master/src/User.java"
click node_userwriter "https://github.com/metatheory-res/javabackend/blob/master/src/UserImp.java"
click node_dbconnection "https://github.com/metatheory-res/javabackend/blob/master/src/DBconnection.java"
click node_cartflow "https://github.com/metatheory-res/javabackend/blob/master/src/CartServlet.java"
click node_gameadmin "https://github.com/metatheory-res/javabackend/blob/master/src/Addgame.java"
click node_adminpage "https://github.com/metatheory-res/javabackend/blob/master/WebContent/AdminDashboard.jsp"
click node_adminlogin "https://github.com/metatheory-res/javabackend/blob/master/src/AdminLoginServlet.java"
click node_admincheck "https://github.com/metatheory-res/javabackend/blob/master/src/AdminLoginValidate.java"
click node_adminrecord "https://github.com/metatheory-res/javabackend/blob/master/src/Admin.java"
click node_gamehistory "https://github.com/metatheory-res/javabackend/blob/master/src/updateProcessGameHistory.java"
click node_userhistory "https://github.com/metatheory-res/javabackend/blob/master/src/updateProcessUserHistory.java"
click node_contact "https://github.com/metatheory-res/javabackend/blob/master/src/ContactServlet.java"
click node_search "https://github.com/metatheory-res/javabackend/blob/master/src/SearchServlet.java"
click node_password "https://github.com/metatheory-res/javabackend/blob/master/src/ChangePwd.java"
click node_gameadminpage "https://github.com/metatheory-res/javabackend/blob/master/WebContent/Admin.jsp"

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_storefront,node_welcome,node_contact toneBlue
class node_loginpage,node_registerpage,node_loginhandler,node_logincheck,node_registration,node_userrecord,node_password toneAmber
class node_cartpage,node_invoice,node_cartflow,node_search toneMint
class node_gameadmin,node_adminpage,node_adminlogin,node_admincheck,node_adminrecord,node_gamehistory,node_userhistory,node_gameadminpage toneRose
class node_userwriter,node_dbconnection,node_gamedb,node_visitor toneIndigo
```

## Components

### Web experience

- [Game storefront](https://github.com/metatheory-res/javabackend/blob/master/WebContent/index.jsp): `WebContent/index.jsp`
- [Welcome page](https://github.com/metatheory-res/javabackend/blob/master/WebContent/Welcome.jsp): `WebContent/Welcome.jsp`
- [Contact handling](https://github.com/metatheory-res/javabackend/blob/master/src/ContactServlet.java): `src/ContactServlet.java`

### Accounts

- [Login page](https://github.com/metatheory-res/javabackend/blob/master/WebContent/login.jsp): `WebContent/login.jsp`
- [Registration page](https://github.com/metatheory-res/javabackend/blob/master/WebContent/Registration.jsp): `WebContent/Registration.jsp`
- [User login](https://github.com/metatheory-res/javabackend/blob/master/src/LoginServlet.java): `src/LoginServlet.java`
- [Credential check](https://github.com/metatheory-res/javabackend/blob/master/src/LoginValidate.java): `src/LoginValidate.java`
- [Registration handling](https://github.com/metatheory-res/javabackend/blob/master/src/RegServlet.java): `src/RegServlet.java`
- [User record](https://github.com/metatheory-res/javabackend/blob/master/src/User.java): `src/User.java`
- [Password change](https://github.com/metatheory-res/javabackend/blob/master/src/ChangePwd.java): `src/ChangePwd.java`

### Game commerce

- [Shopping cart](https://github.com/metatheory-res/javabackend/blob/master/WebContent/Cart.jsp): `WebContent/Cart.jsp`
- [Invoice page](https://github.com/metatheory-res/javabackend/blob/master/WebContent/invoice.jsp): `WebContent/invoice.jsp`
- [Cart processing](https://github.com/metatheory-res/javabackend/blob/master/src/CartServlet.java): `src/CartServlet.java`
- [Order feedback](https://github.com/metatheory-res/javabackend/blob/master/src/SearchServlet.java): `src/SearchServlet.java`

### Administration and records

- [Game management](https://github.com/metatheory-res/javabackend/blob/master/src/Addgame.java): `src/Addgame.java`
- [Admin dashboard](https://github.com/metatheory-res/javabackend/blob/master/WebContent/AdminDashboard.jsp): `WebContent/AdminDashboard.jsp`
- [Admin login](https://github.com/metatheory-res/javabackend/blob/master/src/AdminLoginServlet.java): `src/AdminLoginServlet.java`
- [Admin credential check](https://github.com/metatheory-res/javabackend/blob/master/src/AdminLoginValidate.java): `src/AdminLoginValidate.java`
- [Admin record](https://github.com/metatheory-res/javabackend/blob/master/src/Admin.java): `src/Admin.java`
- [Game history](https://github.com/metatheory-res/javabackend/blob/master/src/updateProcessGameHistory.java): `src/updateProcessGameHistory.java`
- [User history](https://github.com/metatheory-res/javabackend/blob/master/src/updateProcessUserHistory.java): `src/updateProcessUserHistory.java`
- [Game administration page](https://github.com/metatheory-res/javabackend/blob/master/WebContent/Admin.jsp): `WebContent/Admin.jsp`

### Persistence

- [Registration persistence](https://github.com/metatheory-res/javabackend/blob/master/src/UserImp.java): `src/UserImp.java`
- [Database connection](https://github.com/metatheory-res/javabackend/blob/master/src/DBconnection.java): `src/DBconnection.java`
- **Gaming-site database**

### Other components

- **Site visitor**

## Connections

- Site visitor → Game storefront: browses (evidence: `README.md`)
- Site visitor → Login page: signs in
- Site visitor → Registration page: registers
- Site visitor → Shopping cart: shops (evidence: `README.md`)
- User login → Credential check: validates with (evidence: `src/LoginServlet.java`)
- User login → Welcome page: forwards to (evidence: `src/LoginServlet.java`)
- Credential check → Gaming-site database: queries users (evidence: `src/LoginValidate.java`)
- Registration handling → Registration persistence: persists user
- Registration persistence → User record: reads fields (evidence: `src/UserImp.java`)
- Registration persistence → Database connection: gets connection (evidence: `src/UserImp.java`)
- Database connection → Gaming-site database: connects to (evidence: `src/DBconnection.java`)
- Site visitor → Cart processing: submits cart
- Cart processing → Gaming-site database: processes purchase
- Site visitor → Admin login: admin signs in
- Admin login → Admin credential check: validates with (evidence: `src/AdminLoginServlet.java`)
- Admin login → Admin dashboard: forwards to (evidence: `src/AdminLoginServlet.java`)
- Admin credential check → Gaming-site database: queries admin (evidence: `src/AdminLoginValidate.java`)
- Admin dashboard → Game administration page: manages games
- Game management → Gaming-site database: updates catalog
- Game history → Gaming-site database: updates history
- User history → Gaming-site database: updates history
- Site visitor → Contact handling: sends inquiry
- Site visitor → Order feedback: submits order
- Site visitor → Password change: changes password
