# kukss1/nakmo-news-portal-free architecture

> Architecture diagram of the GitHub repository kukss1/nakmo-news-portal-free, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kukss1/nakmo-news-portal-free
- Repository: https://github.com/kukss1/nakmo-news-portal-free

## Overview

Nakmo is a multilingual news platform with a Next.js reader and an Express API. Readers browse news and reels; the platform also supports article publishing and administration, accounts, saved stories, likes, comments, notifications, subscriptions, translations, and external-news ingestion. The homepage source shows server-side MongoDB reads, while the backend entry point mounts API routes and schedules suggestion-fetching and cleanup jobs. Several backend route/controller connections and most frontend API calls were not sampled, so those links are omitted rather than inferred.

Main entry points: [`backend/index.js`](https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/index.js) (API application), [`backend/src/controllers/commentController.js`](https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/src/controllers/commentController.js) (Comments), [`frontend/pages/index.js`](https://github.com/kukss1/nakmo-news-portal-free/blob/main/frontend/pages/index.js) (Home feed), [`backend/src/controllers/articleController.js`](https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/src/controllers/articleController.js) (Article operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_reader["News experience"]
  node_home["Home feed<br/>[index.js]"]
  node_article_page["Article pages<br/>[&#91;&#91;...slug&#93;&#93;.js]"]
  node_reels["News reels<br/>[reels.js]"]
  node_web_api["Frontend API client<br/>[api.js]"]
end

subgraph group_api["Backend API"]
  node_express["API application<br/>[index.js]"]
  node_user_routes["User routes<br/>[userRoutes.js]"]
  node_gnews_routes["GNews route<br/>[gnewsRoutes.js]"]
  node_subscription_routes["Subscription route"]
  node_subscription_controller["Subscriptions"]
end

subgraph group_content["Content and engagement"]
  node_article_controller["Article operations"]
  node_comment_controller["Comments"]
  node_like_controller["Likes<br/>[likeController.js]"]
  node_article_model["Article records<br/>[Article.js]"]
  node_comment_model["Comment records<br/>[Comment.js]"]
  node_notification_model["Notifications<br/>[Notification.js]"]
end

subgraph group_identity["Identity and services"]
  node_user_controller["User profiles<br/>[userController.js]"]
  node_mongo[("MongoDB")]
  node_firebase["Firebase"]
end

subgraph group_ingestion["News ingestion"]
  node_gnews_controller["GNews ingestion<br/>[gnewsController.js]"]
  node_newsapi_controller["News suggestions"]
  node_suggested_model["Suggested stories"]
  node_gnews["GNews"]
  node_eventregistry["Event Registry"]
end

node_reader(("Reader"))

node_reader -->|"browses"| node_home
node_reader -->|"opens stories"| node_article_page
node_reader -->|"watches"| node_reels
node_home -->|"reads feed"| node_mongo
node_home -->|"queries"| node_article_model
node_web_api -->|"calls API"| node_express
node_express -->|"mounts"| node_user_routes
node_user_routes -->|"dispatches"| node_user_controller
node_user_controller -->|"reads and writes"| node_mongo
node_express -->|"mounts"| node_gnews_routes
node_gnews_routes -->|"dispatches"| node_gnews_controller
node_gnews_controller -->|"fetches news"| node_gnews
node_express -->|"mounts"| node_subscription_routes
node_subscription_routes -->|"dispatches"| node_subscription_controller
node_express -->|"mounts article routes"| node_article_controller
node_article_controller -->|"reads and writes"| node_article_model
node_article_controller -->|"queries"| node_mongo
node_express -->|"mounts comment routes"| node_comment_controller
node_comment_controller -->|"reads and writes"| node_comment_model
node_comment_controller -->|"looks up article"| node_article_model
node_comment_controller -->|"creates notification"| node_notification_model
node_comment_controller -->|"queries"| node_mongo
node_express -->|"mounts like routes"| node_like_controller
node_like_controller -->|"reads and writes"| node_mongo
node_express -->|"schedules fetch"| node_newsapi_controller
node_newsapi_controller -->|"fetches articles"| node_eventregistry
node_newsapi_controller -->|"stores suggestions"| node_suggested_model
node_express -->|"connects"| node_mongo
node_firebase -.->|"auth integration"| node_user_controller

click node_home "https://github.com/kukss1/nakmo-news-portal-free/blob/main/frontend/pages/index.js"
click node_article_page "https://github.com/kukss1/nakmo-news-portal-free/blob/main/frontend/pages/news/%5B%5B...slug%5D%5D.js"
click node_reels "https://github.com/kukss1/nakmo-news-portal-free/blob/main/frontend/pages/reels.js"
click node_web_api "https://github.com/kukss1/nakmo-news-portal-free/blob/main/frontend/lib/api.js"
click node_express "https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/index.js"
click node_user_routes "https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/src/routes/userRoutes.js"
click node_user_controller "https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/src/controllers/userController.js"
click node_gnews_routes "https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/src/routes/gnewsRoutes.js"
click node_gnews_controller "https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/src/controllers/gnewsController.js"
click node_subscription_routes "https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/src/routes/subscriptionRoutes.js"
click node_subscription_controller "https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/src/controllers/subscriptionController.js"
click node_article_controller "https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/src/controllers/articleController.js"
click node_comment_controller "https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/src/controllers/commentController.js"
click node_like_controller "https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/src/controllers/likeController.js"
click node_newsapi_controller "https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/src/controllers/newsApiController.js"
click node_article_model "https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/src/models/Article.js"
click node_comment_model "https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/src/models/Comment.js"
click node_notification_model "https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/src/models/Notification.js"
click node_suggested_model "https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/src/models/SuggestedArticle.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_article_page,node_reels,node_web_api toneBlue
class node_express,node_user_routes,node_gnews_routes,node_subscription_routes,node_subscription_controller toneAmber
class node_article_controller,node_comment_controller,node_like_controller,node_article_model,node_comment_model,node_notification_model toneMint
class node_user_controller,node_mongo,node_firebase toneRose
class node_gnews_controller,node_newsapi_controller,node_suggested_model,node_gnews,node_eventregistry,node_reader toneIndigo
```

## Components

### News experience

- [Home feed](https://github.com/kukss1/nakmo-news-portal-free/blob/main/frontend/pages/index.js): `frontend/pages/index.js`
- [Article pages](https://github.com/kukss1/nakmo-news-portal-free/blob/main/frontend/pages/news/%5B%5B...slug%5D%5D.js): `frontend/pages/news/[[...slug]].js`
- [News reels](https://github.com/kukss1/nakmo-news-portal-free/blob/main/frontend/pages/reels.js): `frontend/pages/reels.js`
- [Frontend API client](https://github.com/kukss1/nakmo-news-portal-free/blob/main/frontend/lib/api.js): `frontend/lib/api.js`

### Backend API

- [API application](https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/index.js): `backend/index.js`
- [User routes](https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/src/routes/userRoutes.js): `backend/src/routes/userRoutes.js`
- [GNews route](https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/src/routes/gnewsRoutes.js): `backend/src/routes/gnewsRoutes.js`
- [Subscription route](https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/src/routes/subscriptionRoutes.js): `backend/src/routes/subscriptionRoutes.js`
- [Subscriptions](https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/src/controllers/subscriptionController.js): `backend/src/controllers/subscriptionController.js`

### Content and engagement

- [Article operations](https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/src/controllers/articleController.js): `backend/src/controllers/articleController.js`
- [Comments](https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/src/controllers/commentController.js): `backend/src/controllers/commentController.js`
- [Likes](https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/src/controllers/likeController.js): `backend/src/controllers/likeController.js`
- [Article records](https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/src/models/Article.js): `backend/src/models/Article.js`
- [Comment records](https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/src/models/Comment.js): `backend/src/models/Comment.js`
- [Notifications](https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/src/models/Notification.js): `backend/src/models/Notification.js`

### Identity and services

- [User profiles](https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/src/controllers/userController.js): `backend/src/controllers/userController.js`
- **MongoDB**
- **Firebase**

### News ingestion

- [GNews ingestion](https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/src/controllers/gnewsController.js): `backend/src/controllers/gnewsController.js`
- [News suggestions](https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/src/controllers/newsApiController.js): `backend/src/controllers/newsApiController.js`
- [Suggested stories](https://github.com/kukss1/nakmo-news-portal-free/blob/main/backend/src/models/SuggestedArticle.js): `backend/src/models/SuggestedArticle.js`
- **GNews**
- **Event Registry**

### Other components

- **Reader**

## Connections

- Reader → Home feed: browses
- Reader → Article pages: opens stories
- Reader → News reels: watches
- Home feed → MongoDB: reads feed
- Home feed → Article records: queries
- Frontend API client → API application: calls API
- API application → User routes: mounts
- User routes → User profiles: dispatches
- User profiles → MongoDB: reads and writes
- API application → GNews route: mounts
- GNews route → GNews ingestion: dispatches
- GNews ingestion → GNews: fetches news
- API application → Subscription route: mounts
- Subscription route → Subscriptions: dispatches
- API application → Article operations: mounts article routes
- Article operations → Article records: reads and writes
- Article operations → MongoDB: queries
- API application → Comments: mounts comment routes
- Comments → Comment records: reads and writes
- Comments → Article records: looks up article
- Comments → Notifications: creates notification
- Comments → MongoDB: queries
- API application → Likes: mounts like routes
- Likes → MongoDB: reads and writes
- API application → News suggestions: schedules fetch
- News suggestions → Event Registry: fetches articles
- News suggestions → Suggested stories: stores suggestions
- API application → MongoDB: connects
- Firebase → User profiles: auth integration
