# ofir01/game-on-next-react architecture

> Architecture diagram of the GitHub repository ofir01/game-on-next-react, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ofir01/game-on-next-react
- Repository: https://github.com/ofir01/game-on-next-react

## Overview

This repository is a game-discovery and play portal, with account features, community interactions, administration, and several auxiliary experiences. The main visitor workflow is browsing or filtering games, opening a game page, and starting play; logged-in users can also manage a library or wishlist and contribute ratings and comments. Server services and Sequelize models form the internal data layer. The README also describes a Classroom feature and an AI assistant. Many routes and dashboard modules were not sampled, so their detailed call paths are not asserted here.

Main entry points: [`db/models/index.js`](https://github.com/ofir01/game-on-next-react/blob/main/db/models/index.js) (Application database), [`app/Search/page.jsx`](https://github.com/ofir01/game-on-next-react/blob/main/app/Search/page.jsx) (Game search), [`app/hooks/useGame.js`](https://github.com/ofir01/game-on-next-react/blob/main/app/hooks/useGame.js) (Game data hook), [`services/server/gameSessionService.js`](https://github.com/ofir01/game-on-next-react/blob/main/services/server/gameSessionService.js) (Game sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Game discovery"]
  node_home["Home page<br/>[page.jsx]"]
  node_search["Game search<br/>[page.jsx]"]
  node_gamepage["Game details<br/>[page.jsx]"]
  node_gamehook["Game data hook<br/>[useGame.js]"]
  node_gamecard["Game card<br/>[Card.jsx]"]
  node_editor["Game editor<br/>[EditingGame.jsx]"]
end

subgraph group_accounts["Accounts and community"]
  node_comments["Game comments<br/>[GameComments.jsx]"]
  node_auth["Auth context<br/>[AuthContext.jsx]"]
  node_authclient["Auth client<br/>[authService.js]"]
end

subgraph group_server["Server and data"]
  node_apiclient["API client<br/>[api-client.js]"]
  node_authservice["Auth service<br/>[AuthService.js]"]
  node_gameservice["Game service<br/>[GameService.js]"]
  node_sessions["Game sessions"]
  node_sessionroute["Session API<br/>[route.js]"]
  node_chat["AI assistant API<br/>[route.js]"]
  node_database[("Application database<br/>[index.js]")]
end

subgraph group_admin["Administration"]
  node_adminui["Admin dashboard"]
  node_adminapi["Admin APIs"]
  node_news["News management<br/>[page.jsx]"]
end

subgraph group_extras["Other experiences"]
  node_classroom["Classroom<br/>[page.jsx]"]
  node_cookjoy["CookJoy<br/>[page.jsx]"]
  node_movienest["MovieNest<br/>[page.jsx]"]
  node_weather["Weather app<br/>[page.jsx]"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_home
node_visitor -->|"searches"| node_search
node_search -->|"loads games"| node_gamehook
node_search -->|"renders results"| node_gamecard
node_gamepage -->|"loads game"| node_gamehook
node_gamepage -->|"shows comments"| node_comments
node_gamehook -->|"uses service"| node_gameservice
node_auth -->|"uses service"| node_authclient
node_authclient -->|"sends requests"| node_apiclient
node_authservice -->|"reads and writes"| node_database
node_authservice -->|"creates session"| node_sessions
node_gameservice -->|"queries data"| node_database
node_sessionroute -->|"delegates"| node_sessions
node_sessions -->|"updates sessions"| node_database
node_chat -->|"queries data"| node_database
node_adminui -.->|"manages records"| node_adminapi
node_news -.->|"manages news"| node_adminapi

click node_home "https://github.com/ofir01/game-on-next-react/blob/main/app/page.jsx"
click node_search "https://github.com/ofir01/game-on-next-react/blob/main/app/Search/page.jsx"
click node_gamepage "https://github.com/ofir01/game-on-next-react/blob/main/app/%5BSlug%5D/page.jsx"
click node_gamehook "https://github.com/ofir01/game-on-next-react/blob/main/app/hooks/useGame.js"
click node_gamecard "https://github.com/ofir01/game-on-next-react/blob/main/app/Component/Card/Card.jsx"
click node_editor "https://github.com/ofir01/game-on-next-react/blob/main/app/Component/Card/EditingGame.jsx"
click node_comments "https://github.com/ofir01/game-on-next-react/blob/main/app/Component/Comment/GameComments.jsx"
click node_auth "https://github.com/ofir01/game-on-next-react/blob/main/app/Context/AuthContext.jsx"
click node_authclient "https://github.com/ofir01/game-on-next-react/blob/main/services/client/authService.js"
click node_apiclient "https://github.com/ofir01/game-on-next-react/blob/main/lib/api-client.js"
click node_authservice "https://github.com/ofir01/game-on-next-react/blob/main/services/server/AuthService.js"
click node_gameservice "https://github.com/ofir01/game-on-next-react/blob/main/services/server/GameService.js"
click node_sessions "https://github.com/ofir01/game-on-next-react/blob/main/services/server/gameSessionService.js"
click node_sessionroute "https://github.com/ofir01/game-on-next-react/blob/main/app/api/game-session/route.js"
click node_chat "https://github.com/ofir01/game-on-next-react/blob/main/app/api/chat/route.js"
click node_database "https://github.com/ofir01/game-on-next-react/blob/main/db/models/index.js"
click node_adminui "https://github.com/ofir01/game-on-next-react/tree/main/app/dashboard"
click node_adminapi "https://github.com/ofir01/game-on-next-react/tree/main/app/api/admin"
click node_news "https://github.com/ofir01/game-on-next-react/blob/main/app/dashboard/NewsManager/page.jsx"
click node_classroom "https://github.com/ofir01/game-on-next-react/blob/main/app/other/Classroom/page.jsx"
click node_cookjoy "https://github.com/ofir01/game-on-next-react/blob/main/app/other/CookJoy/page.jsx"
click node_movienest "https://github.com/ofir01/game-on-next-react/blob/main/app/other/MovieNest/page.jsx"
click node_weather "https://github.com/ofir01/game-on-next-react/blob/main/app/other/WeatherApp/page.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_home,node_search,node_gamepage,node_gamehook,node_gamecard,node_editor toneBlue
class node_comments,node_auth,node_authclient toneAmber
class node_apiclient,node_authservice,node_gameservice,node_sessions,node_sessionroute,node_chat,node_database toneMint
class node_adminui,node_adminapi,node_news toneRose
class node_classroom,node_cookjoy,node_movienest,node_weather,node_visitor toneIndigo
```

## Components

### Game discovery

- [Home page](https://github.com/ofir01/game-on-next-react/blob/main/app/page.jsx): `app/page.jsx`
- [Game search](https://github.com/ofir01/game-on-next-react/blob/main/app/Search/page.jsx): `app/Search/page.jsx`
- [Game details](https://github.com/ofir01/game-on-next-react/blob/main/app/%5BSlug%5D/page.jsx): `app/[Slug]/page.jsx`
- [Game data hook](https://github.com/ofir01/game-on-next-react/blob/main/app/hooks/useGame.js): `app/hooks/useGame.js`
- [Game card](https://github.com/ofir01/game-on-next-react/blob/main/app/Component/Card/Card.jsx): `app/Component/Card/Card.jsx`
- [Game editor](https://github.com/ofir01/game-on-next-react/blob/main/app/Component/Card/EditingGame.jsx): `app/Component/Card/EditingGame.jsx`

### Accounts and community

- [Game comments](https://github.com/ofir01/game-on-next-react/blob/main/app/Component/Comment/GameComments.jsx): `app/Component/Comment/GameComments.jsx`
- [Auth context](https://github.com/ofir01/game-on-next-react/blob/main/app/Context/AuthContext.jsx): `app/Context/AuthContext.jsx`
- [Auth client](https://github.com/ofir01/game-on-next-react/blob/main/services/client/authService.js): `services/client/authService.js`

### Server and data

- [API client](https://github.com/ofir01/game-on-next-react/blob/main/lib/api-client.js): `lib/api-client.js`
- [Auth service](https://github.com/ofir01/game-on-next-react/blob/main/services/server/AuthService.js): `services/server/AuthService.js`
- [Game service](https://github.com/ofir01/game-on-next-react/blob/main/services/server/GameService.js): `services/server/GameService.js`
- [Game sessions](https://github.com/ofir01/game-on-next-react/blob/main/services/server/gameSessionService.js): `services/server/gameSessionService.js`
- [Session API](https://github.com/ofir01/game-on-next-react/blob/main/app/api/game-session/route.js): `app/api/game-session/route.js`
- [AI assistant API](https://github.com/ofir01/game-on-next-react/blob/main/app/api/chat/route.js): `app/api/chat/route.js`
- [Application database](https://github.com/ofir01/game-on-next-react/blob/main/db/models/index.js): `db/models/index.js`

### Administration

- [Admin dashboard](https://github.com/ofir01/game-on-next-react/tree/main/app/dashboard): `app/dashboard`
- [Admin APIs](https://github.com/ofir01/game-on-next-react/tree/main/app/api/admin): `app/api/admin`
- [News management](https://github.com/ofir01/game-on-next-react/blob/main/app/dashboard/NewsManager/page.jsx): `app/dashboard/NewsManager/page.jsx`

### Other experiences

- [Classroom](https://github.com/ofir01/game-on-next-react/blob/main/app/other/Classroom/page.jsx): `app/other/Classroom/page.jsx`
- [CookJoy](https://github.com/ofir01/game-on-next-react/blob/main/app/other/CookJoy/page.jsx): `app/other/CookJoy/page.jsx`
- [MovieNest](https://github.com/ofir01/game-on-next-react/blob/main/app/other/MovieNest/page.jsx): `app/other/MovieNest/page.jsx`
- [Weather app](https://github.com/ofir01/game-on-next-react/blob/main/app/other/WeatherApp/page.jsx): `app/other/WeatherApp/page.jsx`

### Other components

- **Visitor**

## Connections

- Visitor → Home page: opens (evidence: `app/page.jsx`)
- Visitor → Game search: searches (evidence: `app/Search/page.jsx`)
- Game search → Game data hook: loads games (evidence: `app/Search/page.jsx`)
- Game search → Game card: renders results (evidence: `app/Search/page.jsx`)
- Game details → Game data hook: loads game (evidence: `app/[Slug]/page.jsx`)
- Game details → Game comments: shows comments (evidence: `app/[Slug]/page.jsx`)
- Game data hook → Game service: uses service (evidence: `app/hooks/useGame.js`)
- Auth context → Auth client: uses service (evidence: `app/Context/AuthContext.jsx`)
- Auth client → API client: sends requests (evidence: `services/client/authService.js`)
- Auth service → Application database: reads and writes (evidence: `services/server/AuthService.js`)
- Auth service → Game sessions: creates session (evidence: `services/server/AuthService.js`)
- Game service → Application database: queries data (evidence: `services/server/GameService.js`)
- Session API → Game sessions: delegates (evidence: `app/api/game-session/route.js`)
- Game sessions → Application database: updates sessions (evidence: `services/server/gameSessionService.js`)
- AI assistant API → Application database: queries data (evidence: `app/api/chat/route.js`)
- Admin dashboard → Admin APIs: manages records
- News management → Admin APIs: manages news
