# rohanislambd/bangla-news-24-nextjs architecture

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

- Interactive diagram: https://gitdiagram.com/rohanislambd/bangla-news-24-nextjs
- Repository: https://github.com/rohanislambd/bangla-news-24-nextjs

## Overview

Bangla News 24 is a Next.js news-reading site with email/social authentication and profile editing. Readers enter through the homepage or a category page, which fetches news and renders article cards; article links lead to detail routes. The shared shell supplies branding, navigation, and session-aware account controls. Authentication forms and profile actions use the auth client, backed by a server auth handler and MongoDB. Several listed pages and components were not excerpted, so their internals and unshown connections are left unspecified.

Main entry points: [`src/app/page.tsx`](https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/app/page.tsx) (Home feed), [`src/lib/auth-client.ts`](https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/lib/auth-client.ts) (Auth client), [`src/app/category/[categoryId]/page.tsx`](https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/app/category/%5BcategoryId%5D/page.tsx) (Category feed), [`src/components/Header.tsx`](https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/components/Header.tsx) (Header)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_news["News browsing"]
  node_home["Home feed<br/>[page.tsx]"]
  node_category_page["Category feed<br/>[page.tsx]"]
  node_main_news["Lead stories<br/>[MainNews.tsx]"]
  node_news_card["Article cards<br/>[NewsCard.tsx]"]
  node_most_read["Most read<br/>[MostRead.tsx]"]
  node_article_page["Article detail<br/>[page.tsx]"]
end

subgraph group_ui["Shared interface"]
  node_site_shell["Site layout<br/>[layout.tsx]"]
  node_header["Header<br/>[Header.tsx]"]
  node_nav["Navigation links<br/>[NavLInks.tsx]"]
  node_marquee["News marquee<br/>[Marquee.tsx]"]
end

subgraph group_identity["Identity and profile"]
  node_user_info["Account controls<br/>[UserInfo.tsx]"]
  node_signup["Sign up<br/>[page.tsx]"]
  node_signin["Sign in<br/>[page.tsx]"]
  node_profile["Profile editor<br/>[page.tsx]"]
  node_auth_client["Auth client<br/>[auth-client.ts]"]
  node_auth_route["Auth endpoint<br/>[route.ts]"]
  node_auth_config["Auth configuration<br/>[auth.ts]"]
end

subgraph group_services["External services"]
  node_sections_api{{"News sections API"}}
  node_category_api{{"Category API"}}
  node_auth_db[("MongoDB auth store")]
  node_oauth{{"Google and GitHub"}}
end

node_reader(("Reader"))

node_reader -->|"opens"| node_home
node_home -->|"fetches sections"| node_sections_api
node_home -->|"renders lead"| node_main_news
node_home -->|"renders cards"| node_news_card
node_home -->|"renders"| node_most_read
node_reader -->|"opens category"| node_category_page
node_category_page -->|"fetches stories"| node_category_api
node_category_page -->|"renders cards"| node_news_card
node_reader -->|"opens story"| node_article_page
node_site_shell -->|"renders"| node_header
node_site_shell -->|"renders"| node_marquee
node_header -->|"renders"| node_nav
node_header -->|"renders"| node_user_info
node_user_info -->|"reads session"| node_auth_client
node_signup -->|"registers and signs in"| node_auth_client
node_signin -->|"signs in"| node_auth_client
node_profile -->|"reads and updates"| node_auth_client
node_auth_route -->|"routes requests"| node_auth_config
node_auth_config -->|"stores auth data"| node_auth_db
node_auth_config -->|"configures providers"| node_oauth

