# scriptedbyarun47/arun1x architecture

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

- Interactive diagram: https://gitdiagram.com/scriptedbyarun47/arun1x
- Repository: https://github.com/scriptedbyarun47/arun1x

## Overview

1. **Overall shape**
   - This is a two-tier portfolio site: a **static frontend** in `frontend/` and a **Python FastAPI backend** in `backend/`.
   - The app is split across two hosts: **Vercel** for the frontend and **Render** for the backend, with **MongoDB Atlas** and **Cloudinary** as external services.

2. **Frontend boundary**
   - `frontend/index.html`, `app.js`, and `style.css` form the public-facing site.
   - The frontend is built with **vanilla HTML/CSS/JavaScript**, so the browser handles most presentation and interaction logic directly.
   - From the README, the UI includes a terminal-style boot screen, portfolio sections, a writeup reader, a CTF tracker, and a contact form.

3. **Backend boundary**
   - `backend/main.py` is the application entrypoint for a **FastAPI** service.
   - This backend is the system’s server-side integration point for data retrieval and persistence.
   - `backend/admin.html` suggests the backend also serves or supports an admin-facing management page.

4. **Data layer**
   - The README explicitly names **MongoDB Atlas** as the database.
   - The likely architectural role of MongoDB is to store portfolio content and user-submitted data such as writeups, challenge entries, and contact form submissions.
   - This separates editable content from the static frontend code.

5. **Media handling**
   - The README names **Cloudinary** as the image CDN.
   - This means writeup content or portfolio content likely references externally hosted images rather than storing media in the app repository or database.
   - The frontend is therefore a consumer of image URLs, not the owner of binary media storage.

6. **Public content flow**
   - A typical flow is: browser loads the static frontend from Vercel, JavaScript fetches content from the FastAPI backend, and the backend reads that content from MongoDB Atlas.
   - For writeups, the frontend likely renders text plus Cloudinary-hosted images sourced from backend-managed content.
   - This keeps the public site fast and mostly static while still allowing dynamic content updates.

7. **Contact and submission flow**
   - The contact form is a key write path from the browser into the backend.
   - The backend is responsible for validating and persisting submissions, likely into MongoDB Atlas.
   - Any follow-up processing, if present, would also live behind the FastAPI boundary rather than in the browser.

8. **Admin/content-management flow**
   - The presence of `admin.html` and the README’s “Admin dashboard for content management” indicates a separate management surface.
   - This admin area likely writes portfolio data into the same backend/database used by the public site.
   - Architecturally, this is the private control plane for updating the public portfolio without redeploying the frontend.

9. **Runtime and deployment**
   - The backend is designed to run under **Uvicorn** via FastAPI, with `Procfile` indicating Render-style process startup.
   - The frontend is deployed as static assets, consistent with Vercel hosting.
   - This is a clean separation between a serverless/static presentation layer and a dedicated API service.

10. **Repository organization**
   - The repo is intentionally simple: one backend app, one frontend app, and no shared monorepo framework.
   - There are no obvious subservices or worker processes in the tree, so the architecture is mostly **single API + single static client + external services**.
   - `README.md` doubles as the system’s architecture summary and deployment guide.

11. **What to draw in an architecture diagram**
   - Show **end users** accessing the **frontend on Vercel**.
   - Show the frontend calling the **FastAPI backend on Render**.
   - Show the backend connected to **MongoDB Atlas** for content/data and **Cloudinary** for images.
   - Show a separate **admin/content-management path** into the same backend and data store.

12. **Key architectural takeaway**
   - The repository is a content-driven portfolio platform where the browser is mostly presentation logic, FastAPI is the integration and persistence boundary, and MongoDB/Cloudinary provide the durable content and media backends.

