# owaysmb/gameratingdatabase architecture

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

- Interactive diagram: https://gitdiagram.com/owaysmb/gameratingdatabase
- Repository: https://github.com/owaysmb/gameratingdatabase

## Overview

This is a React game-discovery and community application backed by an Express/MongoDB service. Users browse and search IGDB’s catalogue, open game details, then optionally sign in to manage game lists, ratings, favorites, progress, reviews, and game forums. The frontend also exposes profiles and forum discussions. The graph preserves these major domains, but some frontend and backend implementations were not sampled; their links are included only where the excerpts or source index establish them.

Main entry points: [`frontend/src/App.jsx`](https://github.com/owaysmb/gameratingdatabase/blob/main/frontend/src/App.jsx) (App routing), [`backend/server.js`](https://github.com/owaysmb/gameratingdatabase/blob/main/backend/server.js) (Express server), [`frontend/src/Components/GameForum/ForumMainPage.jsx`](https://github.com/owaysmb/gameratingdatabase/blob/main/frontend/src/Components/GameForum/ForumMainPage.jsx) (Forum interface), [`backend/controllers/IGDBController.js`](https://github.com/owaysmb/gameratingdatabase/blob/main/backend/controllers/IGDBController.js) (Catalogue API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Web application"]
  node_app["App routing<br/>[App.jsx]"]
  node_authctx["Auth context<br/>[AuthContext.jsx]"]
  node_discovery["Game discovery"]
  node_advancedsearch["Advanced search<br/>[AdvancedSearch.jsx]"]
  node_details["Game details<br/>[GameDetails.jsx]"]
  node_profiles["Profiles and stats"]
end

subgraph group_catalog["Game catalogue"]
  node_igdb_routes["Catalogue routes<br/>[IGDBRouter.js]"]
  node_catalog_api["Catalogue API<br/>[IGDBController.js]"]
end

subgraph group_community["Community features"]
  node_forumui["Forum interface<br/>[ForumMainPage.jsx]"]
  node_postcreate["Post creation<br/>[CreatePost.jsx]"]
  node_comments["Post comments<br/>[PostsComments.jsx]"]
end

subgraph group_service["Backend service"]
  node_backend["Express server<br/>[server.js]"]
  node_routes["API routes<br/>[routes.js]"]
  node_user_api["User and game API<br/>[controller.js]"]
  node_models["Domain models"]
  node_cache["Redis cache<br/>[cache.js]"]
end

node_visitor(("Visitor"))
node_mongo[("MongoDB")]
node_igdb{{"IGDB service"}}
node_browser(("Browser user"))

node_visitor -->|"uses"| node_app
node_app -->|"routes to"| node_discovery
node_app -->|"routes to"| node_details
node_app -->|"routes to"| node_profiles
node_app -->|"routes to"| node_forumui
node_app -->|"routes to"| node_postcreate
node_app -->|"routes to"| node_comments
node_app -->|"provides"| node_authctx
node_authctx -->|"checks session"| node_backend
node_advancedsearch -->|"queries"| node_catalog_api
node_forumui -->|"fetches forum data"| node_backend
node_forumui -->|"renders"| node_postcreate
node_forumui -.->|"opens comments"| node_comments
node_backend -->|"mounts"| node_routes
node_backend -->|"mounts"| node_igdb_routes
node_routes -->|"dispatches"| node_user_api
node_igdb_routes -->|"dispatches"| node_catalog_api
node_catalog_api -->|"uses IGDB service"| node_backend
node_backend -->|"fetches catalogue"| node_igdb
node_user_api -->|"uses models"| node_models
node_user_api -->|"caches results"| node_cache
node_catalog_api -->|"caches queries"| node_cache
node_cache -->|"reads Redis"| node_backend
node_backend -.->|"connects"| node_mongo

click node_app "https://github.com/owaysmb/gameratingdatabase/blob/main/frontend/src/App.jsx"
click node_authctx "https://github.com/owaysmb/gameratingdatabase/blob/main/frontend/context/AuthContext.jsx"
click node_discovery "https://github.com/owaysmb/gameratingdatabase/tree/main/frontend/src/Components/HomePage"
click node_advancedsearch "https://github.com/owaysmb/gameratingdatabase/blob/main/frontend/src/Components/Search/AdvancedSearch.jsx"
click node_details "https://github.com/owaysmb/gameratingdatabase/blob/main/frontend/src/Components/GameDetailsPage/GameDetails.jsx"
click node_profiles "https://github.com/owaysmb/gameratingdatabase/tree/main/frontend/src/Components/Profile"
click node_forumui "https://github.com/owaysmb/gameratingdatabase/blob/main/frontend/src/Components/GameForum/ForumMainPage.jsx"
click node_postcreate "https://github.com/owaysmb/gameratingdatabase/blob/main/frontend/src/Components/GameForum/CreatePost.jsx"
click node_comments "https://github.com/owaysmb/gameratingdatabase/blob/main/frontend/src/Components/GameForum/PostsComments.jsx"
click node_backend "https://github.com/owaysmb/gameratingdatabase/blob/main/backend/server.js"
click node_routes "https://github.com/owaysmb/gameratingdatabase/blob/main/backend/routes/routes.js"
click node_igdb_routes "https://github.com/owaysmb/gameratingdatabase/blob/main/backend/routes/IGDBRouter.js"
click node_user_api "https://github.com/owaysmb/gameratingdatabase/blob/main/backend/controllers/controller.js"
click node_catalog_api "https://github.com/owaysmb/gameratingdatabase/blob/main/backend/controllers/IGDBController.js"
click node_models "https://github.com/owaysmb/gameratingdatabase/tree/main/backend/models"
click node_cache "https://github.com/owaysmb/gameratingdatabase/blob/main/backend/cache.js"

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_app,node_authctx,node_discovery,node_advancedsearch,node_details,node_profiles,node_browser toneBlue
class node_igdb_routes,node_catalog_api,node_mongo toneAmber
class node_forumui,node_postcreate,node_comments toneMint
class node_backend,node_routes,node_user_api,node_models,node_cache toneRose
class node_visitor,node_igdb toneIndigo
```

## Components

### Web application

- [App routing](https://github.com/owaysmb/gameratingdatabase/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Auth context](https://github.com/owaysmb/gameratingdatabase/blob/main/frontend/context/AuthContext.jsx): `frontend/context/AuthContext.jsx`
- [Game discovery](https://github.com/owaysmb/gameratingdatabase/tree/main/frontend/src/Components/HomePage): `frontend/src/Components/HomePage`
- [Advanced search](https://github.com/owaysmb/gameratingdatabase/blob/main/frontend/src/Components/Search/AdvancedSearch.jsx): `frontend/src/Components/Search/AdvancedSearch.jsx`
- [Game details](https://github.com/owaysmb/gameratingdatabase/blob/main/frontend/src/Components/GameDetailsPage/GameDetails.jsx): `frontend/src/Components/GameDetailsPage/GameDetails.jsx`
- [Profiles and stats](https://github.com/owaysmb/gameratingdatabase/tree/main/frontend/src/Components/Profile): `frontend/src/Components/Profile`

### Game catalogue

- [Catalogue routes](https://github.com/owaysmb/gameratingdatabase/blob/main/backend/routes/IGDBRouter.js): `backend/routes/IGDBRouter.js`
- [Catalogue API](https://github.com/owaysmb/gameratingdatabase/blob/main/backend/controllers/IGDBController.js): `backend/controllers/IGDBController.js`

### Community features

- [Forum interface](https://github.com/owaysmb/gameratingdatabase/blob/main/frontend/src/Components/GameForum/ForumMainPage.jsx): `frontend/src/Components/GameForum/ForumMainPage.jsx`
- [Post creation](https://github.com/owaysmb/gameratingdatabase/blob/main/frontend/src/Components/GameForum/CreatePost.jsx): `frontend/src/Components/GameForum/CreatePost.jsx`
- [Post comments](https://github.com/owaysmb/gameratingdatabase/blob/main/frontend/src/Components/GameForum/PostsComments.jsx): `frontend/src/Components/GameForum/PostsComments.jsx`

### Backend service

- [Express server](https://github.com/owaysmb/gameratingdatabase/blob/main/backend/server.js): `backend/server.js`
- [API routes](https://github.com/owaysmb/gameratingdatabase/blob/main/backend/routes/routes.js): `backend/routes/routes.js`
- [User and game API](https://github.com/owaysmb/gameratingdatabase/blob/main/backend/controllers/controller.js): `backend/controllers/controller.js`
- [Domain models](https://github.com/owaysmb/gameratingdatabase/tree/main/backend/models): `backend/models`
- [Redis cache](https://github.com/owaysmb/gameratingdatabase/blob/main/backend/cache.js): `backend/cache.js`

### Other components

- **Visitor**
- **MongoDB**
- **IGDB service**
- **Browser user**

## Connections

- Visitor → App routing: uses (evidence: `frontend/src/App.jsx`)
- App routing → Game discovery: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Game details: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Profiles and stats: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Forum interface: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Post creation: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Post comments: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Auth context: provides (evidence: `frontend/src/App.jsx`)
- Auth context → Express server: checks session (evidence: `frontend/context/AuthContext.jsx`)
- Advanced search → Catalogue API: queries (evidence: `frontend/src/Components/Search/AdvancedSearch.jsx`)
- Forum interface → Express server: fetches forum data (evidence: `frontend/src/Components/GameForum/ForumMainPage.jsx`)
- Forum interface → Post creation: renders (evidence: `frontend/src/Components/GameForum/ForumMainPage.jsx`)
- Forum interface → Post comments: opens comments
- Express server → API routes: mounts (evidence: `backend/server.js`)
- Express server → Catalogue routes: mounts (evidence: `backend/server.js`)
- API routes → User and game API: dispatches (evidence: `backend/routes/routes.js`)
- Catalogue routes → Catalogue API: dispatches (evidence: `backend/routes/IGDBRouter.js`)
- Catalogue API → Express server: uses IGDB service (evidence: `backend/controllers/IGDBController.js`)
- Express server → IGDB service: fetches catalogue (evidence: `backend/server.js`)
- User and game API → Domain models: uses models (evidence: `backend/controllers/controller.js`)
- User and game API → Redis cache: caches results (evidence: `backend/controllers/controller.js`)
- Catalogue API → Redis cache: caches queries (evidence: `backend/controllers/IGDBController.js`)
- Redis cache → Express server: reads Redis (evidence: `backend/cache.js`)
- Express server → MongoDB: connects
