How rohanislambd/bangla-news-24-nextjs works
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: app/page.tsx Home feed · auth-client.ts Auth client · [categoryId]/page.tsx Category feed · Header.tsx Header
Components 22
News browsing
- Home feed
src/app/page.tsx - Category feed
src/app/category/[categoryId]/page.tsx - Lead stories
src/components/MainNews.tsx - Article cards
src/components/NewsCard.tsx - Most read
src/components/MostRead.tsx - Article detail
src/app/news/[newsId]/page.tsx
Shared interface
- Site layout
src/app/layout.tsx - Header
src/components/Header.tsx - Navigation links
src/components/NavLInks.tsx - News marquee
src/components/Marquee.tsx
Identity and profile
- Account controls
src/components/UserInfo.tsx - Sign up
src/app/signup/page.tsx - Sign in
src/app/signin/page.tsx - Profile editor
src/app/profile/page.tsx - Auth client
src/lib/auth-client.ts - Auth endpoint
src/app/api/auth/[...all]/route.ts - Auth configuration
src/lib/auth.ts
External services
- News sections API
- Category API
- MongoDB auth store
- Google and GitHub
Other components
- Reader
Connections 20
- Reader → Home feed: opens
- Home feed → News sections API: fetches sections
src/app/page.tsx - Home feed → Lead stories: renders lead
src/app/page.tsx - Home feed → Article cards: renders cards
src/app/page.tsx - Home feed → Most read: renders
src/app/page.tsx - Reader → Category feed: opens category
- Category feed → Category API: fetches stories
src/app/category/[categoryId]/page.tsx - Category feed → Article cards: renders cards
src/app/category/[categoryId]/page.tsx - Reader → Article detail: opens story
- Site layout → Header: renders
src/app/layout.tsx - Site layout → News marquee: renders
src/app/layout.tsx - Header → Navigation links: renders
src/components/Header.tsx - Header → Account controls: renders
src/components/Header.tsx - Account controls → Auth client: reads session
src/components/UserInfo.tsx - Sign up → Auth client: registers and signs in
src/app/signup/page.tsx - Sign in → Auth client: signs in
src/app/signin/page.tsx - Profile editor → Auth client: reads and updates
src/app/profile/page.tsx - Auth endpoint → Auth configuration: routes requests
src/app/api/auth/[...all]/route.ts - Auth configuration → MongoDB auth store: stores auth data
src/lib/auth.ts - Auth configuration → Google and GitHub: configures providers
src/lib/auth.ts