# rfned/astralteam architecture

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

- Interactive diagram: https://gitdiagram.com/rfned/astralteam
- Repository: https://github.com/rfned/astralteam

## Overview

Astral Team is a game-store and gaming-platform web application. Its visible workflow runs from account registration or login through HTTP requests, backend user services, and session/profile state; registration also includes email verification. The backend exposes a separate balance/payment capability, while the frontend includes game, community, news, profile, and launcher pages. The graph follows documented and indexed imports; game-catalog, library, ratings, and statistics behavior is described in the README but is not established by the sampled implementation. Backend wiring beyond indexed references is not assumed.

Main entry points: [`backend/api/dependencies.py`](https://github.com/rfned/astralteam/blob/main/backend/api/dependencies.py) (Dependency wiring), [`frontend/src/core.tsx`](https://github.com/rfned/astralteam/blob/main/frontend/src/core.tsx) (Page routing), [`frontend/src/Api/client.ts`](https://github.com/rfned/astralteam/blob/main/frontend/src/Api/client.ts) (HTTP client), [`backend/services/user.py`](https://github.com/rfned/astralteam/blob/main/backend/services/user.py) (User workflows)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web client"]
  node_frontend_app["Page routing<br/>[core.tsx]"]
  node_main_page["Launcher home<br/>[main.tsx]"]
  node_game_pages["Games &amp; community<br/>[games.tsx]"]
  node_news_page["News<br/>[news.tsx]"]
  node_profile_page["Profile<br/>[profile.tsx]"]
  node_auth_page["Login<br/>[auth.tsx]"]
  node_register_page["Registration<br/>[reg.tsx]"]
  node_verify_page["Email verification<br/>[verifyemail.tsx]"]
  node_auth_state["Session state<br/>[authContext.tsx]"]
  node_api_client["HTTP client<br/>[client.ts]"]
end

subgraph group_api["Backend API"]
  node_user_api["User endpoints<br/>[user.py]"]
  node_balance_api["Balance endpoints<br/>[balance.py]"]
  node_dependencies["Dependency wiring<br/>[dependencies.py]"]
end

subgraph group_domain["Domain services"]
  node_user_service["User workflows<br/>[user.py]"]
  node_balance_service["Payment workflow<br/>[balance.py]"]
  node_user_repository["User records<br/>[user.py]"]
  node_balance_repository["Balance records<br/>[balance.py]"]
end

subgraph group_infra["Infrastructure"]
  node_email_service["Verification email<br/>[email.py]"]
  node_database[("MySQL<br/>[database.py]")]
  node_redis[("Redis<br/>[redis.py]")]
  node_yookassa["YooKassa<br/>[yookassa.py]"]
end

node_visitor(("Visitor"))

node_visitor -->|"uses"| node_frontend_app
node_frontend_app -->|"routes to"| node_main_page
node_frontend_app -->|"routes to"| node_game_pages
node_frontend_app -->|"routes to"| node_news_page
node_frontend_app -->|"routes to"| node_profile_page
node_frontend_app -->|"routes to"| node_auth_page
node_frontend_app -->|"routes to"| node_register_page
node_frontend_app -->|"routes to"| node_verify_page
node_auth_page -->|"calls"| node_api_client
node_register_page -->|"calls"| node_api_client
node_verify_page -->|"calls"| node_api_client
node_auth_state -->|"loads session"| node_api_client
node_api_client -->|"HTTP requests"| node_user_api
node_user_api -->|"resolves services"| node_dependencies
node_balance_api -->|"resolves services"| node_dependencies
node_dependencies -->|"constructs"| node_user_service
node_dependencies -->|"constructs"| node_balance_service
node_dependencies -->|"constructs"| node_user_repository
node_dependencies -->|"constructs"| node_balance_repository
node_dependencies -->|"gets connection"| node_database
node_dependencies -->|"gets client"| node_redis
node_dependencies -->|"constructs"| node_email_service
node_dependencies -->|"gets client"| node_yookassa
node_user_service -->|"reads and writes"| node_user_repository
node_user_service -->|"sends verification"| node_email_service
node_user_service -->|"stores sessions"| node_redis
node_balance_service -->|"reads and writes"| node_balance_repository
node_balance_service -->|"checks session"| node_redis
node_balance_service -->|"creates payment"| node_yookassa
node_user_repository -.->|"executes SQL"| node_database
node_balance_repository -.->|"executes SQL"| node_database

click node_frontend_app "https://github.com/rfned/astralteam/blob/main/frontend/src/core.tsx"
click node_main_page "https://github.com/rfned/astralteam/blob/main/frontend/src/Pages/Main/main.tsx"
click node_game_pages "https://github.com/rfned/astralteam/blob/main/frontend/src/Pages/Games/games.tsx"
click node_news_page "https://github.com/rfned/astralteam/blob/main/frontend/src/Pages/News/news.tsx"
click node_profile_page "https://github.com/rfned/astralteam/blob/main/frontend/src/Pages/Profile/profile.tsx"
click node_auth_page "https://github.com/rfned/astralteam/blob/main/frontend/src/Pages/Auth/auth.tsx"
click node_register_page "https://github.com/rfned/astralteam/blob/main/frontend/src/Pages/Auth/Reg/reg.tsx"
click node_verify_page "https://github.com/rfned/astralteam/blob/main/frontend/src/Pages/Special/VerifyEmail/verifyemail.tsx"
click node_auth_state "https://github.com/rfned/astralteam/blob/main/frontend/src/Contexts/authContext.tsx"
click node_api_client "https://github.com/rfned/astralteam/blob/main/frontend/src/Api/client.ts"
click node_user_api "https://github.com/rfned/astralteam/blob/main/backend/api/user.py"
click node_balance_api "https://github.com/rfned/astralteam/blob/main/backend/api/balance.py"
click node_dependencies "https://github.com/rfned/astralteam/blob/main/backend/api/dependencies.py"
click node_user_service "https://github.com/rfned/astralteam/blob/main/backend/services/user.py"
click node_balance_service "https://github.com/rfned/astralteam/blob/main/backend/services/balance.py"
click node_user_repository "https://github.com/rfned/astralteam/blob/main/backend/repositories/user.py"
click node_balance_repository "https://github.com/rfned/astralteam/blob/main/backend/repositories/balance.py"
click node_email_service "https://github.com/rfned/astralteam/blob/main/backend/core/email.py"
click node_database "https://github.com/rfned/astralteam/blob/main/backend/core/database.py"
click node_redis "https://github.com/rfned/astralteam/blob/main/backend/core/redis.py"
click node_yookassa "https://github.com/rfned/astralteam/blob/main/backend/core/yookassa.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_app,node_main_page,node_game_pages,node_news_page,node_profile_page,node_auth_page,node_register_page,node_verify_page,node_auth_state,node_api_client toneBlue
class node_user_api,node_balance_api,node_dependencies toneAmber
class node_user_service,node_balance_service,node_user_repository,node_balance_repository toneMint
class node_email_service,node_database,node_redis,node_yookassa toneRose
class node_visitor toneIndigo
```

## Components

### Web client

- [Page routing](https://github.com/rfned/astralteam/blob/main/frontend/src/core.tsx): `frontend/src/core.tsx`
- [Launcher home](https://github.com/rfned/astralteam/blob/main/frontend/src/Pages/Main/main.tsx): `frontend/src/Pages/Main/main.tsx`
- [Games & community](https://github.com/rfned/astralteam/blob/main/frontend/src/Pages/Games/games.tsx): `frontend/src/Pages/Games/games.tsx`
- [News](https://github.com/rfned/astralteam/blob/main/frontend/src/Pages/News/news.tsx): `frontend/src/Pages/News/news.tsx`
- [Profile](https://github.com/rfned/astralteam/blob/main/frontend/src/Pages/Profile/profile.tsx): `frontend/src/Pages/Profile/profile.tsx`
- [Login](https://github.com/rfned/astralteam/blob/main/frontend/src/Pages/Auth/auth.tsx): `frontend/src/Pages/Auth/auth.tsx`
- [Registration](https://github.com/rfned/astralteam/blob/main/frontend/src/Pages/Auth/Reg/reg.tsx): `frontend/src/Pages/Auth/Reg/reg.tsx`
- [Email verification](https://github.com/rfned/astralteam/blob/main/frontend/src/Pages/Special/VerifyEmail/verifyemail.tsx): `frontend/src/Pages/Special/VerifyEmail/verifyemail.tsx`
- [Session state](https://github.com/rfned/astralteam/blob/main/frontend/src/Contexts/authContext.tsx): `frontend/src/Contexts/authContext.tsx`
- [HTTP client](https://github.com/rfned/astralteam/blob/main/frontend/src/Api/client.ts): `frontend/src/Api/client.ts`

### Backend API

- [User endpoints](https://github.com/rfned/astralteam/blob/main/backend/api/user.py): `backend/api/user.py`
- [Balance endpoints](https://github.com/rfned/astralteam/blob/main/backend/api/balance.py): `backend/api/balance.py`
- [Dependency wiring](https://github.com/rfned/astralteam/blob/main/backend/api/dependencies.py): `backend/api/dependencies.py`

### Domain services

- [User workflows](https://github.com/rfned/astralteam/blob/main/backend/services/user.py): `backend/services/user.py`
- [Payment workflow](https://github.com/rfned/astralteam/blob/main/backend/services/balance.py): `backend/services/balance.py`
- [User records](https://github.com/rfned/astralteam/blob/main/backend/repositories/user.py): `backend/repositories/user.py`
- [Balance records](https://github.com/rfned/astralteam/blob/main/backend/repositories/balance.py): `backend/repositories/balance.py`

### Infrastructure

- [Verification email](https://github.com/rfned/astralteam/blob/main/backend/core/email.py): `backend/core/email.py`
- [MySQL](https://github.com/rfned/astralteam/blob/main/backend/core/database.py): `backend/core/database.py`
- [Redis](https://github.com/rfned/astralteam/blob/main/backend/core/redis.py): `backend/core/redis.py`
- [YooKassa](https://github.com/rfned/astralteam/blob/main/backend/core/yookassa.py): `backend/core/yookassa.py`

### Other components

- **Visitor**

## Connections

- Visitor → Page routing: uses (evidence: `README.md`)
- Page routing → Launcher home: routes to (evidence: `frontend/src/core.tsx`)
- Page routing → Games & community: routes to (evidence: `frontend/src/core.tsx`)
- Page routing → News: routes to (evidence: `frontend/src/core.tsx`)
- Page routing → Profile: routes to (evidence: `frontend/src/core.tsx`)
- Page routing → Login: routes to (evidence: `frontend/src/core.tsx`)
- Page routing → Registration: routes to (evidence: `frontend/src/core.tsx`)
- Page routing → Email verification: routes to (evidence: `frontend/src/core.tsx`)
- Login → HTTP client: calls (evidence: `frontend/src/Pages/Auth/auth.tsx`)
- Registration → HTTP client: calls (evidence: `frontend/src/Pages/Auth/Reg/reg.tsx`)
- Email verification → HTTP client: calls (evidence: `frontend/src/Pages/Special/VerifyEmail/verifyemail.tsx`)
- Session state → HTTP client: loads session (evidence: `frontend/src/Contexts/authContext.tsx`)
- HTTP client → User endpoints: HTTP requests (evidence: `README.md`)
- User endpoints → Dependency wiring: resolves services (evidence: `backend/api/user.py`)
- Balance endpoints → Dependency wiring: resolves services (evidence: `backend/api/balance.py`)
- Dependency wiring → User workflows: constructs (evidence: `backend/api/dependencies.py`)
- Dependency wiring → Payment workflow: constructs (evidence: `backend/api/dependencies.py`)
- Dependency wiring → User records: constructs (evidence: `backend/api/dependencies.py`)
- Dependency wiring → Balance records: constructs (evidence: `backend/api/dependencies.py`)
- Dependency wiring → MySQL: gets connection (evidence: `backend/api/dependencies.py`)
- Dependency wiring → Redis: gets client (evidence: `backend/api/dependencies.py`)
- Dependency wiring → Verification email: constructs (evidence: `backend/api/dependencies.py`)
- Dependency wiring → YooKassa: gets client (evidence: `backend/api/dependencies.py`)
- User workflows → User records: reads and writes (evidence: `backend/services/user.py`)
- User workflows → Verification email: sends verification (evidence: `backend/services/user.py`)
- User workflows → Redis: stores sessions (evidence: `backend/services/user.py`)
- Payment workflow → Balance records: reads and writes (evidence: `backend/services/balance.py`)
- Payment workflow → Redis: checks session (evidence: `backend/services/balance.py`)
- Payment workflow → YooKassa: creates payment (evidence: `backend/services/balance.py`)
- User records → MySQL: executes SQL
- Balance records → MySQL: executes SQL
