# aryantj07/photobooth-application architecture

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

- Interactive diagram: https://gitdiagram.com/aryantj07/photobooth-application
- Repository: https://github.com/aryantj07/photobooth-application

## Overview

Snapstory is a Flask-powered self-service photo booth. A visitor selects a photo package, pays through Razorpay, captures up to four webcam or demo photos, and reviews a generated photo strip. The server creates orders and verifies payments against Razorpay and PostgreSQL; the browser handles booth navigation, capture, and preview. The excerpts show payment verification and strip-building behavior, but omit parts of order initiation and session-to-capture wiring, so those connections are not inferred.

Main entry points: [`static/js/app.js`](https://github.com/aryantj07/photobooth-application/blob/main/static/js/app.js) (Booth UI), [`app.py`](https://github.com/aryantj07/photobooth-application/blob/main/app.py) (Payment verification), [`templates/index.html`](https://github.com/aryantj07/photobooth-application/blob/main/templates/index.html) (Booth page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Booth interface"]
  node_page["Booth page<br/>[index.html]"]
  node_client["Booth UI<br/>[app.js]"]
  node_packages["Package selection<br/>[app.js]"]
end

subgraph group_payments["Payment processing"]
  node_flask["Flask routes<br/>[app.py]"]
  node_order["Order creation<br/>[app.py]"]
  node_verification["Payment verification<br/>[app.py]"]
end

subgraph group_capture["Photo experience"]
  node_camera["Camera access<br/>[app.js]"]
  node_capture["Photo capture<br/>[app.js]"]
  node_strip["Strip builder<br/>[app.js]"]
  node_preview["Strip preview<br/>[app.js]"]
end

subgraph group_persistence["Order records"]
  node_database[("PostgreSQL")]
end

node_visitor(("Visitor"))
node_razorpay{{"Razorpay"}}

node_visitor -->|"uses"| node_client
node_flask -->|"renders"| node_page
node_client -->|"selects"| node_packages
node_order -->|"creates order"| node_razorpay
node_order -->|"inserts order"| node_database
node_verification -->|"reads and updates"| node_database
node_verification -->|"verifies payment"| node_razorpay
node_client -->|"posts verification"| node_verification
node_visitor -->|"enables"| node_camera
node_camera -->|"provides stream"| node_capture
node_client -->|"requests capture"| node_capture
node_capture -->|"builds from photos"| node_strip
node_strip -->|"shows result"| node_preview

click node_flask "https://github.com/aryantj07/photobooth-application/blob/main/app.py"
click node_page "https://github.com/aryantj07/photobooth-application/blob/main/templates/index.html"
click node_client "https://github.com/aryantj07/photobooth-application/blob/main/static/js/app.js"
click node_packages "https://github.com/aryantj07/photobooth-application/blob/main/static/js/app.js"
click node_order "https://github.com/aryantj07/photobooth-application/blob/main/app.py"
click node_verification "https://github.com/aryantj07/photobooth-application/blob/main/app.py"
click node_camera "https://github.com/aryantj07/photobooth-application/blob/main/static/js/app.js"
click node_capture "https://github.com/aryantj07/photobooth-application/blob/main/static/js/app.js"
click node_strip "https://github.com/aryantj07/photobooth-application/blob/main/static/js/app.js"
click node_preview "https://github.com/aryantj07/photobooth-application/blob/main/static/js/app.js"

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_page,node_client,node_packages toneBlue
class node_flask,node_order,node_verification toneAmber
class node_camera,node_capture,node_strip,node_preview toneMint
class node_database toneRose
class node_visitor,node_razorpay toneIndigo
```

## Components

### Booth interface

- [Booth page](https://github.com/aryantj07/photobooth-application/blob/main/templates/index.html): `templates/index.html`
- [Booth UI](https://github.com/aryantj07/photobooth-application/blob/main/static/js/app.js): `static/js/app.js`
- [Package selection](https://github.com/aryantj07/photobooth-application/blob/main/static/js/app.js): `static/js/app.js`

### Payment processing

- [Flask routes](https://github.com/aryantj07/photobooth-application/blob/main/app.py): `app.py`
- [Order creation](https://github.com/aryantj07/photobooth-application/blob/main/app.py): `app.py`
- [Payment verification](https://github.com/aryantj07/photobooth-application/blob/main/app.py): `app.py`

### Photo experience

- [Camera access](https://github.com/aryantj07/photobooth-application/blob/main/static/js/app.js): `static/js/app.js`
- [Photo capture](https://github.com/aryantj07/photobooth-application/blob/main/static/js/app.js): `static/js/app.js`
- [Strip builder](https://github.com/aryantj07/photobooth-application/blob/main/static/js/app.js): `static/js/app.js`
- [Strip preview](https://github.com/aryantj07/photobooth-application/blob/main/static/js/app.js): `static/js/app.js`

### Order records

- **PostgreSQL**

### Other components

- **Visitor**
- **Razorpay**

## Connections

- Visitor → Booth UI: uses (evidence: `static/js/app.js`)
- Flask routes → Booth page: renders (evidence: `app.py`)
- Booth UI → Package selection: selects (evidence: `static/js/app.js`)
- Order creation → Razorpay: creates order (evidence: `app.py`)
- Order creation → PostgreSQL: inserts order (evidence: `app.py`)
- Payment verification → PostgreSQL: reads and updates (evidence: `app.py`)
- Payment verification → Razorpay: verifies payment (evidence: `app.py`)
- Booth UI → Payment verification: posts verification (evidence: `static/js/app.js`)
- Visitor → Camera access: enables (evidence: `static/js/app.js`)
- Camera access → Photo capture: provides stream (evidence: `static/js/app.js`)
- Booth UI → Photo capture: requests capture (evidence: `static/js/app.js`)
- Photo capture → Strip builder: builds from photos (evidence: `static/js/app.js`)
- Strip builder → Strip preview: shows result (evidence: `static/js/app.js`)
