# jc0510004/free_ricky architecture

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

- Interactive diagram: https://gitdiagram.com/jc0510004/free_ricky
- Repository: https://github.com/jc0510004/free_ricky

## Overview

FREE_RICKY is a game-community web application with a React client and Django API. Visitors browse the public landing page; account registration, login, and session restoration support access to protected game, settings, and administration areas. The backend also has distinct user, game, email, and admin capabilities. The excerpts show client authentication and API mechanics plus backend authentication and security behavior; several domain endpoints are represented from the file tree and source index, so their internal call paths are not asserted.

Main entry points: [`frontend/src/main.jsx`](https://github.com/jc0510004/free_ricky/blob/main/frontend/src/main.jsx) (Router and entry), [`frontend/src/services/authService.js`](https://github.com/jc0510004/free_ricky/blob/main/frontend/src/services/authService.js) (Auth API service), [`frontend/src/pages`](https://github.com/jc0510004/free_ricky/tree/main/frontend/src/pages) (Account and game pages), [`frontend/src/contexts/AuthContext.jsx`](https://github.com/jc0510004/free_ricky/blob/main/frontend/src/contexts/AuthContext.jsx) (Session provider)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_frontend_entry["Router and entry<br/>[main.jsx]"]
  node_landing["Public landing<br/>[App.jsx]"]
  node_client_pages["Account and game pages"]
  node_admin_page["Admin dashboard<br/>[Admin.jsx]"]
end

subgraph group_identity["Identity and access"]
  node_auth_provider["Session provider<br/>[AuthContext.jsx]"]
  node_auth_hook["Auth consumer hook<br/>[useAuth.js]"]
  node_auth_service["Auth API service<br/>[authService.js]"]
  node_token_store["Access token state<br/>[tokenStore.js]"]
  node_http_client["HTTP client<br/>[axios.js]"]
end

subgraph group_api["Backend API"]
  node_backend_auth["Authentication endpoints<br/>[views_auth.py]"]
  node_serializers["Request serializers<br/>[serializers.py]"]
  node_user_models[("User and game data<br/>[models.py]")]
  node_domain_views["Game and user APIs"]
  node_email_views["Email workflows<br/>[views_email.py]"]
  node_admin_views["Admin API<br/>[views_admin.py]"]
end

subgraph group_security["Security and operations"]
  node_security_middleware["Request security<br/>[middleware.py]"]
  node_admin_site["Hardened admin login<br/>[admin_site.py]"]
  node_cache[("Django cache")]
end

node_visitor(("Visitor"))
node_browser(("Browser user"))

node_visitor -->|"opens"| node_frontend_entry
node_browser -.->|"uses"| node_frontend_entry
node_frontend_entry -->|"routes to"| node_landing
node_frontend_entry -->|"routes to"| node_client_pages
node_frontend_entry -->|"wraps routes"| node_auth_provider
node_frontend_entry -->|"lazy-loads"| node_admin_page
node_landing -->|"reads session"| node_auth_hook
node_auth_provider -->|"calls"| node_auth_service
node_auth_hook -->|"reads context"| node_auth_provider
node_auth_service -->|"sends requests"| node_http_client
node_auth_service -->|"updates token"| node_token_store
node_http_client -->|"reads and updates"| node_token_store
node_auth_service -.->|"calls auth routes"| node_backend_auth
node_backend_auth -->|"validates input"| node_serializers
node_serializers -->|"uses models"| node_user_models
node_client_pages -.->|"requests domain APIs"| node_domain_views
node_client_pages -.->|"requests email APIs"| node_email_views
node_admin_page -.->|"requests admin APIs"| node_admin_views
node_admin_site -->|"checks IP"| node_security_middleware
node_admin_site -.->|"throttles via"| node_cache
node_security_middleware -->|"tracks attempts"| node_cache

click node_frontend_entry "https://github.com/jc0510004/free_ricky/blob/main/frontend/src/main.jsx"
click node_landing "https://github.com/jc0510004/free_ricky/blob/main/frontend/src/App.jsx"
click node_client_pages "https://github.com/jc0510004/free_ricky/tree/main/frontend/src/pages"
click node_admin_page "https://github.com/jc0510004/free_ricky/blob/main/frontend/src/pages/Admin.jsx"
click node_auth_provider "https://github.com/jc0510004/free_ricky/blob/main/frontend/src/contexts/AuthContext.jsx"
click node_auth_hook "https://github.com/jc0510004/free_ricky/blob/main/frontend/src/contexts/useAuth.js"
click node_auth_service "https://github.com/jc0510004/free_ricky/blob/main/frontend/src/services/authService.js"
click node_token_store "https://github.com/jc0510004/free_ricky/blob/main/frontend/src/api/tokenStore.js"
click node_http_client "https://github.com/jc0510004/free_ricky/blob/main/frontend/src/api/axios.js"
click node_backend_auth "https://github.com/jc0510004/free_ricky/blob/main/backend/api/views_auth.py"
click node_serializers "https://github.com/jc0510004/free_ricky/blob/main/backend/api/serializers.py"
click node_user_models "https://github.com/jc0510004/free_ricky/blob/main/backend/api/models.py"
click node_domain_views "https://github.com/jc0510004/free_ricky/tree/main/backend/api"
click node_email_views "https://github.com/jc0510004/free_ricky/blob/main/backend/api/views_email.py"
click node_admin_views "https://github.com/jc0510004/free_ricky/blob/main/backend/api/views_admin.py"
click node_security_middleware "https://github.com/jc0510004/free_ricky/blob/main/backend/api/middleware.py"
click node_admin_site "https://github.com/jc0510004/free_ricky/blob/main/backend/config/admin_site.py"

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_frontend_entry,node_landing,node_client_pages,node_admin_page,node_browser toneBlue
class node_auth_provider,node_auth_hook,node_auth_service,node_token_store,node_http_client toneAmber
class node_backend_auth,node_serializers,node_user_models,node_domain_views,node_email_views,node_admin_views toneMint
class node_security_middleware,node_admin_site,node_cache toneRose
class node_visitor toneIndigo
```

## Components

### Web client

- [Router and entry](https://github.com/jc0510004/free_ricky/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`
- [Public landing](https://github.com/jc0510004/free_ricky/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Account and game pages](https://github.com/jc0510004/free_ricky/tree/main/frontend/src/pages): `frontend/src/pages`
- [Admin dashboard](https://github.com/jc0510004/free_ricky/blob/main/frontend/src/pages/Admin.jsx): `frontend/src/pages/Admin.jsx`

### Identity and access

- [Session provider](https://github.com/jc0510004/free_ricky/blob/main/frontend/src/contexts/AuthContext.jsx): `frontend/src/contexts/AuthContext.jsx`
- [Auth consumer hook](https://github.com/jc0510004/free_ricky/blob/main/frontend/src/contexts/useAuth.js): `frontend/src/contexts/useAuth.js`
- [Auth API service](https://github.com/jc0510004/free_ricky/blob/main/frontend/src/services/authService.js): `frontend/src/services/authService.js`
- [Access token state](https://github.com/jc0510004/free_ricky/blob/main/frontend/src/api/tokenStore.js): `frontend/src/api/tokenStore.js`
- [HTTP client](https://github.com/jc0510004/free_ricky/blob/main/frontend/src/api/axios.js): `frontend/src/api/axios.js`

### Backend API

- [Authentication endpoints](https://github.com/jc0510004/free_ricky/blob/main/backend/api/views_auth.py): `backend/api/views_auth.py`
- [Request serializers](https://github.com/jc0510004/free_ricky/blob/main/backend/api/serializers.py): `backend/api/serializers.py`
- [User and game data](https://github.com/jc0510004/free_ricky/blob/main/backend/api/models.py): `backend/api/models.py`
- [Game and user APIs](https://github.com/jc0510004/free_ricky/tree/main/backend/api): `backend/api`
- [Email workflows](https://github.com/jc0510004/free_ricky/blob/main/backend/api/views_email.py): `backend/api/views_email.py`
- [Admin API](https://github.com/jc0510004/free_ricky/blob/main/backend/api/views_admin.py): `backend/api/views_admin.py`

### Security and operations

- [Request security](https://github.com/jc0510004/free_ricky/blob/main/backend/api/middleware.py): `backend/api/middleware.py`
- [Hardened admin login](https://github.com/jc0510004/free_ricky/blob/main/backend/config/admin_site.py): `backend/config/admin_site.py`
- **Django cache**

### Other components

- **Visitor**
- **Browser user**

## Connections

- Visitor → Router and entry: opens (evidence: `frontend/src/main.jsx`)
- Browser user → Router and entry: uses
- Router and entry → Public landing: routes to (evidence: `frontend/src/main.jsx`)
- Router and entry → Account and game pages: routes to (evidence: `frontend/src/main.jsx`)
- Router and entry → Session provider: wraps routes (evidence: `frontend/src/main.jsx`)
- Router and entry → Admin dashboard: lazy-loads
- Public landing → Auth consumer hook: reads session (evidence: `frontend/src/App.jsx`)
- Session provider → Auth API service: calls (evidence: `frontend/src/contexts/AuthContext.jsx`)
- Auth consumer hook → Session provider: reads context (evidence: `frontend/src/contexts/useAuth.js`)
- Auth API service → HTTP client: sends requests (evidence: `frontend/src/services/authService.js`)
- Auth API service → Access token state: updates token (evidence: `frontend/src/services/authService.js`)
- HTTP client → Access token state: reads and updates (evidence: `frontend/src/api/axios.js`)
- Auth API service → Authentication endpoints: calls auth routes
- Authentication endpoints → Request serializers: validates input (evidence: `backend/api/views_auth.py`)
- Request serializers → User and game data: uses models (evidence: `backend/api/serializers.py`)
- Account and game pages → Game and user APIs: requests domain APIs
- Account and game pages → Email workflows: requests email APIs
- Admin dashboard → Admin API: requests admin APIs
- Hardened admin login → Request security: checks IP (evidence: `backend/config/admin_site.py`)
- Hardened admin login → Django cache: throttles via
- Request security → Django cache: tracks attempts (evidence: `backend/api/middleware.py`)
