# beardlesshack/namesprouts_cs50 architecture

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

- Interactive diagram: https://gitdiagram.com/beardlesshack/namesprouts_cs50
- Repository: https://github.com/beardlesshack/namesprouts_cs50

## Overview

1. This repository is a small server-rendered web application built around a single Flask-style backend in `final/app.py`, with HTML templates in `final/templates` and custom styling in `final/static/styles.css`. The architecture is simple and monolithic: request handling, business logic, and persistence are centered in one Python app rather than split into separate services.

2. The core product flow is “design a name-and-flower graphic, save it, then purchase/download it.” The README makes the primary user journey explicit: sign up or log in, choose a birth month flower, enter a name, generate a design, save it, edit it later, and finally buy it for download/printing.

3. Authentication is a distinct subsystem. The presence of `login.html`, `register.html`, and `app.py` indicates a traditional username/password account model with session-based access control. This boundary separates anonymous browsing from design creation and saved-project management.

4. Design generation is the main application workflow. The app accepts user input for a name and a flower choice, then turns that input into a custom visual composition where the letters are arranged to resemble a flower stem. That generation logic is likely coordinated server-side in `app.py` and rendered through templates such as `design.html`.

5. Saved-project management is another key subsystem. The `my_projects.html` template and the SQLite database `final/namesprouts.db` imply that user designs are persisted for later retrieval and editing. This creates a data flow from form submission to database storage, then back to the UI when the user revisits their projects.

6. Purchasing/download is represented by `payments.html`. Even without seeing payment integration code, this page indicates a checkout boundary between design creation and final file delivery. Architecturally, that suggests the app marks a design as purchased and then enables download/print output rather than exposing the file immediately.

7. The persistence layer is local SQLite, not an external managed database. The bundled `namesprouts.db` file suggests the application stores users, designs, and related metadata directly in one file-based database, which keeps deployment lightweight but also ties state closely to the application instance.

8. The presentation layer is entirely template-driven. `layout.html` and `nav.html` act as shared UI structure, while `index.html`, `about.html`, `design.html`, `login.html`, `register.html`, `my_projects.html`, and `payments.html` are page-level views. This implies a classic Flask/Jinja-style server-side rendering model rather than a SPA.

9. Static assets are minimal and centralized. `final/static/styles.css` is the main frontend asset visible in the tree, so styling is handled with a shared stylesheet instead of a larger component framework. That keeps the UI layer dependent on server-rendered HTML and simple static resources.

10. The application boundary is narrow: browser requests hit `app.py`, which authenticates the user, validates input, generates or loads a design, writes or reads from SQLite, and returns a rendered page. There are no obvious separate microservices, background workers, or external APIs in the repository structure.

11. For an architecture diagram, the main nodes are: user/browser, Flask app backend, Jinja templates/static CSS, and SQLite database. The main arrows are: registration/login to session state, design form input to generated artwork metadata, save/edit actions to the database, and payment/download actions to final file access.

12. Overall, this is a single-app, database-backed personalized design platform. Its distinguishing business logic is not generic CRUD but transformation of user-entered names and flower selections into a downloadable custom graphic, with authentication and saved-project lifecycle management wrapped around that core workflow.

