# delsiusuisled/blockchain_f1_ticketing_system architecture

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

- Interactive diagram: https://gitdiagram.com/delsiusuisled/blockchain_f1_ticketing_system
- Repository: https://github.com/delsiusuisled/blockchain_f1_ticketing_system

## Overview

##### Project Type & Purpose
- The project is a decentralized application (dApp) designed for managing F1 ticketing via the Ethereum blockchain.
- It utilizes Solidity for smart contracts, MetaMask for user wallet interactions, and a simple web server to host the static frontend.
- The README emphasizes secure and transparent ticket transactions using blockchain technology.

##### Analyzing the File Structure
- The entire frontend is contained within the “F1” folder, which holds numerous HTML, CSS, and JavaScript files representing different views and functionalities. For example:
- Pages like index.html, client.html, admin pages (admin.html, admin.css, etc.), event-related pages (eventcreate.html, eventdetails.html, eventupdate.html), and ticketing views (ticketview.html, mytickets.html) to cover various user roles such as organizers, administrators, and clients.
- JavaScript files (e.g., contracts.js, event.js, wallet.js) indicate the logic that interacts with the blockchain (likely acting as the bridge between the UI and smart contract functions).
- Key non-UI elements:
- The solidity.txt file which contains Solidity code for smart contracts (even though its extension suggests text, it represents the smart contract component).

##### Key Components
a. Frontend Layer:
- Multiple UI pages: Separate interfaces for login, viewing tickets, event details, an admin interface, and more.
- Associated assets: CSS styling files (App.css, admin.css, style.css) and media such as video (f1-intro.mp4) and images (f1-vip.avif) that enhance the user experience.
- JavaScript modules that drive the interactions on each page (e.g., contracts.js for managing smart contract calls, wallet.js for MetaMask interactions).
b. Blockchain / Smart Contract Layer:
- Smart contracts written in Solidity (referenced in solidity.txt) that manage ticket issuance, transfer, and transaction validation.
- Integration with the Ethereum blockchain (deployment on the Sepolia test network as mentioned in the README) for decentralization and transparency.
c. Integration & Interaction:
- MetaMask as a wallet provider interface, injected into the frontend JavaScript environment to facilitate user authentication and transaction signing.
- Communication between the frontend and smart contracts via web3 interactions (encapsulated in the JavaScript files).
d. Supporting Infrastructure:
- Simple Web Server for hosting the static assets (HTML, CSS, JS) which could be detailed as an infrastructure node.

## Diagram (Mermaid)

