# ahmedadel7776/egyptian-footballers architecture

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

- Interactive diagram: https://gitdiagram.com/ahmedadel7776/egyptian-footballers
- Repository: https://github.com/ahmedadel7776/egyptian-footballers

## Overview

This is an Expo football-news app for following Egyptian players abroad, alongside a separate Express authentication backend. The main user flow selects a player, fetches and filters news, and opens stories; users can save stories locally and browse updates, saved news, and profile screens. The backend exposes registration, login, and authenticated user lookup backed by PostgreSQL. The README describes an Expo starter rather than product behavior. The shown sources do not establish that the app connects to this backend, so that relationship is omitted.

Main entry points: [`app/screens/Homescreen.tsx`](https://github.com/ahmedadel7776/egyptian-footballers/blob/main/app/screens/Homescreen.tsx) (Home feed), [`app/components/BottomNavigation.tsx`](https://github.com/ahmedadel7776/egyptian-footballers/blob/main/app/components/BottomNavigation.tsx) (Tab navigation), [`app/Notifications.tsx`](https://github.com/ahmedadel7776/egyptian-footballers/blob/main/app/Notifications.tsx) (Player updates), [`app/components/NewsCard.tsx`](https://github.com/ahmedadel7776/egyptian-footballers/blob/main/app/components/NewsCard.tsx) (News card)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["News app"]
  node_home["Home feed<br/>[Homescreen.tsx]"]
  node_allnews["All news<br/>[AllNews.tsx]"]
  node_favorites["Saved news<br/>[Favourite.tsx]"]
  node_updates["Player updates<br/>[Notifications.tsx]"]
  node_profile["Profile<br/>[Profile.tsx]"]
end

subgraph group_shared["UI components"]
  node_nav["Tab navigation"]
  node_categories["Player categories<br/>[Categories.tsx]"]
  node_featured["Featured stories<br/>[FeaturedCard.tsx]"]
  node_header["Feed header<br/>[Header.tsx]"]
  node_news_card["News card<br/>[NewsCard.tsx]"]
  node_search["Search input<br/>[SearchBar.tsx]"]
  node_section_title["Section title<br/>[SectionTitle.jsx]"]
end

subgraph group_backend["Authentication backend"]
  node_backend_server["HTTP server<br/>[server.js]"]
  node_auth_routes["Auth routes<br/>[auth.js]"]
  node_auth_middleware["Token guard<br/>[auth.js]"]
  node_db_pool["Database pool<br/>[db.js]"]
end

subgraph group_state["Persistence"]
  node_storage[("Device storage")]
end

node_reader(("Reader"))
node_news_api{{"NewsAPI"}}
node_postgres[("PostgreSQL")]

node_home -->|"fetches news"| node_news_api
node_home -->|"loads and saves favorites"| node_storage
node_home -->|"renders"| node_categories
node_home -->|"renders"| node_featured
node_home -->|"renders"| node_header
node_home -->|"renders"| node_news_card
node_home -->|"renders"| node_search
node_home -->|"renders"| node_section_title
node_featured -->|"fetches stories"| node_news_api
node_section_title -->|"navigates to"| node_allnews
node_allnews -->|"renders"| node_news_card
node_favorites -->|"loads and updates"| node_storage
node_favorites -->|"renders"| node_news_card
node_updates -->|"fetches updates"| node_news_api
node_updates -->|"saves favorites"| node_storage
node_updates -->|"renders"| node_news_card
node_updates -->|"renders"| node_nav
node_nav -->|"routes to"| node_home
node_nav -->|"routes to"| node_allnews
node_nav -->|"routes to"| node_favorites
node_nav -->|"routes to"| node_profile
node_backend_server -->|"mounts routes"| node_auth_routes
node_auth_routes -->|"queries"| node_db_pool
node_auth_routes -->|"guards profile lookup"| node_auth_middleware
node_db_pool -.->|"connects to"| node_postgres
node_reader -.->|"browses"| node_home

click node_home "https://github.com/ahmedadel7776/egyptian-footballers/blob/main/app/screens/Homescreen.tsx"
click node_allnews "https://github.com/ahmedadel7776/egyptian-footballers/blob/main/app/AllNews.tsx"
click node_favorites "https://github.com/ahmedadel7776/egyptian-footballers/blob/main/app/Favourite.tsx"
click node_updates "https://github.com/ahmedadel7776/egyptian-footballers/blob/main/app/Notifications.tsx"
click node_profile "https://github.com/ahmedadel7776/egyptian-footballers/blob/main/app/Profile.tsx"
click node_nav "https://github.com/ahmedadel7776/egyptian-footballers/blob/main/app/components/BottomNavigation.tsx"
click node_categories "https://github.com/ahmedadel7776/egyptian-footballers/blob/main/app/components/Categories.tsx"
click node_featured "https://github.com/ahmedadel7776/egyptian-footballers/blob/main/app/components/FeaturedCard.tsx"
click node_header "https://github.com/ahmedadel7776/egyptian-footballers/blob/main/app/components/Header.tsx"
click node_news_card "https://github.com/ahmedadel7776/egyptian-footballers/blob/main/app/components/NewsCard.tsx"
click node_search "https://github.com/ahmedadel7776/egyptian-footballers/blob/main/app/components/SearchBar.tsx"
click node_section_title "https://github.com/ahmedadel7776/egyptian-footballers/blob/main/app/components/SectionTitle.jsx"
click node_backend_server "https://github.com/ahmedadel7776/egyptian-footballers/blob/main/my-app-backend/src/server.js"
click node_auth_routes "https://github.com/ahmedadel7776/egyptian-footballers/blob/main/my-app-backend/src/routes/auth.js"
click node_auth_middleware "https://github.com/ahmedadel7776/egyptian-footballers/blob/main/my-app-backend/src/middleware/auth.js"
click node_db_pool "https://github.com/ahmedadel7776/egyptian-footballers/blob/main/my-app-backend/src/db.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_home,node_allnews,node_favorites,node_updates,node_profile toneBlue
class node_nav,node_categories,node_featured,node_header,node_news_card,node_search,node_section_title,node_postgres toneAmber
class node_backend_server,node_auth_routes,node_auth_middleware,node_db_pool,node_news_api toneMint
class node_storage toneRose
class node_reader toneIndigo
```

## Components

### News app

- [Home feed](https://github.com/ahmedadel7776/egyptian-footballers/blob/main/app/screens/Homescreen.tsx): `app/screens/Homescreen.tsx`
- [All news](https://github.com/ahmedadel7776/egyptian-footballers/blob/main/app/AllNews.tsx): `app/AllNews.tsx`
- [Saved news](https://github.com/ahmedadel7776/egyptian-footballers/blob/main/app/Favourite.tsx): `app/Favourite.tsx`
- [Player updates](https://github.com/ahmedadel7776/egyptian-footballers/blob/main/app/Notifications.tsx): `app/Notifications.tsx`
- [Profile](https://github.com/ahmedadel7776/egyptian-footballers/blob/main/app/Profile.tsx): `app/Profile.tsx`

### UI components

- [Tab navigation](https://github.com/ahmedadel7776/egyptian-footballers/blob/main/app/components/BottomNavigation.tsx): `app/components/BottomNavigation.tsx`
- [Player categories](https://github.com/ahmedadel7776/egyptian-footballers/blob/main/app/components/Categories.tsx): `app/components/Categories.tsx`
- [Featured stories](https://github.com/ahmedadel7776/egyptian-footballers/blob/main/app/components/FeaturedCard.tsx): `app/components/FeaturedCard.tsx`
- [Feed header](https://github.com/ahmedadel7776/egyptian-footballers/blob/main/app/components/Header.tsx): `app/components/Header.tsx`
- [News card](https://github.com/ahmedadel7776/egyptian-footballers/blob/main/app/components/NewsCard.tsx): `app/components/NewsCard.tsx`
- [Search input](https://github.com/ahmedadel7776/egyptian-footballers/blob/main/app/components/SearchBar.tsx): `app/components/SearchBar.tsx`
- [Section title](https://github.com/ahmedadel7776/egyptian-footballers/blob/main/app/components/SectionTitle.jsx): `app/components/SectionTitle.jsx`

### Authentication backend

- [HTTP server](https://github.com/ahmedadel7776/egyptian-footballers/blob/main/my-app-backend/src/server.js): `my-app-backend/src/server.js`
- [Auth routes](https://github.com/ahmedadel7776/egyptian-footballers/blob/main/my-app-backend/src/routes/auth.js): `my-app-backend/src/routes/auth.js`
- [Token guard](https://github.com/ahmedadel7776/egyptian-footballers/blob/main/my-app-backend/src/middleware/auth.js): `my-app-backend/src/middleware/auth.js`
- [Database pool](https://github.com/ahmedadel7776/egyptian-footballers/blob/main/my-app-backend/src/db.js): `my-app-backend/src/db.js`

### Persistence

- **Device storage**

### Other components

- **Reader**
- **NewsAPI**
- **PostgreSQL**

## Connections

- Home feed → NewsAPI: fetches news (evidence: `app/screens/Homescreen.tsx`)
- Home feed → Device storage: loads and saves favorites (evidence: `app/screens/Homescreen.tsx`)
- Home feed → Player categories: renders (evidence: `app/screens/Homescreen.tsx`)
- Home feed → Featured stories: renders (evidence: `app/screens/Homescreen.tsx`)
- Home feed → Feed header: renders (evidence: `app/screens/Homescreen.tsx`)
- Home feed → News card: renders (evidence: `app/screens/Homescreen.tsx`)
- Home feed → Search input: renders (evidence: `app/screens/Homescreen.tsx`)
- Home feed → Section title: renders (evidence: `app/screens/Homescreen.tsx`)
- Featured stories → NewsAPI: fetches stories (evidence: `app/components/FeaturedCard.tsx`)
- Section title → All news: navigates to
- All news → News card: renders (evidence: `app/AllNews.tsx`)
- Saved news → Device storage: loads and updates (evidence: `app/Favourite.tsx`)
- Saved news → News card: renders (evidence: `app/Favourite.tsx`)
- Player updates → NewsAPI: fetches updates (evidence: `app/Notifications.tsx`)
- Player updates → Device storage: saves favorites (evidence: `app/Notifications.tsx`)
- Player updates → News card: renders (evidence: `app/Notifications.tsx`)
- Player updates → Tab navigation: renders (evidence: `app/Notifications.tsx`)
- Tab navigation → Home feed: routes to (evidence: `app/components/BottomNavigation.tsx`)
- Tab navigation → All news: routes to (evidence: `app/components/BottomNavigation.tsx`)
- Tab navigation → Saved news: routes to (evidence: `app/components/BottomNavigation.tsx`)
- Tab navigation → Profile: routes to (evidence: `app/components/BottomNavigation.tsx`)
- HTTP server → Auth routes: mounts routes (evidence: `my-app-backend/src/server.js`)
- Auth routes → Database pool: queries (evidence: `my-app-backend/src/routes/auth.js`)
- Auth routes → Token guard: guards profile lookup (evidence: `my-app-backend/src/routes/auth.js`)
- Database pool → PostgreSQL: connects to
- Reader → Home feed: browses