Main entry points: [`final/app.py`](https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/app.py) (Flask App), [`final/templates/design.html`](https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/templates/design.html) (Design Page), [`final/templates/my_projects.html`](https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/templates/my_projects.html) (My Projects), [`final/templates/payments.html`](https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/templates/payments.html) (Payments Page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_g1["Client & UI"]
  node_n1(("User<br/>actor"))
  node_n2["Browser<br/>client"]
  node_n8["Layout<br/>shared template<br/>[layout.html]"]
  node_n9["Nav<br/>shared template<br/>[nav.html]"]
  node_n10["Home<br/>page template<br/>[index.html]"]
  node_n11["About<br/>page template<br/>[about.html]"]
  node_n12["Design Page<br/>page template<br/>[design.html]"]
  node_n13["Login Page<br/>page template<br/>[login.html]"]
  node_n14["Register Page<br/>page template<br/>[register.html]"]
  node_n15["My Projects<br/>page template<br/>[my_projects.html]"]
  node_n16["Payments Page<br/>page template<br/>[payments.html]"]
  node_n17["Stylesheet<br/>static css<br/>[styles.css]"]
end

subgraph group_g2["Server App"]
  node_n3["Flask App<br/>web app<br/>[app.py]"]
  node_n4{{"Auth<br/>session login<br/>[app.py]"}}
  node_n5{{"Design Flow<br/>generation workflow<br/>[app.py]"}}
  node_n6{{"Projects<br/>saved designs<br/>[app.py]"}}
  node_n7{{"Checkout<br/>purchase/download<br/>[app.py]"}}
end

subgraph group_g3["Data Store"]
  node_n18[("SQLite DB<br/>local database<br/>[namesprouts.db]")]
end

node_n1 -->|"uses"| node_n2
node_n2 -->|"requests"| node_n3
node_n3 -->|"renders"| node_n8
node_n3 -->|"includes"| node_n9
node_n3 -->|"serves"| node_n17
node_n3 -->|"authenticates"| node_n4
node_n3 -->|"generates"| node_n5
node_n3 -->|"persists"| node_n6
node_n3 -->|"checks out"| node_n7
node_n4 -->|"drives"| node_n13
node_n4 -->|"drives"| node_n14
node_n5 -->|"feeds"| node_n12
node_n6 -->|"shows"| node_n15
node_n7 -->|"opens"| node_n16
node_n3 -->|"reads/writes"| node_n18
node_n12 -->|"saves to"| node_n6
node_n15 -->|"edits"| node_n6
node_n16 -->|"confirms"| node_n7
node_n10 -->|"starts"| node_n3
node_n11 -->|"describes"| node_n3

click node_n3 "https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/app.py"
click node_n4 "https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/app.py"
click node_n5 "https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/app.py"
click node_n6 "https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/app.py"
click node_n7 "https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/app.py"
click node_n8 "https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/templates/layout.html"
click node_n9 "https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/templates/nav.html"
click node_n10 "https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/templates/index.html"
click node_n11 "https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/templates/about.html"
click node_n12 "https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/templates/design.html"
click node_n13 "https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/templates/login.html"
click node_n14 "https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/templates/register.html"
click node_n15 "https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/templates/my_projects.html"
click node_n16 "https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/templates/payments.html"
click node_n17 "https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/static/styles.css"
click node_n18 "https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/namesprouts.db"

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_n1,node_n2,node_n8,node_n9,node_n10,node_n11,node_n12,node_n13,node_n14,node_n15,node_n16,node_n17 toneBlue
class node_n3,node_n4,node_n5,node_n6,node_n7 toneAmber
class node_n18 toneMint
```

## Components

### Client & UI

Browser-facing entry points and rendered pages

- **User**: actor · End user creating and buying a name-flower design
- **Browser**: client · Loads server-rendered pages and submits forms
- [Layout](https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/templates/layout.html): shared template · Base page structure used across the site · `final/templates/layout.html`
- [Nav](https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/templates/nav.html): shared template · Site navigation shared across pages · `final/templates/nav.html`
- [Home](https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/templates/index.html): page template · Landing page for the application · `final/templates/index.html`
- [About](https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/templates/about.html): page template · Product and workflow overview page · `final/templates/about.html`
- [Design Page](https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/templates/design.html): page template · Form and preview page for creating a design · `final/templates/design.html`
- [Login Page](https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/templates/login.html): page template · Sign-in form for existing users · `final/templates/login.html`
- [Register Page](https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/templates/register.html): page template · Account creation form for new users · `final/templates/register.html`
- [My Projects](https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/templates/my_projects.html): page template · Lists saved user designs for later editing · `final/templates/my_projects.html`
- [Payments Page](https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/templates/payments.html): page template · Checkout boundary before download or print delivery · `final/templates/payments.html`
- [Stylesheet](https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/static/styles.css): static css · Shared visual styling for the server-rendered UI · `final/static/styles.css`

### Server App

Core Flask-style application logic

- [Flask App](https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/app.py): web app · Single backend handling routing, logic, and persistence · `final/app.py`
- [Auth](https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/app.py): session login · Registers users, logs them in, and gates access · `final/app.py`
- [Design Flow](https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/app.py): generation workflow · Builds the custom name-and-flower composition · `final/app.py`
- [Projects](https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/app.py): saved designs · Stores, retrieves, and edits user projects · `final/app.py`
- [Checkout](https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/app.py): purchase/download · Marks a design as purchased and enables delivery · `final/app.py`

### Data Store

Local persistent state

- [SQLite DB](https://github.com/beardlesshack/namesprouts_cs50/blob/main/final/namesprouts.db): local database · Bundled file-based store for users and designs · `final/namesprouts.db`

## Connections

- User → Browser: uses · Interacts with the application through the browser
- Browser → Flask App: requests · Sends page loads and form submissions to the backend
- Flask App → Layout: renders · Uses the shared layout for server-side pages
- Flask App → Nav: includes · Injects navigation into rendered pages
- Flask App → Stylesheet: serves · Delivers the shared stylesheet with HTML responses
- Flask App → Auth: authenticates · Handles login, registration, and session checks
- Flask App → Design Flow: generates · Coordinates the custom name-and-flower artwork flow
- Flask App → Projects: persists · Saves and reloads user project records
- Flask App → Checkout: checks out · Moves designs into the purchase/download stage
- Auth → Login Page: drives · Backs the login page and sign-in form
- Auth → Register Page: drives · Backs the registration page and account creation flow
- Design Flow → Design Page: feeds · Supplies the design page with generated composition data
- Projects → My Projects: shows · Populates the saved-projects view
- Checkout → Payments Page: opens · Routes users to the checkout page before delivery
- Flask App → SQLite DB: reads/writes · Stores users, designs, and purchase state in SQLite
- Design Page → Projects: saves to · User-created designs can be stored for later editing
- My Projects → Projects: edits · Saved projects can be reopened and modified
- Payments Page → Checkout: confirms · Purchase completion unlocks download or print access
- Home → Flask App: starts · Entry page links into the main backend flow
- About → Flask App: describes · Explains the product and primary user journey