```mermaid
graph TD
    User["User"]:::user
    Server["Web Server\n(Static Assets)"]:::server

    subgraph "Frontend Client"
        subgraph "UI Files (HTML/CSS)"
            UI1["index.html"]:::ui
            UI2["client.html"]:::ui
            UI3["admin.html"]:::ui
            UI4["eventcreate.html"]:::ui
            UI5["eventdetails.html"]:::ui
            UI6["eventupdate.html"]:::ui
            UI7["ticketview.html"]:::ui
            UI8["mytickets.html"]:::ui
            UI9["marketplace.html"]:::ui
            UI10["App.css"]:::ui
            UI11["admin.css"]:::ui
            UI12["style.css"]:::ui
        end
        subgraph "JavaScript Modules"
            JS1["contracts.js"]:::js
            JS2["event.js"]:::js
            JS3["wallet.js"]:::js
            JS4["admin.js"]:::js
            JS5["client.js"]:::js
            JS6["eventdetails.js"]:::js
            JS7["marketplace.js"]:::js
            JS8["ticket.js"]:::js
        end
        subgraph "Admin & Organizer Modules"
            AO1["admin.html"]:::admin
            AO2["admin.js"]:::admin
            AO3["organiser.js"]:::admin
            AO4["organisercreate.html"]:::admin
            AO5["organiserupdate.html"]:::admin
            AO6["organiserview.html"]:::admin
        end
    end

    MetaMask["MetaMask / Wallet Integration"]:::wallet
    Blockchain["Ethereum Blockchain/\nSmart Contracts"]:::blockchain

    %% Connections
    User -->|"initiates request"| Server
    Server -->|"serves static assets"| UI1
    UI1 -->|"loads corresponding JS"| JS1
    JS1 -->|"calls contracts"| Blockchain
    JS3 -->|"triggers wallet auth"| MetaMask
    MetaMask -->|"signs transactions"| Blockchain

    %% Click Events for Frontend UI Files
    click UI1 "https://github.com/delsiusuisled/blockchain_f1_ticketing_system/blob/main/F1/index.html"
    click UI2 "https://github.com/delsiusuisled/blockchain_f1_ticketing_system/blob/main/F1/client.html"
    click UI3 "https://github.com/delsiusuisled/blockchain_f1_ticketing_system/blob/main/F1/admin.html"
    click UI4 "https://github.com/delsiusuisled/blockchain_f1_ticketing_system/blob/main/F1/eventcreate.html"
    click UI5 "https://github.com/delsiusuisled/blockchain_f1_ticketing_system/blob/main/F1/eventdetails.html"
    click UI6 "https://github.com/delsiusuisled/blockchain_f1_ticketing_system/blob/main/F1/eventupdate.html"
    click UI7 "https://github.com/delsiusuisled/blockchain_f1_ticketing_system/blob/main/F1/ticketview.html"
    click UI8 "https://github.com/delsiusuisled/blockchain_f1_ticketing_system/blob/main/F1/mytickets.html"
    click UI9 "https://github.com/delsiusuisled/blockchain_f1_ticketing_system/blob/main/F1/marketplace.html"
    click UI10 "https://github.com/delsiusuisled/blockchain_f1_ticketing_system/blob/main/F1/App.css"
    click UI11 "https://github.com/delsiusuisled/blockchain_f1_ticketing_system/blob/main/F1/admin.css"
    click UI12 "https://github.com/delsiusuisled/blockchain_f1_ticketing_system/blob/main/F1/style.css"

    %% Click Events for JavaScript Modules
    click JS1 "https://github.com/delsiusuisled/blockchain_f1_ticketing_system/blob/main/F1/contracts.js"
    click JS2 "https://github.com/delsiusuisled/blockchain_f1_ticketing_system/blob/main/F1/event.js"
    click JS3 "https://github.com/delsiusuisled/blockchain_f1_ticketing_system/blob/main/F1/wallet.js"
    click JS4 "https://github.com/delsiusuisled/blockchain_f1_ticketing_system/blob/main/F1/admin.js"
    click JS5 "https://github.com/delsiusuisled/blockchain_f1_ticketing_system/blob/main/F1/client.js"
    click JS6 "https://github.com/delsiusuisled/blockchain_f1_ticketing_system/blob/main/F1/eventdetails.js"
    click JS7 "https://github.com/delsiusuisled/blockchain_f1_ticketing_system/blob/main/F1/marketplace.js"
    click JS8 "https://github.com/delsiusuisled/blockchain_f1_ticketing_system/blob/main/F1/ticket.js"

    %% Click Events for Admin & Organizer Modules
    click AO1 "https://github.com/delsiusuisled/blockchain_f1_ticketing_system/blob/main/F1/admin.html"
    click AO2 "https://github.com/delsiusuisled/blockchain_f1_ticketing_system/blob/main/F1/admin.js"
    click AO3 "https://github.com/delsiusuisled/blockchain_f1_ticketing_system/blob/main/F1/organiser.js"
    click AO4 "https://github.com/delsiusuisled/blockchain_f1_ticketing_system/blob/main/F1/organisercreate.html"
    click AO5 "https://github.com/delsiusuisled/blockchain_f1_ticketing_system/blob/main/F1/organiserupdate.html"
    click AO6 "https://github.com/delsiusuisled/blockchain_f1_ticketing_system/blob/main/F1/organiserview.html"

    %% Click Events for Other Components
    click MetaMask "https://github.com/delsiusuisled/blockchain_f1_ticketing_system/blob/main/F1/wallet.js"
    click Blockchain "https://github.com/delsiusuisled/blockchain_f1_ticketing_system/blob/main/solidity.txt"
    click Server "https://github.com/delsiusuisled/blockchain_f1_ticketing_system/tree/main/F1"

    %% Styles
    classDef user fill:#D3D3D3,stroke:#000,stroke-width:2px;
    classDef server fill:#D8BFD8,stroke:#000,stroke-width:2px;
    classDef ui fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef js fill:#FFFFE0,stroke:#000,stroke-width:2px;
    classDef admin fill:#FFC0CB,stroke:#000,stroke-width:2px;
    classDef wallet fill:#FFA500,stroke:#000,stroke-width:2px;
    classDef blockchain fill:#90EE90,stroke:#000,stroke-width:2px;
```