Main entry points: [`backend/main.py`](https://github.com/scriptedbyarun47/arun1x/blob/main/backend/main.py) (FastAPI app), [`frontend/index.html`](https://github.com/scriptedbyarun47/arun1x/blob/main/frontend/index.html) (Home page), [`frontend/app.js`](https://github.com/scriptedbyarun47/arun1x/blob/main/frontend/app.js) (Client app), [`backend/admin.html`](https://github.com/scriptedbyarun47/arun1x/blob/main/backend/admin.html) (Admin page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_users["Users"]
  node_browser(("Browser<br/>client"))
  node_creator(("Admin<br/>operator"))
end

subgraph group_frontend["Frontend"]
  node_site["Home page<br/>static html<br/>[index.html]"]
  node_ui["Client app<br/>vanilla js<br/>[app.js]"]
  node_styles["Stylesheet<br/>css<br/>[style.css]"]
  node_writeup["Writeup page<br/>html reader<br/>[writeup.html]"]
end

subgraph group_backend["Backend"]
  node_api["FastAPI app<br/>python api<br/>[main.py]"]
  node_admin["Admin page<br/>management html<br/>[admin.html]"]
  node_deploy["Render app<br/>hosting"]
end

subgraph group_services["External services"]
  node_db[("MongoDB Atlas<br/>database")]
  node_media[("Cloudinary<br/>media cdn")]
  node_frontend_host{{"Vercel<br/>static hosting"}}
end

node_browser -->|"opens"| node_frontend_host
node_frontend_host -->|"serves"| node_site
node_site -->|"loads"| node_ui
node_site -->|"applies"| node_styles
node_ui -->|"fetches content"| node_api
node_writeup -->|"reads data"| node_api
node_api -->|"reads/writes"| node_db
node_api -->|"references images"| node_media
node_creator -->|"uses"| node_admin
node_admin -->|"updates content"| node_api
node_api -->|"runs on"| node_deploy
node_deploy -->|"hosts"| node_api

click node_site "https://github.com/scriptedbyarun47/arun1x/blob/main/frontend/index.html"
click node_ui "https://github.com/scriptedbyarun47/arun1x/blob/main/frontend/app.js"
click node_styles "https://github.com/scriptedbyarun47/arun1x/blob/main/frontend/style.css"
click node_writeup "https://github.com/scriptedbyarun47/arun1x/blob/main/frontend/writeup.html"
click node_api "https://github.com/scriptedbyarun47/arun1x/blob/main/backend/main.py"
click node_admin "https://github.com/scriptedbyarun47/arun1x/blob/main/backend/admin.html"
click node_deploy "https://github.com/scriptedbyarun47/arun1x/tree/main/backend/Procfile"

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_browser,node_creator toneBlue
class node_site,node_ui,node_styles,node_writeup toneAmber
class node_api,node_admin,node_deploy toneMint
class node_db,node_media,node_frontend_host toneRose
```

## Components

### Users

People interacting with the portfolio and admin surfaces

- **Browser**: client · Loads and uses the public site
- **Admin**: operator · Manages portfolio content through the admin surface

### Frontend

Static browser app deployed on Vercel

- [Home page](https://github.com/scriptedbyarun47/arun1x/blob/main/frontend/index.html): static html · Public entry page for the portfolio · `frontend/index.html`
- [Client app](https://github.com/scriptedbyarun47/arun1x/blob/main/frontend/app.js): vanilla js · Browser interaction and data fetching logic · `frontend/app.js`
- [Stylesheet](https://github.com/scriptedbyarun47/arun1x/blob/main/frontend/style.css): css · Visual presentation for the public site · `frontend/style.css`
- [Writeup page](https://github.com/scriptedbyarun47/arun1x/blob/main/frontend/writeup.html): html reader · Dedicated page for reading writeups and media · `frontend/writeup.html`

### Backend

FastAPI service deployed on Render

- [FastAPI app](https://github.com/scriptedbyarun47/arun1x/blob/main/backend/main.py): python api · Server-side integration and content endpoint · `backend/main.py`
- [Admin page](https://github.com/scriptedbyarun47/arun1x/blob/main/backend/admin.html): management html · Private content-management surface · `backend/admin.html`
- [Render app](https://github.com/scriptedbyarun47/arun1x/tree/main/backend/Procfile): hosting · Backend runtime and process startup · `backend/Procfile`

### External services

Managed data and media backends

- **MongoDB Atlas**: database · Stores portfolio content and submissions
- **Cloudinary**: media cdn · Hosts externally referenced images
- **Vercel**: static hosting · Hosts the public frontend

## Connections

- Browser → Vercel: opens · User accesses the deployed static site
- Vercel → Home page: serves · Vercel delivers the public HTML entry point
- Home page → Client app: loads · The page boots the browser logic
- Home page → Stylesheet: applies · The page uses the shared styling
- Client app → FastAPI app: fetches content · Client script retrieves dynamic portfolio data
- Writeup page → FastAPI app: reads data · Writeup views are populated from backend content
- FastAPI app → MongoDB Atlas: reads/writes · Persistent portfolio data and submissions live in MongoDB Atlas
- FastAPI app → Cloudinary: references images · Content may include Cloudinary-hosted media URLs
- Admin → Admin page: uses · Admin manages content through the management page
- Admin page → FastAPI app: updates content · Admin actions go through the FastAPI boundary
- FastAPI app → Render app: runs on · Render starts the FastAPI service process
- Render app → FastAPI app: hosts · Backend runtime executes the application entrypoint
