# kanaami04/recipe_management architecture

> Architecture diagram of the GitHub repository kanaami04/recipe_management, 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/kanaami04/recipe_management
- Repository: https://github.com/kanaami04/recipe_management

## Overview

This repository implements a recipe-management web application: users can manage recipes and labels, accounts, sharing groups, and shopping lists. The frontend includes manual and URL-based recipe entry; the backend provides authentication and API capabilities, with PostgreSQL and S3-compatible avatar storage. The sampled source supports the recipe-form component relationships, authentication client behavior, and infrastructure wiring, but does not expose most handler-to-service calls. Those API relationships are therefore not inferred.

Main entry points: [`frontend/src/features/recipes/components/RecipeForm.tsx`](https://github.com/kanaami04/recipe_management/blob/main/frontend/src/features/recipes/components/RecipeForm.tsx) (Recipe form), [`infra/lib/recipe-stack.ts`](https://github.com/kanaami04/recipe_management/blob/main/infra/lib/recipe-stack.ts) (AWS application stack), [`api/main.go`](https://github.com/kanaami04/recipe_management/blob/main/api/main.go) (HTTP server entry), [`frontend/src/shared/auth/authClient.ts`](https://github.com/kanaami04/recipe_management/blob/main/frontend/src/shared/auth/authClient.ts) (Authentication client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_web_routes["Application routes<br/>[routes.ts]"]
  node_recipe_form["Recipe form<br/>[RecipeForm.tsx]"]
  node_recipe_inputs["Recipe input fields"]
  node_recipe_steps["Recipe steps input"]
  node_recipe_source["Recipe source input"]
  node_recipe_select["Recipe selectors<br/>[SelectInput.tsx]"]
  node_recipe_multiselect["Recipe labels input"]
  node_auth_client["Authentication client<br/>[authClient.ts]"]
  node_token_store["Access token store<br/>[tokenStore.ts]"]
  node_csrf["CSRF header<br/>[csrf.ts]"]
  node_api_client["Generated API client setup<br/>[client.ts]"]
  node_query_cache["Query cache<br/>[queryClient.ts]"]
end

subgraph group_api["API runtime"]
  node_api_entry["HTTP server entry<br/>[main.go]"]
  node_app_wiring["Application wiring<br/>[app.go]"]
  node_auth_handler["Authentication endpoints<br/>[auth_handler.go]"]
  node_recipe_handler["Recipe endpoints<br/>[recipe_handler.go]"]
  node_sharing["Sharing capabilities"]
  node_shopping["Shopping lists"]
  node_account_handler["Account endpoints<br/>[user_handler.go]"]
end

subgraph group_data["Domain and storage"]
  node_domain["Recipe and account domain"]
  node_repositories["Persistence repositories"]
  node_database[("PostgreSQL database<br/>[database.go]")]
  node_avatar_storage["Avatar storage<br/>[avatar_storage.go]"]
  node_s3[("S3-compatible service")]
end

subgraph group_infra["AWS deployment"]
  node_infra_stack["AWS application stack<br/>[recipe-stack.ts]"]
  node_infra_entry["Infrastructure entry<br/>[infra.ts]"]
  node_lambda["API Lambda"]
  node_web_bucket[("Static asset bucket")]
  node_avatar_bucket[("Avatar bucket")]
  node_cloudfront["CloudFront distribution"]
end

node_user(("User"))

node_user -.->|"opens app"| node_web_routes
node_recipe_form -->|"renders"| node_recipe_inputs
node_recipe_form -->|"renders"| node_recipe_steps
node_recipe_form -->|"renders"| node_recipe_source
node_recipe_form -->|"renders"| node_recipe_select
node_recipe_form -->|"renders"| node_recipe_multiselect
node_auth_client -->|"updates tokens"| node_token_store
node_auth_client -->|"sets header"| node_csrf
node_api_entry -->|"creates app"| node_app_wiring
node_api_entry -->|"connects and migrates"| node_database
node_api_entry -->|"creates client"| node_s3
node_infra_entry -->|"instantiates"| node_infra_stack
node_infra_stack -->|"configures"| node_lambda
node_infra_stack -->|"creates and deploys assets"| node_web_bucket
node_infra_stack -->|"creates and grants access"| node_avatar_bucket
node_infra_stack -->|"routes requests"| node_cloudfront
node_lambda -->|"uploads and deletes"| node_avatar_bucket
node_cloudfront -->|"serves SPA"| node_web_bucket
node_cloudfront -->|"forwards API requests"| node_lambda
node_cloudfront -->|"serves avatars"| node_avatar_bucket

click node_web_routes "https://github.com/kanaami04/recipe_management/blob/main/frontend/src/routes.ts"
click node_recipe_form "https://github.com/kanaami04/recipe_management/blob/main/frontend/src/features/recipes/components/RecipeForm.tsx"
click node_recipe_inputs "https://github.com/kanaami04/recipe_management/blob/main/frontend/src/features/recipes/components/RecipeInputForm.tsx"
click node_recipe_steps "https://github.com/kanaami04/recipe_management/blob/main/frontend/src/features/recipes/components/RecipeStepsInput.tsx"
click node_recipe_source "https://github.com/kanaami04/recipe_management/blob/main/frontend/src/features/recipes/components/RecipeSourceInput.tsx"
click node_recipe_select "https://github.com/kanaami04/recipe_management/blob/main/frontend/src/features/recipes/components/SelectInput.tsx"
click node_recipe_multiselect "https://github.com/kanaami04/recipe_management/blob/main/frontend/src/features/recipes/components/MultiSelectInput.tsx"
click node_auth_client "https://github.com/kanaami04/recipe_management/blob/main/frontend/src/shared/auth/authClient.ts"
click node_token_store "https://github.com/kanaami04/recipe_management/blob/main/frontend/src/shared/auth/tokenStore.ts"
click node_csrf "https://github.com/kanaami04/recipe_management/blob/main/frontend/src/shared/auth/csrf.ts"
click node_api_client "https://github.com/kanaami04/recipe_management/blob/main/frontend/src/shared/api/client.ts"
click node_query_cache "https://github.com/kanaami04/recipe_management/blob/main/frontend/src/shared/lib/queryClient.ts"
click node_api_entry "https://github.com/kanaami04/recipe_management/blob/main/api/main.go"
click node_app_wiring "https://github.com/kanaami04/recipe_management/blob/main/api/internal/app/app.go"
click node_auth_handler "https://github.com/kanaami04/recipe_management/blob/main/api/internal/handler/auth_handler.go"
click node_recipe_handler "https://github.com/kanaami04/recipe_management/blob/main/api/internal/handler/recipe_handler.go"
click node_sharing "https://github.com/kanaami04/recipe_management/blob/main/api/internal/handler/share_group_handler.go"
click node_shopping "https://github.com/kanaami04/recipe_management/blob/main/api/internal/handler/shopping_list_handler.go"
click node_account_handler "https://github.com/kanaami04/recipe_management/blob/main/api/internal/handler/user_handler.go"
click node_domain "https://github.com/kanaami04/recipe_management/tree/main/api/internal/domain"
click node_repositories "https://github.com/kanaami04/recipe_management/tree/main/api/internal/repository"
click node_database "https://github.com/kanaami04/recipe_management/blob/main/api/internal/database/database.go"
click node_avatar_storage "https://github.com/kanaami04/recipe_management/blob/main/api/internal/storage/avatar_storage.go"
click node_infra_stack "https://github.com/kanaami04/recipe_management/blob/main/infra/lib/recipe-stack.ts"
click node_infra_entry "https://github.com/kanaami04/recipe_management/blob/main/infra/bin/infra.ts"

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_web_routes,node_recipe_form,node_recipe_inputs,node_recipe_steps,node_recipe_source,node_recipe_select,node_recipe_multiselect,node_auth_client,node_token_store,node_csrf,node_api_client,node_query_cache,node_user toneBlue
class node_api_entry,node_app_wiring,node_auth_handler,node_recipe_handler,node_sharing,node_shopping,node_account_handler toneAmber
class node_domain,node_repositories,node_database,node_avatar_storage,node_s3 toneMint
class node_infra_stack,node_infra_entry,node_lambda,node_web_bucket,node_avatar_bucket,node_cloudfront toneRose
```

## Components

### Web application

- [Application routes](https://github.com/kanaami04/recipe_management/blob/main/frontend/src/routes.ts): `frontend/src/routes.ts`
- [Recipe form](https://github.com/kanaami04/recipe_management/blob/main/frontend/src/features/recipes/components/RecipeForm.tsx): `frontend/src/features/recipes/components/RecipeForm.tsx`
- [Recipe input fields](https://github.com/kanaami04/recipe_management/blob/main/frontend/src/features/recipes/components/RecipeInputForm.tsx): `frontend/src/features/recipes/components/RecipeInputForm.tsx`
- [Recipe steps input](https://github.com/kanaami04/recipe_management/blob/main/frontend/src/features/recipes/components/RecipeStepsInput.tsx): `frontend/src/features/recipes/components/RecipeStepsInput.tsx`
- [Recipe source input](https://github.com/kanaami04/recipe_management/blob/main/frontend/src/features/recipes/components/RecipeSourceInput.tsx): `frontend/src/features/recipes/components/RecipeSourceInput.tsx`
- [Recipe selectors](https://github.com/kanaami04/recipe_management/blob/main/frontend/src/features/recipes/components/SelectInput.tsx): `frontend/src/features/recipes/components/SelectInput.tsx`
- [Recipe labels input](https://github.com/kanaami04/recipe_management/blob/main/frontend/src/features/recipes/components/MultiSelectInput.tsx): `frontend/src/features/recipes/components/MultiSelectInput.tsx`
- [Authentication client](https://github.com/kanaami04/recipe_management/blob/main/frontend/src/shared/auth/authClient.ts): `frontend/src/shared/auth/authClient.ts`
- [Access token store](https://github.com/kanaami04/recipe_management/blob/main/frontend/src/shared/auth/tokenStore.ts): `frontend/src/shared/auth/tokenStore.ts`
- [CSRF header](https://github.com/kanaami04/recipe_management/blob/main/frontend/src/shared/auth/csrf.ts): `frontend/src/shared/auth/csrf.ts`
- [Generated API client setup](https://github.com/kanaami04/recipe_management/blob/main/frontend/src/shared/api/client.ts): `frontend/src/shared/api/client.ts`
- [Query cache](https://github.com/kanaami04/recipe_management/blob/main/frontend/src/shared/lib/queryClient.ts): `frontend/src/shared/lib/queryClient.ts`

### API runtime

- [HTTP server entry](https://github.com/kanaami04/recipe_management/blob/main/api/main.go): `api/main.go`
- [Application wiring](https://github.com/kanaami04/recipe_management/blob/main/api/internal/app/app.go): `api/internal/app/app.go`
- [Authentication endpoints](https://github.com/kanaami04/recipe_management/blob/main/api/internal/handler/auth_handler.go): `api/internal/handler/auth_handler.go`
- [Recipe endpoints](https://github.com/kanaami04/recipe_management/blob/main/api/internal/handler/recipe_handler.go): `api/internal/handler/recipe_handler.go`
- [Sharing capabilities](https://github.com/kanaami04/recipe_management/blob/main/api/internal/handler/share_group_handler.go): `api/internal/handler/share_group_handler.go`
- [Shopping lists](https://github.com/kanaami04/recipe_management/blob/main/api/internal/handler/shopping_list_handler.go): `api/internal/handler/shopping_list_handler.go`
- [Account endpoints](https://github.com/kanaami04/recipe_management/blob/main/api/internal/handler/user_handler.go): `api/internal/handler/user_handler.go`

### Domain and storage

- [Recipe and account domain](https://github.com/kanaami04/recipe_management/tree/main/api/internal/domain): `api/internal/domain`
- [Persistence repositories](https://github.com/kanaami04/recipe_management/tree/main/api/internal/repository): `api/internal/repository`
- [PostgreSQL database](https://github.com/kanaami04/recipe_management/blob/main/api/internal/database/database.go): `api/internal/database/database.go`
- [Avatar storage](https://github.com/kanaami04/recipe_management/blob/main/api/internal/storage/avatar_storage.go): `api/internal/storage/avatar_storage.go`
- **S3-compatible service**

### AWS deployment

- [AWS application stack](https://github.com/kanaami04/recipe_management/blob/main/infra/lib/recipe-stack.ts): `infra/lib/recipe-stack.ts`
- [Infrastructure entry](https://github.com/kanaami04/recipe_management/blob/main/infra/bin/infra.ts): `infra/bin/infra.ts`
- **API Lambda**
- **Static asset bucket**
- **Avatar bucket**
- **CloudFront distribution**

### Other components

- **User**

## Connections

- User → Application routes: opens app
- Recipe form → Recipe input fields: renders (evidence: `frontend/src/features/recipes/components/RecipeForm.tsx`)
- Recipe form → Recipe steps input: renders (evidence: `frontend/src/features/recipes/components/RecipeForm.tsx`)
- Recipe form → Recipe source input: renders (evidence: `frontend/src/features/recipes/components/RecipeForm.tsx`)
- Recipe form → Recipe selectors: renders (evidence: `frontend/src/features/recipes/components/RecipeForm.tsx`)
- Recipe form → Recipe labels input: renders (evidence: `frontend/src/features/recipes/components/RecipeForm.tsx`)
- Authentication client → Access token store: updates tokens (evidence: `frontend/src/shared/auth/authClient.ts`)
- Authentication client → CSRF header: sets header (evidence: `frontend/src/shared/auth/authClient.ts`)
- HTTP server entry → Application wiring: creates app (evidence: `api/main.go`)
- HTTP server entry → PostgreSQL database: connects and migrates (evidence: `api/main.go`)
- HTTP server entry → S3-compatible service: creates client (evidence: `api/main.go`)
- Infrastructure entry → AWS application stack: instantiates (evidence: `infra/bin/infra.ts`)
- AWS application stack → API Lambda: configures (evidence: `infra/lib/recipe-stack.ts`)
- AWS application stack → Static asset bucket: creates and deploys assets (evidence: `infra/lib/recipe-stack.ts`)
- AWS application stack → Avatar bucket: creates and grants access (evidence: `infra/lib/recipe-stack.ts`)
- AWS application stack → CloudFront distribution: routes requests (evidence: `infra/lib/recipe-stack.ts`)
- API Lambda → Avatar bucket: uploads and deletes
- CloudFront distribution → Static asset bucket: serves SPA
- CloudFront distribution → API Lambda: forwards API requests
- CloudFront distribution → Avatar bucket: serves avatars
