# abdalrahman-helal/swe architecture

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

- Interactive diagram: https://gitdiagram.com/abdalrahman-helal/swe
- Repository: https://github.com/abdalrahman-helal/swe

## Overview

This repository is a collection of Node.js learning projects rather than one unified product. The most developed application is FinalProject, an API for authentication and user/admin task and banner features; the Redis project is a separate product API with notifications. Natours is represented by several progressively expanded course versions. Edges are limited to relationships visible in excerpts or the source index; unsampled feature internals are retained as subsystem nodes where the tree supports them.

Main entry points: [`FinalProject/src/routes/index.ts`](https://github.com/abdalrahman-helal/swe/blob/main/FinalProject/src/routes/index.ts) (Route registry), [`FinalProject/src/services/auth.service.ts`](https://github.com/abdalrahman-helal/swe/blob/main/FinalProject/src/services/auth.service.ts) (Authentication), [`FinalProject/src/routes/auth.routes.ts`](https://github.com/abdalrahman-helal/swe/blob/main/FinalProject/src/routes/auth.routes.ts) (Authentication routes), [`FinalProject/src/routes/user.task.routes.ts`](https://github.com/abdalrahman-helal/swe/blob/main/FinalProject/src/routes/user.task.routes.ts) (User task routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_final["FinalProject API"]
  node_final_server["Server startup<br/>[server.ts]"]
  node_final_app["Express app<br/>[app.ts]"]
  node_final_routes["Route registry<br/>[index.ts]"]
  node_auth_routes["Authentication routes<br/>[auth.routes.ts]"]
  node_auth_service["Authentication<br/>[auth.service.ts]"]
  node_auth_guard["JWT authorization<br/>[auth.middleware.ts]"]
  node_jwt["Token signing<br/>[jwt.ts]"]
  node_google["Google sign-in<br/>[google.ts]"]
  node_users["User persistence<br/>[user.repository.ts]"]
  node_user_tasks["User task routes"]
  node_task_service["User task service"]
  node_admin_tasks["Admin task features"]
  node_banners["Banner management"]
end

subgraph group_redis["Redis Product API"]
  node_redis_server["Server startup<br/>[server.ts]"]
  node_redis_app["Express app<br/>[app.ts]"]
  node_redis_routes["Route registry<br/>[index.ts]"]
  node_product_routes["Product routes<br/>[product.routes.ts]"]
  node_product_controller["Product API"]
  node_product_service["Product operations<br/>[product.service.ts]"]
  node_sql_pool[("SQL connection pool<br/>[pool.ts]")]
  node_redis_client[("Redis client<br/>[client.ts]")]
  node_notifications["Notifications"]
  node_subscriber["Notification subscriber"]
end

subgraph group_natours["Natours Course App"]
  node_natours_review_routes["Review routes<br/>[reviewRoutes.js]"]
  node_natours_auth["Review access control<br/>[authController.js]"]
  node_natours_reviews["Review operations"]
  node_review_model["Review model<br/>[reviewModel.js]"]
  node_natours_factory["CRUD handlers<br/>[handlerFactory.js]"]
end

node_client(("API client"))
node_postgres[("PostgreSQL")]

node_client -.->|"sends requests"| node_final_server
node_final_server -->|"starts"| node_final_app
node_final_app -->|"mounts"| node_final_routes
node_final_routes -->|"registers"| node_auth_routes
node_final_routes -->|"registers"| node_user_tasks
node_final_routes -->|"registers"| node_admin_tasks
node_final_routes -->|"registers"| node_banners
node_auth_routes -->|"calls"| node_auth_service
node_auth_routes -->|"uses"| node_auth_guard
node_auth_service -->|"calls"| node_users
node_auth_service -->|"signs tokens"| node_jwt
node_auth_service -->|"delegates sign-in"| node_google
node_users -.->|"queries"| node_postgres
node_auth_guard -->|"verifies tokens"| node_jwt
node_user_tasks -->|"protects routes"| node_auth_guard
node_user_tasks -->|"calls"| node_task_service
node_client -.->|"sends requests"| node_redis_server
node_redis_server -->|"starts"| node_redis_app
node_redis_app -->|"mounts"| node_redis_routes
node_redis_routes -.->|"registers"| node_product_routes
node_product_routes -->|"routes requests"| node_product_controller
node_product_controller -->|"calls"| node_product_service
node_product_service -->|"queries"| node_sql_pool
node_product_service -->|"uses cache"| node_redis_client
node_notifications -->|"uses"| node_subscriber
node_natours_review_routes -->|"protects routes"| node_natours_auth
node_natours_review_routes -->|"dispatches"| node_natours_reviews
node_natours_reviews -->|"uses model"| node_review_model
node_natours_reviews -->|"delegates CRUD"| node_natours_factory

click node_final_server "https://github.com/abdalrahman-helal/swe/blob/main/FinalProject/src/server.ts"
click node_final_app "https://github.com/abdalrahman-helal/swe/blob/main/FinalProject/src/app.ts"
click node_final_routes "https://github.com/abdalrahman-helal/swe/blob/main/FinalProject/src/routes/index.ts"
click node_auth_routes "https://github.com/abdalrahman-helal/swe/blob/main/FinalProject/src/routes/auth.routes.ts"
click node_auth_service "https://github.com/abdalrahman-helal/swe/blob/main/FinalProject/src/services/auth.service.ts"
click node_auth_guard "https://github.com/abdalrahman-helal/swe/blob/main/FinalProject/src/middlewares/auth.middleware.ts"
click node_jwt "https://github.com/abdalrahman-helal/swe/blob/main/FinalProject/src/lib/jwt.ts"
click node_google "https://github.com/abdalrahman-helal/swe/blob/main/FinalProject/src/lib/google.ts"
click node_users "https://github.com/abdalrahman-helal/swe/blob/main/FinalProject/src/repositories/user.repository.ts"
click node_user_tasks "https://github.com/abdalrahman-helal/swe/blob/main/FinalProject/src/routes/user.task.routes.ts"
click node_task_service "https://github.com/abdalrahman-helal/swe/blob/main/FinalProject/src/services/user.task.service.ts"
click node_admin_tasks "https://github.com/abdalrahman-helal/swe/blob/main/FinalProject/src/routes/admin.task.routes.ts"
click node_banners "https://github.com/abdalrahman-helal/swe/blob/main/FinalProject/src/routes/admin.banner.route.ts"
click node_redis_server "https://github.com/abdalrahman-helal/swe/blob/main/Redis/RedisProject/src/server.ts"
click node_redis_app "https://github.com/abdalrahman-helal/swe/blob/main/Redis/RedisProject/src/app.ts"
click node_redis_routes "https://github.com/abdalrahman-helal/swe/blob/main/Redis/RedisProject/src/routes/index.ts"
click node_product_routes "https://github.com/abdalrahman-helal/swe/blob/main/Redis/RedisProject/src/routes/product.routes.ts"
click node_product_controller "https://github.com/abdalrahman-helal/swe/blob/main/Redis/RedisProject/src/controllers/product.controller.ts"
click node_product_service "https://github.com/abdalrahman-helal/swe/blob/main/Redis/RedisProject/src/services/product.service.ts"
click node_sql_pool "https://github.com/abdalrahman-helal/swe/blob/main/Redis/RedisProject/src/db/pool.ts"
click node_redis_client "https://github.com/abdalrahman-helal/swe/blob/main/Redis/RedisProject/src/redis/client.ts"
click node_notifications "https://github.com/abdalrahman-helal/swe/blob/main/Redis/RedisProject/src/controllers/notification.controller.ts"
click node_subscriber "https://github.com/abdalrahman-helal/swe/blob/main/Redis/RedisProject/src/subscribers/notification.subscriber.ts"
click node_natours_review_routes "https://github.com/abdalrahman-helal/swe/blob/main/complete-node-bootcamp/4-natours/after-section-11/routes/reviewRoutes.js"
click node_natours_auth "https://github.com/abdalrahman-helal/swe/blob/main/complete-node-bootcamp/4-natours/after-section-11/controllers/authController.js"
click node_natours_reviews "https://github.com/abdalrahman-helal/swe/blob/main/complete-node-bootcamp/4-natours/after-section-11/controllers/reviewController.js"
click node_review_model "https://github.com/abdalrahman-helal/swe/blob/main/complete-node-bootcamp/4-natours/after-section-11/models/reviewModel.js"
click node_natours_factory "https://github.com/abdalrahman-helal/swe/blob/main/complete-node-bootcamp/4-natours/after-section-11/controllers/handlerFactory.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_final_server,node_final_app,node_final_routes,node_auth_routes,node_auth_service,node_auth_guard,node_jwt,node_google,node_users,node_user_tasks,node_task_service,node_admin_tasks,node_banners,node_client toneBlue
class node_redis_server,node_redis_app,node_redis_routes,node_product_routes,node_product_controller,node_product_service,node_sql_pool,node_redis_client,node_notifications,node_subscriber,node_postgres toneAmber
class node_natours_review_routes,node_natours_auth,node_natours_reviews,node_review_model,node_natours_factory toneMint
```

## Components

### FinalProject API

- [Server startup](https://github.com/abdalrahman-helal/swe/blob/main/FinalProject/src/server.ts): `FinalProject/src/server.ts`
- [Express app](https://github.com/abdalrahman-helal/swe/blob/main/FinalProject/src/app.ts): `FinalProject/src/app.ts`
- [Route registry](https://github.com/abdalrahman-helal/swe/blob/main/FinalProject/src/routes/index.ts): `FinalProject/src/routes/index.ts`
- [Authentication routes](https://github.com/abdalrahman-helal/swe/blob/main/FinalProject/src/routes/auth.routes.ts): `FinalProject/src/routes/auth.routes.ts`
- [Authentication](https://github.com/abdalrahman-helal/swe/blob/main/FinalProject/src/services/auth.service.ts): `FinalProject/src/services/auth.service.ts`
- [JWT authorization](https://github.com/abdalrahman-helal/swe/blob/main/FinalProject/src/middlewares/auth.middleware.ts): `FinalProject/src/middlewares/auth.middleware.ts`
- [Token signing](https://github.com/abdalrahman-helal/swe/blob/main/FinalProject/src/lib/jwt.ts): `FinalProject/src/lib/jwt.ts`
- [Google sign-in](https://github.com/abdalrahman-helal/swe/blob/main/FinalProject/src/lib/google.ts): `FinalProject/src/lib/google.ts`
- [User persistence](https://github.com/abdalrahman-helal/swe/blob/main/FinalProject/src/repositories/user.repository.ts): `FinalProject/src/repositories/user.repository.ts`
- [User task routes](https://github.com/abdalrahman-helal/swe/blob/main/FinalProject/src/routes/user.task.routes.ts): `FinalProject/src/routes/user.task.routes.ts`
- [User task service](https://github.com/abdalrahman-helal/swe/blob/main/FinalProject/src/services/user.task.service.ts): `FinalProject/src/services/user.task.service.ts`
- [Admin task features](https://github.com/abdalrahman-helal/swe/blob/main/FinalProject/src/routes/admin.task.routes.ts): `FinalProject/src/routes/admin.task.routes.ts`
- [Banner management](https://github.com/abdalrahman-helal/swe/blob/main/FinalProject/src/routes/admin.banner.route.ts): `FinalProject/src/routes/admin.banner.route.ts`

### Redis Product API

- [Server startup](https://github.com/abdalrahman-helal/swe/blob/main/Redis/RedisProject/src/server.ts): `Redis/RedisProject/src/server.ts`
- [Express app](https://github.com/abdalrahman-helal/swe/blob/main/Redis/RedisProject/src/app.ts): `Redis/RedisProject/src/app.ts`
- [Route registry](https://github.com/abdalrahman-helal/swe/blob/main/Redis/RedisProject/src/routes/index.ts): `Redis/RedisProject/src/routes/index.ts`
- [Product routes](https://github.com/abdalrahman-helal/swe/blob/main/Redis/RedisProject/src/routes/product.routes.ts): `Redis/RedisProject/src/routes/product.routes.ts`
- [Product API](https://github.com/abdalrahman-helal/swe/blob/main/Redis/RedisProject/src/controllers/product.controller.ts): `Redis/RedisProject/src/controllers/product.controller.ts`
- [Product operations](https://github.com/abdalrahman-helal/swe/blob/main/Redis/RedisProject/src/services/product.service.ts): `Redis/RedisProject/src/services/product.service.ts`
- [SQL connection pool](https://github.com/abdalrahman-helal/swe/blob/main/Redis/RedisProject/src/db/pool.ts): `Redis/RedisProject/src/db/pool.ts`
- [Redis client](https://github.com/abdalrahman-helal/swe/blob/main/Redis/RedisProject/src/redis/client.ts): `Redis/RedisProject/src/redis/client.ts`
- [Notifications](https://github.com/abdalrahman-helal/swe/blob/main/Redis/RedisProject/src/controllers/notification.controller.ts): `Redis/RedisProject/src/controllers/notification.controller.ts`
- [Notification subscriber](https://github.com/abdalrahman-helal/swe/blob/main/Redis/RedisProject/src/subscribers/notification.subscriber.ts): `Redis/RedisProject/src/subscribers/notification.subscriber.ts`

### Natours Course App

- [Review routes](https://github.com/abdalrahman-helal/swe/blob/main/complete-node-bootcamp/4-natours/after-section-11/routes/reviewRoutes.js): `complete-node-bootcamp/4-natours/after-section-11/routes/reviewRoutes.js`
- [Review access control](https://github.com/abdalrahman-helal/swe/blob/main/complete-node-bootcamp/4-natours/after-section-11/controllers/authController.js): `complete-node-bootcamp/4-natours/after-section-11/controllers/authController.js`
- [Review operations](https://github.com/abdalrahman-helal/swe/blob/main/complete-node-bootcamp/4-natours/after-section-11/controllers/reviewController.js): `complete-node-bootcamp/4-natours/after-section-11/controllers/reviewController.js`
- [Review model](https://github.com/abdalrahman-helal/swe/blob/main/complete-node-bootcamp/4-natours/after-section-11/models/reviewModel.js): `complete-node-bootcamp/4-natours/after-section-11/models/reviewModel.js`
- [CRUD handlers](https://github.com/abdalrahman-helal/swe/blob/main/complete-node-bootcamp/4-natours/after-section-11/controllers/handlerFactory.js): `complete-node-bootcamp/4-natours/after-section-11/controllers/handlerFactory.js`

### Other components

- **API client**
- **PostgreSQL**

## Connections

- API client → Server startup: sends requests
- Server startup → Express app: starts (evidence: `FinalProject/src/server.ts`)
- Express app → Route registry: mounts (evidence: `FinalProject/src/app.ts`)
- Route registry → Authentication routes: registers (evidence: `FinalProject/src/routes/index.ts`)
- Route registry → User task routes: registers (evidence: `FinalProject/src/routes/index.ts`)
- Route registry → Admin task features: registers (evidence: `FinalProject/src/routes/index.ts`)
- Route registry → Banner management: registers (evidence: `FinalProject/src/routes/index.ts`)
- Authentication routes → Authentication: calls (evidence: `FinalProject/src/routes/auth.routes.ts`)
- Authentication routes → JWT authorization: uses (evidence: `FinalProject/src/routes/auth.routes.ts`)
- Authentication → User persistence: calls (evidence: `FinalProject/src/services/auth.service.ts`)
- Authentication → Token signing: signs tokens (evidence: `FinalProject/src/services/auth.service.ts`)
- Authentication → Google sign-in: delegates sign-in (evidence: `FinalProject/src/services/auth.service.ts`)
- User persistence → PostgreSQL: queries
- JWT authorization → Token signing: verifies tokens (evidence: `FinalProject/src/middlewares/auth.middleware.ts`)
- User task routes → JWT authorization: protects routes (evidence: `FinalProject/src/routes/user.task.routes.ts`)
- User task routes → User task service: calls (evidence: `FinalProject/src/routes/user.task.routes.ts`)
- API client → Server startup: sends requests
- Server startup → Express app: starts (evidence: `Redis/RedisProject/src/server.ts`)
- Express app → Route registry: mounts (evidence: `Redis/RedisProject/src/app.ts`)
- Route registry → Product routes: registers
- Product routes → Product API: routes requests (evidence: `Redis/RedisProject/src/routes/product.routes.ts`)
- Product API → Product operations: calls (evidence: `Redis/RedisProject/src/controllers/product.controller.ts`)
- Product operations → SQL connection pool: queries (evidence: `Redis/RedisProject/src/services/product.service.ts`)
- Product operations → Redis client: uses cache (evidence: `Redis/RedisProject/src/services/product.service.ts`)
- Notifications → Notification subscriber: uses (evidence: `Redis/RedisProject/src/controllers/notification.controller.ts`)
- Review routes → Review access control: protects routes (evidence: `complete-node-bootcamp/4-natours/after-section-11/routes/reviewRoutes.js`)
- Review routes → Review operations: dispatches (evidence: `complete-node-bootcamp/4-natours/after-section-11/routes/reviewRoutes.js`)
- Review operations → Review model: uses model (evidence: `complete-node-bootcamp/4-natours/after-section-11/controllers/reviewController.js`)
- Review operations → CRUD handlers: delegates CRUD (evidence: `complete-node-bootcamp/4-natours/after-section-11/controllers/reviewController.js`)
