# mehmetdenizuckan/back-end_project architecture

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

- Interactive diagram: https://gitdiagram.com/mehmetdenizuckan/back-end_project
- Repository: https://github.com/mehmetdenizuckan/back-end_project

## Overview

This repository is a Flask-based website with account registration and login, session-backed user pages, and image/file uploads that can use local storage or S3. The main workflow is a visitor submitting account details, authentication against PostgreSQL, then uploading an image whose URL is saved for display. It also contains a separate SQLAlchemy/SQLite Flask implementation and template-era PHP form handlers. The README is empty, and app.py and several runtime files were not sampled, so their wiring is not inferred.

Main entry points: [`db.py`](https://github.com/mehmetdenizuckan/back-end_project/blob/main/db.py) (User data access), [`static/js/scripts.js`](https://github.com/mehmetdenizuckan/back-end_project/blob/main/static/js/scripts.js) (Browser form scripts), [`file_operations.py`](https://github.com/mehmetdenizuckan/back-end_project/blob/main/file_operations.py) (Upload handling), [`routes.py`](https://github.com/mehmetdenizuckan/back-end_project/blob/main/routes.py) (Page routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_routes["Page routes<br/>[routes.py]"]
  node_legacy_app["Standalone app<br/>[main.py]"]
end

subgraph group_identity["Accounts and sessions"]
  node_auth["Account authentication<br/>[auth.py]"]
  node_db["User data access<br/>[db.py]"]
  node_config["Runtime configuration<br/>[config.py]"]
end

subgraph group_files["File uploads"]
  node_file_ops["Upload handling<br/>[file_operations.py]"]
  node_s3_uploader["S3 uploader"]
end

subgraph group_forms["Landing-page forms"]
  node_browser_forms["Browser form scripts<br/>[scripts.js]"]
  node_signup_handler["Signup mail handler"]
  node_login_handler["Login mail handler"]
  node_newsletter_handler["Newsletter handler"]
end

node_visitor(("Visitor"))
node_postgres[("PostgreSQL")]
node_s3[("Amazon S3")]
node_mail{{"Mail service"}}

node_visitor -->|"requests pages"| node_routes
node_auth -->|"authenticates and registers"| node_db
node_routes -->|"loads image URL"| node_db
node_db -->|"reads database settings"| node_config
node_db -->|"queries user records"| node_postgres
node_visitor -->|"submits credentials"| node_auth
node_visitor -->|"submits file"| node_file_ops
node_file_ops -->|"saves image URL"| node_db
node_file_ops -->|"delegates upload"| node_s3_uploader
node_s3_uploader -->|"uploads and signs URL"| node_s3
node_visitor -->|"submits landing form"| node_browser_forms
node_browser_forms -->|"posts signup data"| node_signup_handler
node_browser_forms -->|"posts login data"| node_login_handler
node_browser_forms -->|"posts newsletter data"| node_newsletter_handler
node_signup_handler -->|"sends form email"| node_mail
node_login_handler -->|"sends form email"| node_mail
node_newsletter_handler -->|"sends form email"| node_mail

click node_routes "https://github.com/mehmetdenizuckan/back-end_project/blob/main/routes.py"
click node_legacy_app "https://github.com/mehmetdenizuckan/back-end_project/blob/main/main.py"
click node_auth "https://github.com/mehmetdenizuckan/back-end_project/blob/main/auth.py"
click node_db "https://github.com/mehmetdenizuckan/back-end_project/blob/main/db.py"
click node_config "https://github.com/mehmetdenizuckan/back-end_project/blob/main/config.py"
click node_file_ops "https://github.com/mehmetdenizuckan/back-end_project/blob/main/file_operations.py"
click node_s3_uploader "https://github.com/mehmetdenizuckan/back-end_project/blob/main/S3_bucket_uploader.py"
click node_browser_forms "https://github.com/mehmetdenizuckan/back-end_project/blob/main/static/js/scripts.js"
click node_signup_handler "https://github.com/mehmetdenizuckan/back-end_project/blob/main/static/php/signupform-process.php"
click node_login_handler "https://github.com/mehmetdenizuckan/back-end_project/blob/main/static/php/loginform-process.php"
click node_newsletter_handler "https://github.com/mehmetdenizuckan/back-end_project/blob/main/static/php/newsletterform-process.php"

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_legacy_app toneBlue
class node_auth,node_db,node_config,node_postgres,node_s3 toneAmber
class node_file_ops,node_s3_uploader toneMint
class node_browser_forms,node_signup_handler,node_login_handler,node_newsletter_handler toneRose
class node_visitor,node_mail toneIndigo
```

## Components

### Web application

- [Page routes](https://github.com/mehmetdenizuckan/back-end_project/blob/main/routes.py): `routes.py`
- [Standalone app](https://github.com/mehmetdenizuckan/back-end_project/blob/main/main.py): `main.py`

### Accounts and sessions

- [Account authentication](https://github.com/mehmetdenizuckan/back-end_project/blob/main/auth.py): `auth.py`
- [User data access](https://github.com/mehmetdenizuckan/back-end_project/blob/main/db.py): `db.py`
- [Runtime configuration](https://github.com/mehmetdenizuckan/back-end_project/blob/main/config.py): `config.py`

### File uploads

- [Upload handling](https://github.com/mehmetdenizuckan/back-end_project/blob/main/file_operations.py): `file_operations.py`
- [S3 uploader](https://github.com/mehmetdenizuckan/back-end_project/blob/main/S3_bucket_uploader.py): `S3_bucket_uploader.py`

### Landing-page forms

- [Browser form scripts](https://github.com/mehmetdenizuckan/back-end_project/blob/main/static/js/scripts.js): `static/js/scripts.js`
- [Signup mail handler](https://github.com/mehmetdenizuckan/back-end_project/blob/main/static/php/signupform-process.php): `static/php/signupform-process.php`
- [Login mail handler](https://github.com/mehmetdenizuckan/back-end_project/blob/main/static/php/loginform-process.php): `static/php/loginform-process.php`
- [Newsletter handler](https://github.com/mehmetdenizuckan/back-end_project/blob/main/static/php/newsletterform-process.php): `static/php/newsletterform-process.php`

### Other components

- **Visitor**
- **PostgreSQL**
- **Amazon S3**
- **Mail service**

## Connections

- Visitor → Page routes: requests pages (evidence: `routes.py`)
- Account authentication → User data access: authenticates and registers (evidence: `auth.py`)
- Page routes → User data access: loads image URL (evidence: `routes.py`)
- User data access → Runtime configuration: reads database settings (evidence: `db.py`)
- User data access → PostgreSQL: queries user records (evidence: `db.py`)
- Visitor → Account authentication: submits credentials (evidence: `auth.py`)
- Visitor → Upload handling: submits file (evidence: `file_operations.py`)
- Upload handling → User data access: saves image URL (evidence: `file_operations.py`)
- Upload handling → S3 uploader: delegates upload (evidence: `file_operations.py`)
- S3 uploader → Amazon S3: uploads and signs URL (evidence: `S3_bucket_uploader.py`)
- Visitor → Browser form scripts: submits landing form (evidence: `static/js/scripts.js`)
- Browser form scripts → Signup mail handler: posts signup data (evidence: `static/js/scripts.js`)
- Browser form scripts → Login mail handler: posts login data (evidence: `static/js/scripts.js`)
- Browser form scripts → Newsletter handler: posts newsletter data (evidence: `static/js/scripts.js`)
- Signup mail handler → Mail service: sends form email (evidence: `static/php/signupform-process.php`)
- Login mail handler → Mail service: sends form email (evidence: `static/php/loginform-process.php`)
- Newsletter handler → Mail service: sends form email (evidence: `static/php/newsletterform-process.php`)
