# subrotokumar7/article-arena-client architecture

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

- Interactive diagram: https://gitdiagram.com/subrotokumar7/article-arena-client
- Repository: https://github.com/subrotokumar7/article-arena-client

## Overview

Article Arena is a multi-role article-contest platform. Users discover contests, view details, pay to participate, and track joined contests or wins; creators manage contests and participants and declare winners; admins approve contests and manage roles. The frontend routes those tasks into public pages and role-specific dashboards, with authentication and secured API access supporting the workflows. README documents payment and submission capabilities, but sampled source does not show the backend implementation or all submission mechanics; those links are represented only where documented.

Main entry points: [`src/routes/router.jsx`](https://github.com/subrotokumar7/article-arena-client/blob/main/src/routes/router.jsx) (Route dispatch), [`src/provider/AuthProvider.jsx`](https://github.com/subrotokumar7/article-arena-client/blob/main/src/provider/AuthProvider.jsx) (Firebase authentication), [`src/hooks/useAxiosSecured.jsx`](https://github.com/subrotokumar7/article-arena-client/blob/main/src/hooks/useAxiosSecured.jsx) (Secured API client), [`src/pages/Auth`](https://github.com/subrotokumar7/article-arena-client/tree/main/src/pages/Auth) (Sign in and register)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_router["Route dispatch<br/>[router.jsx]"]
  node_public["Public pages"]
  node_dashboard["Role dashboard"]
end

subgraph group_identity["Identity and access"]
  node_auth_pages["Sign in and register"]
  node_auth_provider["Firebase authentication<br/>[AuthProvider.jsx]"]
  node_firebase{{"Firebase Auth<br/>[firebase.config.js]"}}
  node_role_check["Role lookup<br/>[useRole.jsx]"]
  node_secured_api["Secured API client"]
  node_image_upload["Profile image upload<br/>[uploadImage.js]"]
  node_image_service{{"Image hosting"}}
  node_shared_auth["Auth context hook<br/>[useAuth.jsx]"]
end

subgraph group_contest["Contest workflows"]
  node_contest_browse["Contest discovery<br/>[AllContest.jsx]"]
  node_contest_details["Contest details<br/>[Details.jsx]"]
  node_payment["Contest payment<br/>[Details.jsx]"]
  node_payment_result["Payment result"]
  node_admin_ops["Admin management"]
  node_creator_ops["Creator management"]
  node_participant_ops["Participation tracking"]
  node_backend{{"Article Arena API"}}
end

subgraph group_insights["Results and profiles"]
  node_results["Winners and leaderboard"]
  node_profile["Profile management<br/>[UpdateProfile.jsx]"]
end

node_visitor(("Visitor or member"))

node_visitor -->|"navigates"| node_router
node_router -->|"routes to"| node_public
node_router -->|"routes to"| node_contest_browse
node_router -->|"routes to"| node_contest_details
node_router -->|"routes to"| node_payment_result
node_router -->|"routes to"| node_dashboard
node_router -->|"routes to"| node_auth_pages
node_router -->|"routes to"| node_admin_ops
node_router -->|"routes to"| node_creator_ops
node_router -->|"routes to"| node_participant_ops
node_router -->|"routes to"| node_results
node_router -->|"routes to"| node_profile
node_auth_pages -.->|"authenticates"| node_auth_provider
node_auth_provider -->|"uses"| node_firebase
node_auth_provider -->|"provides context"| node_shared_auth
node_shared_auth -->|"reads context"| node_auth_provider
node_dashboard -->|"checks role"| node_role_check
node_role_check -->|"queries role"| node_secured_api
node_secured_api -->|"reads user"| node_shared_auth
node_secured_api -->|"sends requests"| node_backend
node_contest_details -->|"loads contest"| node_secured_api
node_contest_details -->|"starts checkout"| node_payment
node_payment -->|"creates session"| node_backend
node_payment -.->|"returns after payment"| node_payment_result
node_participant_ops -.->|"participates and submits"| node_backend
node_creator_ops -.->|"manages and declares"| node_backend
node_admin_ops -.->|"approves and assigns roles"| node_backend
node_auth_pages -->|"uploads photo"| node_image_upload
node_profile -->|"uploads photo"| node_image_upload
node_image_upload -->|"uploads image"| node_image_service
node_results -.->|"loads results"| node_backend

click node_router "https://github.com/subrotokumar7/article-arena-client/blob/main/src/routes/router.jsx"
click node_public "https://github.com/subrotokumar7/article-arena-client/tree/main/src/pages/Home"
click node_contest_browse "https://github.com/subrotokumar7/article-arena-client/blob/main/src/pages/AllContest/AllContest.jsx"
click node_contest_details "https://github.com/subrotokumar7/article-arena-client/blob/main/src/pages/Details/Details.jsx"
click node_payment "https://github.com/subrotokumar7/article-arena-client/blob/main/src/pages/Details/Details.jsx"
click node_payment_result "https://github.com/subrotokumar7/article-arena-client/tree/main/src/pages/Payment"
click node_admin_ops "https://github.com/subrotokumar7/article-arena-client/tree/main/src/pages/Dashboard/Admin"
click node_creator_ops "https://github.com/subrotokumar7/article-arena-client/tree/main/src/pages/Dashboard/Creator"
click node_participant_ops "https://github.com/subrotokumar7/article-arena-client/tree/main/src/pages/Dashboard/User"
click node_dashboard "https://github.com/subrotokumar7/article-arena-client/blob/main/src/layout/DashboardLayout.jsx"
click node_auth_pages "https://github.com/subrotokumar7/article-arena-client/tree/main/src/pages/Auth"
click node_auth_provider "https://github.com/subrotokumar7/article-arena-client/blob/main/src/provider/AuthProvider.jsx"
click node_firebase "https://github.com/subrotokumar7/article-arena-client/blob/main/src/firebase/firebase.config.js"
click node_role_check "https://github.com/subrotokumar7/article-arena-client/blob/main/src/hooks/useRole.jsx"
click node_secured_api "https://github.com/subrotokumar7/article-arena-client/blob/main/src/hooks/useAxiosSecured.jsx"
click node_image_upload "https://github.com/subrotokumar7/article-arena-client/blob/main/src/utils/uploadImage.js"
click node_results "https://github.com/subrotokumar7/article-arena-client/tree/main/src/pages/LatestWinner"
click node_profile "https://github.com/subrotokumar7/article-arena-client/blob/main/src/pages/Dashboard/UpdateProfile/UpdateProfile.jsx"
click node_shared_auth "https://github.com/subrotokumar7/article-arena-client/blob/main/src/hooks/useAuth.jsx"

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_router,node_public,node_dashboard toneBlue
class node_auth_pages,node_auth_provider,node_firebase,node_role_check,node_secured_api,node_image_upload,node_image_service,node_shared_auth toneAmber
class node_contest_browse,node_contest_details,node_payment,node_payment_result,node_admin_ops,node_creator_ops,node_participant_ops,node_backend toneMint
class node_results,node_profile toneRose
class node_visitor toneIndigo
```

## Components

### Web experience

- [Route dispatch](https://github.com/subrotokumar7/article-arena-client/blob/main/src/routes/router.jsx): `src/routes/router.jsx`
- [Public pages](https://github.com/subrotokumar7/article-arena-client/tree/main/src/pages/Home): `src/pages/Home`
- [Role dashboard](https://github.com/subrotokumar7/article-arena-client/blob/main/src/layout/DashboardLayout.jsx): `src/layout/DashboardLayout.jsx`

### Identity and access

- [Sign in and register](https://github.com/subrotokumar7/article-arena-client/tree/main/src/pages/Auth): `src/pages/Auth`
- [Firebase authentication](https://github.com/subrotokumar7/article-arena-client/blob/main/src/provider/AuthProvider.jsx): `src/provider/AuthProvider.jsx`
- [Firebase Auth](https://github.com/subrotokumar7/article-arena-client/blob/main/src/firebase/firebase.config.js): `src/firebase/firebase.config.js`
- [Role lookup](https://github.com/subrotokumar7/article-arena-client/blob/main/src/hooks/useRole.jsx): `src/hooks/useRole.jsx`
- [Secured API client](https://github.com/subrotokumar7/article-arena-client/blob/main/src/hooks/useAxiosSecured.jsx): `src/hooks/useAxiosSecured.jsx`
- [Profile image upload](https://github.com/subrotokumar7/article-arena-client/blob/main/src/utils/uploadImage.js): `src/utils/uploadImage.js`
- **Image hosting**
- [Auth context hook](https://github.com/subrotokumar7/article-arena-client/blob/main/src/hooks/useAuth.jsx): `src/hooks/useAuth.jsx`

### Contest workflows

- [Contest discovery](https://github.com/subrotokumar7/article-arena-client/blob/main/src/pages/AllContest/AllContest.jsx): `src/pages/AllContest/AllContest.jsx`
- [Contest details](https://github.com/subrotokumar7/article-arena-client/blob/main/src/pages/Details/Details.jsx): `src/pages/Details/Details.jsx`
- [Contest payment](https://github.com/subrotokumar7/article-arena-client/blob/main/src/pages/Details/Details.jsx): `src/pages/Details/Details.jsx`
- [Payment result](https://github.com/subrotokumar7/article-arena-client/tree/main/src/pages/Payment): `src/pages/Payment`
- [Admin management](https://github.com/subrotokumar7/article-arena-client/tree/main/src/pages/Dashboard/Admin): `src/pages/Dashboard/Admin`
- [Creator management](https://github.com/subrotokumar7/article-arena-client/tree/main/src/pages/Dashboard/Creator): `src/pages/Dashboard/Creator`
- [Participation tracking](https://github.com/subrotokumar7/article-arena-client/tree/main/src/pages/Dashboard/User): `src/pages/Dashboard/User`
- **Article Arena API**

### Results and profiles

- [Winners and leaderboard](https://github.com/subrotokumar7/article-arena-client/tree/main/src/pages/LatestWinner): `src/pages/LatestWinner`
- [Profile management](https://github.com/subrotokumar7/article-arena-client/blob/main/src/pages/Dashboard/UpdateProfile/UpdateProfile.jsx): `src/pages/Dashboard/UpdateProfile/UpdateProfile.jsx`

### Other components

- **Visitor or member**

## Connections

- Visitor or member → Route dispatch: navigates (evidence: `src/routes/router.jsx`)
- Route dispatch → Public pages: routes to (evidence: `src/routes/router.jsx`)
- Route dispatch → Contest discovery: routes to (evidence: `src/routes/router.jsx`)
- Route dispatch → Contest details: routes to (evidence: `src/routes/router.jsx`)
- Route dispatch → Payment result: routes to (evidence: `src/routes/router.jsx`)
- Route dispatch → Role dashboard: routes to (evidence: `src/routes/router.jsx`)
- Route dispatch → Sign in and register: routes to (evidence: `src/routes/router.jsx`)
- Route dispatch → Admin management: routes to (evidence: `src/routes/router.jsx`)
- Route dispatch → Creator management: routes to (evidence: `src/routes/router.jsx`)
- Route dispatch → Participation tracking: routes to (evidence: `src/routes/router.jsx`)
- Route dispatch → Winners and leaderboard: routes to (evidence: `src/routes/router.jsx`)
- Route dispatch → Profile management: routes to (evidence: `src/routes/router.jsx`)
- Sign in and register → Firebase authentication: authenticates
- Firebase authentication → Firebase Auth: uses (evidence: `src/provider/AuthProvider.jsx`)
- Firebase authentication → Auth context hook: provides context (evidence: `src/provider/AuthProvider.jsx`)
- Auth context hook → Firebase authentication: reads context (evidence: `src/hooks/useAuth.jsx`)
- Role dashboard → Role lookup: checks role (evidence: `src/layout/DashboardLayout.jsx`)
- Role lookup → Secured API client: queries role (evidence: `src/hooks/useRole.jsx`)
- Secured API client → Auth context hook: reads user (evidence: `src/hooks/useAxiosSecured.jsx`)
- Secured API client → Article Arena API: sends requests (evidence: `src/hooks/useAxiosSecured.jsx`)
- Contest details → Secured API client: loads contest (evidence: `src/pages/Details/Details.jsx`)
- Contest details → Contest payment: starts checkout (evidence: `src/pages/Details/Details.jsx`)
- Contest payment → Article Arena API: creates session (evidence: `src/pages/Details/Details.jsx`)
- Contest payment → Payment result: returns after payment (evidence: `README.md`)
- Participation tracking → Article Arena API: participates and submits (evidence: `README.md`)
- Creator management → Article Arena API: manages and declares (evidence: `README.md`)
- Admin management → Article Arena API: approves and assigns roles (evidence: `README.md`)
- Sign in and register → Profile image upload: uploads photo (evidence: `src/pages/Auth/Register.jsx`)
- Profile management → Profile image upload: uploads photo (evidence: `src/pages/Dashboard/UpdateProfile/UpdateProfile.jsx`)
- Profile image upload → Image hosting: uploads image (evidence: `src/utils/uploadImage.js`)
- Winners and leaderboard → Article Arena API: loads results (evidence: `README.md`)
