# andowna9/myvideogamesxp architecture

> Architecture diagram of the GitHub repository andowna9/myvideogamesxp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/andowna9/myvideogamesxp
- Repository: https://github.com/andowna9/myvideogamesxp

## Overview

##### Main Components Identification
The system consists of four main components:
- Frontend (React.js application)
- Gateway (Nginx)
- Users Backend (Python/Flask service)
- Videogames Backend (Node.js service)

##### Component Relationships and Data Flow

- Frontend → Gateway: HTTP/REST requests
- Gateway → Backend Services: Proxied requests
- Videogames Backend → IGDB API: External API calls
- Users Backend → Google OAuth: Authentication flow

##### Specific Component Details

Frontend (React.js):
- Main routes (/login, /signup, /games, /my-list)
- Components structure
- API communication layer (axios)

Gateway (Nginx):
- Routing paths
- Error handling configuration
- Load balancing if applicable

Users Backend (Python):
- Authentication endpoints
- User management
- Database interactions

Videogames Backend (Node.js):
- Game list management
- IGDB API integration
- Models (list.js, videogame.js)

##### Additional Elements

- Docker containers boundaries (show containerization)
- Environment variables configuration
- Database connections
- Authentication flow
- API endpoints

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Frontend["Frontend (React)"]
        UserMgmt["User Management"]
        GameMgmt["Game Management"]
        StateMgmt["State Management"]
        
        Frontend --> UserMgmt
        Frontend --> GameMgmt
        Frontend --> StateMgmt
        
        subgraph UserComponents
            Login["Login Form"]
            Signup["Signup Form"]
            UserMgmt --> Login
            UserMgmt --> Signup
        end
        
        subgraph GameComponents
            GameList["Game List"]
            GameDetail["Game Detail"]
            GameSearch["Game Search"]
            MyList["My List"]
            GameMgmt --> GameList
            GameMgmt --> GameDetail
            GameMgmt --> GameSearch
            GameMgmt --> MyList
        end
    end
    
    Gateway["Nginx Gateway"]
    
    subgraph "Backend Services"
        UsersBackend["Users Backend (Python/Flask)"]
        VideogamesBackend["Videogames Backend (Node.js)"]
        
        subgraph "Users Components"
            UserApp["App"]
            UserDB["Database"]
            UserSchemas["Schemas"]
            UsersBackend --> UserApp
            UserApp --> UserDB
            UserApp --> UserSchemas
        end
        
        subgraph "Videogames Components"
            VGApp["App"]
            ListModel["List Model"]
            GameModel["Game Model"]
            AuthMiddleware["Auth Middleware"]
            ListRoutes["List Routes"]
            GameRoutes["Game Routes"]
            
            VideogamesBackend --> VGApp
            VGApp --> ListModel
            VGApp --> GameModel
            VGApp --> AuthMiddleware
            VGApp --> ListRoutes
            VGApp --> GameRoutes
        end
    end
    
    ExternalIGDB["IGDB API"]
    GoogleOAuth["Google OAuth"]
    
    Frontend --> Gateway
    Gateway --> UsersBackend
    Gateway --> VideogamesBackend
    VideogamesBackend --> ExternalIGDB
    UsersBackend --> GoogleOAuth
    
    %% Click events for component mapping
    click Frontend "https://github.com/Andowna9/MyVideogamesXP/tree/main/frontend"
    click Login "https://github.com/Andowna9/MyVideogamesXP/blob/main/frontend/src/components/LoginForm.js"
    click Signup "https://github.com/Andowna9/MyVideogamesXP/blob/main/frontend/src/components/SignupForm.js"
    click GameList "https://github.com/Andowna9/MyVideogamesXP/blob/main/frontend/src/components/GameList.js"
    click GameDetail "https://github.com/Andowna9/MyVideogamesXP/blob/main/frontend/src/pages/GameDetail.js"
    click GameSearch "https://github.com/Andowna9/MyVideogamesXP/blob/main/frontend/src/pages/GameSearch.js"
    click MyList "https://github.com/Andowna9/MyVideogamesXP/blob/main/frontend/src/pages/MyList.js"
    click StateMgmt "https://github.com/Andowna9/MyVideogamesXP/blob/main/frontend/src/context/UserContext.js"
    click Gateway "https://github.com/Andowna9/MyVideogamesXP/blob/main/gateway/nginx.conf"
    click UserApp "https://github.com/Andowna9/MyVideogamesXP/blob/main/users-backend/src/app.py"
    click UserDB "https://github.com/Andowna9/MyVideogamesXP/blob/main/users-backend/src/db.py"
    click UserSchemas "https://github.com/Andowna9/MyVideogamesXP/blob/main/users-backend/src/schemas.py"
    click VGApp "https://github.com/Andowna9/MyVideogamesXP/blob/main/videogames-backend/src/app.js"
    click ListModel "https://github.com/Andowna9/MyVideogamesXP/blob/main/videogames-backend/src/models/list.js"
    click GameModel "https://github.com/Andowna9/MyVideogamesXP/blob/main/videogames-backend/src/models/videogame.js"
    click ListRoutes "https://github.com/Andowna9/MyVideogamesXP/blob/main/videogames-backend/src/routes/lists.js"
    click GameRoutes "https://github.com/Andowna9/MyVideogamesXP/blob/main/videogames-backend/src/routes/videogames.js"
    click AuthMiddleware "https://github.com/Andowna9/MyVideogamesXP/blob/main/videogames-backend/src/middleware/authMiddleware.js"
    
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef gateway fill:#e67e22,stroke:#d35400,color:white
    classDef backend fill:#2ecc71,stroke:#27ae60,color:white
    classDef external fill:#95a5a6,stroke:#7f8c8d,color:white
    
    class Frontend,UserMgmt,GameMgmt,StateMgmt,Login,Signup,GameList,GameDetail,GameSearch,MyList frontend
    class Gateway gateway
    class UsersBackend,VideogamesBackend,UserApp,UserDB,UserSchemas,VGApp,ListModel,GameModel,AuthMiddleware,ListRoutes,GameRoutes backend
    class ExternalIGDB,GoogleOAuth external
```
