# thurpe/recipes architecture

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

- Interactive diagram: https://gitdiagram.com/thurpe/recipes
- Repository: https://github.com/thurpe/recipes

## Overview

This is a Rails recipe-and-chef web application: visitors browse recipes, create or update recipes, like them, and register or manage chef profiles. Routes dispatch requests to controllers, which load or mutate domain records. The supplied excerpts document those controller actions and route mappings; model internals and views are not included, so persistence details are shown only at the model/database boundary.

Main entry points: [`config/routes.rb`](https://github.com/thurpe/recipes/blob/master/config/routes.rb) (Routes), [`app/controllers/recipes_controller.rb`](https://github.com/thurpe/recipes/blob/master/app/controllers/recipes_controller.rb) (Recipes controller), [`app/models/chef.rb`](https://github.com/thurpe/recipes/blob/master/app/models/chef.rb) (Chef records), [`db/schema.rb`](https://github.com/thurpe/recipes/blob/master/db/schema.rb) (Application database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web entry"]
  node_routes["Routes<br/>[routes.rb]"]
  node_pages["Pages controller"]
end

subgraph group_recipes["Recipe activity"]
  node_recipes_controller["Recipes controller"]
end

subgraph group_chefs["Chef profiles"]
  node_chefs_controller["Chefs controller"]
end

subgraph group_persistence["Domain storage"]
  node_recipe["Recipe records<br/>[recipe.rb]"]
  node_chef["Chef records<br/>[chef.rb]"]
  node_like["Like records<br/>[like.rb]"]
  node_database[("Application database<br/>[schema.rb]")]
end

node_visitor(("Visitor"))

node_visitor -->|"sends request"| node_routes
node_routes -->|"dispatches pages"| node_pages
node_routes -->|"dispatches recipes"| node_recipes_controller
node_routes -->|"dispatches chefs"| node_chefs_controller
node_recipes_controller -->|"finds and saves"| node_recipe
node_recipes_controller -->|"looks up chef"| node_chef
node_recipes_controller -->|"creates like"| node_like
node_chefs_controller -->|"finds and saves"| node_chef
node_recipe -->|"persists records"| node_database
node_chef -->|"persists records"| node_database
node_like -->|"persists records"| node_database

click node_routes "https://github.com/thurpe/recipes/blob/master/config/routes.rb"
click node_pages "https://github.com/thurpe/recipes/blob/master/app/controllers/pages_controller.rb"
click node_recipes_controller "https://github.com/thurpe/recipes/blob/master/app/controllers/recipes_controller.rb"
click node_chefs_controller "https://github.com/thurpe/recipes/blob/master/app/controllers/chefs_controller.rb"
click node_recipe "https://github.com/thurpe/recipes/blob/master/app/models/recipe.rb"
click node_chef "https://github.com/thurpe/recipes/blob/master/app/models/chef.rb"
click node_like "https://github.com/thurpe/recipes/blob/master/app/models/like.rb"
click node_database "https://github.com/thurpe/recipes/blob/master/db/schema.rb"

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_routes,node_pages toneBlue
class node_recipes_controller toneAmber
class node_chefs_controller toneMint
class node_recipe,node_chef,node_like,node_database toneRose
class node_visitor toneIndigo
```

## Components

### Web entry

- [Routes](https://github.com/thurpe/recipes/blob/master/config/routes.rb): `config/routes.rb`
- [Pages controller](https://github.com/thurpe/recipes/blob/master/app/controllers/pages_controller.rb): `app/controllers/pages_controller.rb`

### Recipe activity

- [Recipes controller](https://github.com/thurpe/recipes/blob/master/app/controllers/recipes_controller.rb): `app/controllers/recipes_controller.rb`

### Chef profiles

- [Chefs controller](https://github.com/thurpe/recipes/blob/master/app/controllers/chefs_controller.rb): `app/controllers/chefs_controller.rb`

### Domain storage

- [Recipe records](https://github.com/thurpe/recipes/blob/master/app/models/recipe.rb): `app/models/recipe.rb`
- [Chef records](https://github.com/thurpe/recipes/blob/master/app/models/chef.rb): `app/models/chef.rb`
- [Like records](https://github.com/thurpe/recipes/blob/master/app/models/like.rb): `app/models/like.rb`
- [Application database](https://github.com/thurpe/recipes/blob/master/db/schema.rb): `db/schema.rb`

### Other components

- **Visitor**

## Connections

- Visitor → Routes: sends request
- Routes → Pages controller: dispatches pages
- Routes → Recipes controller: dispatches recipes
- Routes → Chefs controller: dispatches chefs
- Recipes controller → Recipe records: finds and saves
- Recipes controller → Chef records: looks up chef
- Recipes controller → Like records: creates like
- Chefs controller → Chef records: finds and saves
- Recipe records → Application database: persists records
- Chef records → Application database: persists records
- Like records → Application database: persists records
