# swecoinwizards/frontend architecture

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

- Interactive diagram: https://gitdiagram.com/swecoinwizards/frontend
- Repository: https://github.com/swecoinwizards/frontend

## Overview

##### Main Components
- Frontend (React Application):
- Located in the "frontend" directory.
- Contains source code (in frontend/src) for UI components such as Home, Login, Signup, NavBar, NewPost, Profile, etc.
- Uses additional libraries (Bootstrap, react-router-dom) for styling and routing.
- The helper functions (e.g., axios.js in frontend/src/helpers) handle HTTP communication, likely for interacting with the backend API.
- Backend (Flask REST API Server):
- Though in a separate repository, this component is crucial as the README mentions “Pulling from flask rest API server on [Backend Repo]”.
- This part is responsible for providing data (likely cryptocurrency data and user information) to the frontend.
- Shared/Static Assets:
- The "css" directory at the root and additional CSS files inside the frontend and templates directories indicate styling assets.
- The "templates" directory holds HTML files (e.g., home.html, login.html, register.html) that may be used as static fallbacks or for server-rendered pages in the backend.
- Build and Configuration Components:
- GitHub workflows (.github/workflows), various JSON configuration files (package.json, manifest.json) and Makefile indicate CI/CD and development environment settings.
- The README notes that running “make dev_env” sets up the development environment, and instructions mention running ‘npm start’ inside the frontend directory.

##### Relationships and Interactions
- The Frontend communicates directly with the Flask backend via Axios (or similar HTTP client), as seen in the helper files.
- There is a clear layering:
- The user interacts with the React UI.
- The backend processes requests and returns JSON data which the frontend consumes.
- Static assets (CSS and templates) feed into both the frontend’s styling and possibly the backend’s rendered pages.

##### Architectural Patterns and Design Principles
- Separation of Concerns:
- UI (Frontend) is fully decoupled from the API (Backend), following a typical full-stack separation.
- Component-Driven Design:
- The React UI is organized into multiple components and pages, indicating a modular structure.
- API-Driven Interactions:
- Communication between the frontend and backend is based on RESTful API endpoints.
- CI/CD and Environment Management:
- The presence of GitHub workflows and Makefile suggests an emphasis on automated testing, build, and deployment.

##### Including Relevant Technologies and Frameworks
- React and its ecosystem (react-router-dom, Bootstrap, etc.) for the frontend.
- Axios (or similar) for handling API requests.
- Flask for the REST API in the backend.
- Standard configuration tools (NPM, Makefile, Git workflows) for environment setup and deployment.

## Diagram (Mermaid)

```mermaid
flowchart TD
    U["User/Browser"]:::user
    U --> FE["Frontend (React Application)"]:::frontend

    FE --> UIC["UI Components"]:::frontend
    UIC --> HF["Helper Functions (axios)"]:::frontend
    HF -->|"HTTPRequestResponse"| BE["Backend (Flask REST API)"]:::backend

    FE --> CSS["Shared/Static CSS Assets"]:::assets
    BE --> HT["Static HTML Templates"]:::assets

    FE --> GH["GitHub Workflows"]:::build
    FE --> MF["Makefile"]:::build
    FE --> PC_R["Package.json (root)"]:::build
    FE --> PC_FE["Package.json (Frontend)"]:::build
    FE --> MN["Manifest.json (Public)"]:::build

    classDef user fill:#f4d03f,stroke:#333,stroke-width:2px;
    classDef frontend fill:#85c1e9,stroke:#333,stroke-width:2px;
    classDef backend fill:#f1948a,stroke:#333,stroke-width:2px;
    classDef assets fill:#82e0aa,stroke:#333,stroke-width:2px;
    classDef build fill:#bb8fce,stroke:#333,stroke-width:2px;

    click FE "https://github.com/swecoinwizards/frontend/tree/main/frontend"
    click UIC "https://github.com/swecoinwizards/frontend/tree/main/frontend/src"
    click HF "https://github.com/swecoinwizards/frontend/blob/main/frontend/src/helpers/axios.js"
    click CSS "https://github.com/swecoinwizards/frontend/tree/main/css"
    click HT "https://github.com/swecoinwizards/frontend/tree/main/templates"
    click GH "https://github.com/swecoinwizards/frontend/tree/main/.github/workflows"
    click MF "https://github.com/swecoinwizards/frontend/tree/main/Makefile"
    click PC_R "https://github.com/swecoinwizards/frontend/blob/main/package.json"
    click PC_FE "https://github.com/swecoinwizards/frontend/blob/main/frontend/package.json"
    click MN "https://github.com/swecoinwizards/frontend/blob/main/frontend/public/manifest.json"
```