click node_home "https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/app/page.tsx"
click node_category_page "https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/app/category/%5BcategoryId%5D/page.tsx"
click node_main_news "https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/components/MainNews.tsx"
click node_news_card "https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/components/NewsCard.tsx"
click node_most_read "https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/components/MostRead.tsx"
click node_article_page "https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/app/news/%5BnewsId%5D/page.tsx"
click node_site_shell "https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/app/layout.tsx"
click node_header "https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/components/Header.tsx"
click node_nav "https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/components/NavLInks.tsx"
click node_marquee "https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/components/Marquee.tsx"
click node_user_info "https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/components/UserInfo.tsx"
click node_signup "https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/app/signup/page.tsx"
click node_signin "https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/app/signin/page.tsx"
click node_profile "https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/app/profile/page.tsx"
click node_auth_client "https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/lib/auth-client.ts"
click node_auth_route "https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/app/api/auth/%5B...all%5D/route.ts"
click node_auth_config "https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/lib/auth.ts"

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_category_page,node_main_news,node_news_card,node_most_read,node_article_page toneBlue
class node_site_shell,node_header,node_nav,node_marquee toneAmber
class node_user_info,node_signup,node_signin,node_profile,node_auth_client,node_auth_route,node_auth_config toneMint
class node_sections_api,node_category_api,node_auth_db,node_oauth toneRose
class node_reader toneIndigo
```

## Components

### News browsing

- [Home feed](https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Category feed](https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/app/category/%5BcategoryId%5D/page.tsx): `src/app/category/[categoryId]/page.tsx`
- [Lead stories](https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/components/MainNews.tsx): `src/components/MainNews.tsx`
- [Article cards](https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/components/NewsCard.tsx): `src/components/NewsCard.tsx`
- [Most read](https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/components/MostRead.tsx): `src/components/MostRead.tsx`
- [Article detail](https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/app/news/%5BnewsId%5D/page.tsx): `src/app/news/[newsId]/page.tsx`

### Shared interface

- [Site layout](https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/app/layout.tsx): `src/app/layout.tsx`
- [Header](https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/components/Header.tsx): `src/components/Header.tsx`
- [Navigation links](https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/components/NavLInks.tsx): `src/components/NavLInks.tsx`
- [News marquee](https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/components/Marquee.tsx): `src/components/Marquee.tsx`

### Identity and profile

- [Account controls](https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/components/UserInfo.tsx): `src/components/UserInfo.tsx`
- [Sign up](https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/app/signup/page.tsx): `src/app/signup/page.tsx`
- [Sign in](https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/app/signin/page.tsx): `src/app/signin/page.tsx`
- [Profile editor](https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/app/profile/page.tsx): `src/app/profile/page.tsx`
- [Auth client](https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/lib/auth-client.ts): `src/lib/auth-client.ts`
- [Auth endpoint](https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/app/api/auth/%5B...all%5D/route.ts): `src/app/api/auth/[...all]/route.ts`
- [Auth configuration](https://github.com/rohanislambd/bangla-news-24-nextjs/blob/main/src/lib/auth.ts): `src/lib/auth.ts`

### External services

- **News sections API**
- **Category API**
- **MongoDB auth store**
- **Google and GitHub**

### Other components

- **Reader**

## Connections

- Reader → Home feed: opens
- Home feed → News sections API: fetches sections (evidence: `src/app/page.tsx`)
- Home feed → Lead stories: renders lead (evidence: `src/app/page.tsx`)
- Home feed → Article cards: renders cards (evidence: `src/app/page.tsx`)
- Home feed → Most read: renders (evidence: `src/app/page.tsx`)
- Reader → Category feed: opens category
- Category feed → Category API: fetches stories (evidence: `src/app/category/[categoryId]/page.tsx`)
- Category feed → Article cards: renders cards (evidence: `src/app/category/[categoryId]/page.tsx`)
- Reader → Article detail: opens story
- Site layout → Header: renders (evidence: `src/app/layout.tsx`)
- Site layout → News marquee: renders (evidence: `src/app/layout.tsx`)
- Header → Navigation links: renders (evidence: `src/components/Header.tsx`)
- Header → Account controls: renders (evidence: `src/components/Header.tsx`)
- Account controls → Auth client: reads session (evidence: `src/components/UserInfo.tsx`)
- Sign up → Auth client: registers and signs in (evidence: `src/app/signup/page.tsx`)
- Sign in → Auth client: signs in (evidence: `src/app/signin/page.tsx`)
- Profile editor → Auth client: reads and updates (evidence: `src/app/profile/page.tsx`)
- Auth endpoint → Auth configuration: routes requests (evidence: `src/app/api/auth/[...all]/route.ts`)
- Auth configuration → MongoDB auth store: stores auth data (evidence: `src/lib/auth.ts`)
- Auth configuration → Google and GitHub: configures providers (evidence: `src/lib/auth.ts`)
