# flash148/flash148-pep-gp-webdevproject-recipe architecture

> Architecture diagram of the GitHub repository flash148/flash148-pep-gp-webdevproject-recipe, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/flash148/flash148-pep-gp-webdevproject-recipe
- Repository: https://github.com/flash148/flash148-pep-gp-webdevproject-recipe

## Overview

This is a recipe-management web application: users register and log in, then browse, search, and manage recipes; administrators also manage ingredients. The browser pages call a Java REST API, whose controllers handle requests and whose services apply domain logic over DAO-backed H2 persistence. The README documents the main browser workflows and endpoints; sampled backend excerpts confirm recipe handling and persistence behavior. Some controller and service excerpts are incomplete, so uncertain internal call relationships are omitted.

Main entry points: [`src/main/java/com/revature/util/ConnectionUtil.java`](https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/util/ConnectionUtil.java) (DB connections), [`src/main/java/com/revature/service/RecipeService.java`](https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/service/RecipeService.java) (Recipe service), [`src/main/java/com/revature/service/IngredientService.java`](https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/service/IngredientService.java) (Ingredient service), [`src/main/resources/public/frontend/register/register-page.js`](https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/resources/public/frontend/register/register-page.js) (Registration page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web client"]
  node_register["Registration page<br/>[register-page.js]"]
  node_login["Login page<br/>[login-page.js]"]
  node_recipeui["Recipe page<br/>[recipe-page.js]"]
  node_ingredientui["Ingredient page<br/>[ingredient-page.js]"]
end

subgraph group_api["REST API"]
  node_authapi["Authentication API"]
  node_recipeapi["Recipe API"]
  node_ingredientapi["Ingredient API"]
  node_admincheck["Admin middleware"]
end

subgraph group_domain["Domain services"]
  node_authservice["Authentication"]
  node_chefservice["Chef service<br/>[ChefService.java]"]
  node_recipeservice["Recipe service<br/>[RecipeService.java]"]
  node_ingredientservice["Ingredient service"]
  node_chefmodel["Chef model<br/>[Chef.java]"]
  node_recipemodel["Recipe model<br/>[Recipe.java]"]
  node_ingredientmodel["Ingredient model<br/>[Ingredient.java]"]
  node_recipeingredient["Recipe ingredient"]
  node_page["Paged results<br/>[Page.java]"]
  node_pageoptions["Page options<br/>[PageOptions.java]"]
end

subgraph group_persistence["Persistence"]
  node_chefdao["Chef DAO<br/>[ChefDAO.java]"]
  node_recipedao["Recipe DAO<br/>[RecipeDAO.java]"]
  node_ingredientdao["Ingredient DAO<br/>[IngredientDAO.java]"]
  node_connection["DB connections"]
end

node_visitor(("User"))
node_h2[("H2 database")]

node_visitor -->|"registers"| node_register
node_register -->|"POST register"| node_authapi
node_visitor -->|"signs in"| node_login
node_login -->|"POST login"| node_authapi
node_visitor -->|"manages recipes"| node_recipeui
node_recipeui -->|"recipe requests"| node_recipeapi
node_visitor -->|"manages ingredients"| node_ingredientui
node_ingredientui -->|"ingredient requests"| node_ingredientapi
node_recipeapi -->|"calls"| node_recipeservice
node_recipeservice -->|"queries"| node_recipedao
node_ingredientservice -->|"queries"| node_ingredientdao
node_chefservice -->|"queries"| node_chefdao
node_authservice -->|"looks up chefs"| node_chefservice
node_recipedao -->|"opens connections"| node_connection
node_ingredientdao -->|"opens connections"| node_connection
node_chefdao -->|"opens connections"| node_connection
node_connection -->|"connects"| node_h2
node_recipeservice -->|"creates options"| node_pageoptions
node_ingredientservice -->|"creates options"| node_pageoptions

click node_register "https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/resources/public/frontend/register/register-page.js"
click node_login "https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/resources/public/frontend/login/login-page.js"
click node_recipeui "https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/resources/public/frontend/recipe/recipe-page.js"
click node_ingredientui "https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/resources/public/frontend/ingredients/ingredient-page.js"
click node_authapi "https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/controller/AuthenticationController.java"
click node_recipeapi "https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/controller/RecipeController.java"
click node_ingredientapi "https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/controller/IngredientController.java"
click node_admincheck "https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/util/AdminMiddleware.java"
click node_authservice "https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/service/AuthenticationService.java"
click node_chefservice "https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/service/ChefService.java"
click node_recipeservice "https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/service/RecipeService.java"
click node_ingredientservice "https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/service/IngredientService.java"
click node_chefdao "https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/dao/ChefDAO.java"
click node_recipedao "https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/dao/RecipeDAO.java"
click node_ingredientdao "https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/dao/IngredientDAO.java"
click node_connection "https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/util/ConnectionUtil.java"
click node_chefmodel "https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/model/Chef.java"
click node_recipemodel "https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/model/Recipe.java"
click node_ingredientmodel "https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/model/Ingredient.java"
click node_recipeingredient "https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/model/RecipeIngredient.java"
click node_page "https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/util/Page.java"
click node_pageoptions "https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/util/PageOptions.java"

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_register,node_login,node_recipeui,node_ingredientui,node_visitor toneBlue
class node_authapi,node_recipeapi,node_ingredientapi,node_admincheck,node_h2 toneAmber
class node_authservice,node_chefservice,node_recipeservice,node_ingredientservice,node_chefmodel,node_recipemodel,node_ingredientmodel,node_recipeingredient,node_page,node_pageoptions toneMint
class node_chefdao,node_recipedao,node_ingredientdao,node_connection toneRose
```

## Components

### Web client

- [Registration page](https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/resources/public/frontend/register/register-page.js): `src/main/resources/public/frontend/register/register-page.js`
- [Login page](https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/resources/public/frontend/login/login-page.js): `src/main/resources/public/frontend/login/login-page.js`
- [Recipe page](https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/resources/public/frontend/recipe/recipe-page.js): `src/main/resources/public/frontend/recipe/recipe-page.js`
- [Ingredient page](https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/resources/public/frontend/ingredients/ingredient-page.js): `src/main/resources/public/frontend/ingredients/ingredient-page.js`

### REST API

- [Authentication API](https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/controller/AuthenticationController.java): `src/main/java/com/revature/controller/AuthenticationController.java`
- [Recipe API](https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/controller/RecipeController.java): `src/main/java/com/revature/controller/RecipeController.java`
- [Ingredient API](https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/controller/IngredientController.java): `src/main/java/com/revature/controller/IngredientController.java`
- [Admin middleware](https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/util/AdminMiddleware.java): `src/main/java/com/revature/util/AdminMiddleware.java`

### Domain services

- [Authentication](https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/service/AuthenticationService.java): `src/main/java/com/revature/service/AuthenticationService.java`
- [Chef service](https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/service/ChefService.java): `src/main/java/com/revature/service/ChefService.java`
- [Recipe service](https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/service/RecipeService.java): `src/main/java/com/revature/service/RecipeService.java`
- [Ingredient service](https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/service/IngredientService.java): `src/main/java/com/revature/service/IngredientService.java`
- [Chef model](https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/model/Chef.java): `src/main/java/com/revature/model/Chef.java`
- [Recipe model](https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/model/Recipe.java): `src/main/java/com/revature/model/Recipe.java`
- [Ingredient model](https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/model/Ingredient.java): `src/main/java/com/revature/model/Ingredient.java`
- [Recipe ingredient](https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/model/RecipeIngredient.java): `src/main/java/com/revature/model/RecipeIngredient.java`
- [Paged results](https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/util/Page.java): `src/main/java/com/revature/util/Page.java`
- [Page options](https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/util/PageOptions.java): `src/main/java/com/revature/util/PageOptions.java`

### Persistence

- [Chef DAO](https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/dao/ChefDAO.java): `src/main/java/com/revature/dao/ChefDAO.java`
- [Recipe DAO](https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/dao/RecipeDAO.java): `src/main/java/com/revature/dao/RecipeDAO.java`
- [Ingredient DAO](https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/dao/IngredientDAO.java): `src/main/java/com/revature/dao/IngredientDAO.java`
- [DB connections](https://github.com/flash148/flash148-pep-gp-webdevproject-recipe/blob/main/src/main/java/com/revature/util/ConnectionUtil.java): `src/main/java/com/revature/util/ConnectionUtil.java`

### Other components

- **User**
- **H2 database**

## Connections

- User → Registration page: registers (evidence: `README.md`)
- Registration page → Authentication API: POST register (evidence: `README.md`)
- User → Login page: signs in (evidence: `README.md`)
- Login page → Authentication API: POST login (evidence: `README.md`)
- User → Recipe page: manages recipes (evidence: `README.md`)
- Recipe page → Recipe API: recipe requests (evidence: `README.md`)
- User → Ingredient page: manages ingredients (evidence: `README.md`)
- Ingredient page → Ingredient API: ingredient requests (evidence: `README.md`)
- Recipe API → Recipe service: calls (evidence: `src/main/java/com/revature/controller/RecipeController.java`)
- Recipe service → Recipe DAO: queries (evidence: `src/main/java/com/revature/service/RecipeService.java`)
- Ingredient service → Ingredient DAO: queries (evidence: `src/main/java/com/revature/service/IngredientService.java`)
- Chef service → Chef DAO: queries (evidence: `src/main/java/com/revature/service/ChefService.java`)
- Authentication → Chef service: looks up chefs (evidence: `src/main/java/com/revature/service/AuthenticationService.java`)
- Recipe DAO → DB connections: opens connections (evidence: `src/main/java/com/revature/dao/RecipeDAO.java`)
- Ingredient DAO → DB connections: opens connections (evidence: `src/main/java/com/revature/dao/IngredientDAO.java`)
- Chef DAO → DB connections: opens connections (evidence: `src/main/java/com/revature/dao/ChefDAO.java`)
- DB connections → H2 database: connects (evidence: `src/main/java/com/revature/util/ConnectionUtil.java`)
- Recipe service → Page options: creates options (evidence: `src/main/java/com/revature/service/RecipeService.java`)
- Ingredient service → Page options: creates options (evidence: `src/main/java/com/revature/service/IngredientService.java`)
