# abd-allatif/fullstack-giftlink-express architecture

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

- Interactive diagram: https://gitdiagram.com/abd-allatif/fullstack-giftlink-express
- Repository: https://github.com/abd-allatif/fullstack-giftlink-express

## Overview

GiftLink is a React-and-Express gift and household-item discovery app. Users browse the catalogue, search by name and filters, and open item details; account flows register or log in and expose profile updates. The API’s route handlers query MongoDB, while a separate importer seeds catalogue data. An optional standalone sentiment endpoint is another capability documented by the README. The map preserves the documented pages and services; some unsampled page/API and importer relationships are documented only, so those links are marked accordingly.

Main entry points: [`giftlink-frontend/src/App.js`](https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-frontend/src/App.js) (React routes), [`giftlink-backend/app.js`](https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-backend/app.js) (Express app), [`giftlink-frontend/src/components/SearchPage/SearchPage.js`](https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-frontend/src/components/SearchPage/SearchPage.js) (Search filters), [`giftlink-backend/routes/authRoutes.js`](https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-backend/routes/authRoutes.js) (Auth routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["GiftLink frontend"]
  node_app["React routes<br/>[App.js]"]
  node_navbar["Navigation<br/>[Navbar.js]"]
  node_home["Gift catalogue<br/>[MainPage.js]"]
  node_searchui["Search filters<br/>[SearchPage.js]"]
  node_details["Item details<br/>[DetailsPage.js]"]
  node_login["Login page<br/>[LoginPage.js]"]
  node_register["Registration<br/>[RegisterPage.js]"]
  node_profile["User profile<br/>[Profile.js]"]
  node_authstate["Auth context<br/>[AuthContext.js]"]
  node_frontendconfig["API URL config<br/>[config.js]"]
end

subgraph group_api["GiftLink API"]
  node_server["Express app<br/>[app.js]"]
  node_authapi["Auth routes<br/>[authRoutes.js]"]
  node_giftroutes["Gift routes<br/>[giftRoutes.js]"]
  node_searchapi["Search route<br/>[searchRoutes.js]"]
  node_logger["Request logging<br/>[logger.js]"]
end

subgraph group_data["Catalogue data"]
  node_dbconnector["DB connection<br/>[db.js]"]
  node_mongodb[("MongoDB")]
  node_seedimport["Catalogue importer<br/>[index.js]"]
end

subgraph group_optional["Optional service"]
  node_sentiment["Sentiment endpoint<br/>[index.js]"]
end

node_visitor(("Gift seeker"))

node_visitor -->|"uses"| node_app
node_app -->|"renders"| node_navbar
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_register
node_app -->|"routes to"| node_searchui
node_searchui -->|"navigates to"| node_details
node_login -->|"updates state"| node_authstate
node_register -->|"updates state"| node_authstate
node_navbar -->|"reads state"| node_authstate
node_login -->|"gets API URL"| node_frontendconfig
node_register -->|"gets API URL"| node_frontendconfig
node_searchui -->|"gets API URL"| node_frontendconfig
node_details -->|"gets API URL"| node_frontendconfig
node_profile -->|"gets API URL"| node_frontendconfig
node_login -->|"posts login"| node_authapi
node_register -->|"posts registration"| node_authapi
node_searchui -->|"fetches catalogue"| node_giftroutes
node_searchui -->|"submits filters"| node_searchapi
node_details -->|"fetches item"| node_giftroutes
node_profile -->|"updates profile"| node_authapi
node_server -->|"mounts routes"| node_authapi
node_server -->|"mounts routes"| node_giftroutes
node_server -->|"mounts routes"| node_searchapi
node_server -->|"connects at startup"| node_dbconnector
node_server -->|"configures logging"| node_logger
node_authapi -->|"queries users"| node_dbconnector
node_giftroutes -->|"queries gifts"| node_dbconnector
node_searchapi -->|"queries gifts"| node_dbconnector
node_dbconnector -->|"selects giftdb"| node_mongodb
node_seedimport -.->|"seeds catalogue"| node_mongodb
node_sentiment -.->|"classifies text"| node_visitor

click node_app "https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-frontend/src/App.js"
click node_navbar "https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-frontend/src/components/Navbar/Navbar.js"
click node_home "https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-frontend/src/components/MainPage/MainPage.js"
click node_searchui "https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-frontend/src/components/SearchPage/SearchPage.js"
click node_details "https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-frontend/src/components/DetailsPage/DetailsPage.js"
click node_login "https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-frontend/src/components/LoginPage/LoginPage.js"
click node_register "https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-frontend/src/components/RegisterPage/RegisterPage.js"
click node_profile "https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-frontend/src/components/Profile/Profile.js"
click node_authstate "https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-frontend/src/context/AuthContext.js"
click node_frontendconfig "https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-frontend/src/config.js"
click node_server "https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-backend/app.js"
click node_authapi "https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-backend/routes/authRoutes.js"
click node_giftroutes "https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-backend/routes/giftRoutes.js"
click node_searchapi "https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-backend/routes/searchRoutes.js"
click node_logger "https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-backend/logger.js"
click node_dbconnector "https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-backend/models/db.js"
click node_seedimport "https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-backend/util/import-mongo/index.js"
click node_sentiment "https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/sentiment/index.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_app,node_navbar,node_home,node_searchui,node_details,node_login,node_register,node_profile,node_authstate,node_frontendconfig toneBlue
class node_server,node_authapi,node_giftroutes,node_searchapi,node_logger toneAmber
class node_dbconnector,node_mongodb,node_seedimport toneMint
class node_sentiment toneRose
class node_visitor toneIndigo
```

## Components

### GiftLink frontend

- [React routes](https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-frontend/src/App.js): `giftlink-frontend/src/App.js`
- [Navigation](https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-frontend/src/components/Navbar/Navbar.js): `giftlink-frontend/src/components/Navbar/Navbar.js`
- [Gift catalogue](https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-frontend/src/components/MainPage/MainPage.js): `giftlink-frontend/src/components/MainPage/MainPage.js`
- [Search filters](https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-frontend/src/components/SearchPage/SearchPage.js): `giftlink-frontend/src/components/SearchPage/SearchPage.js`
- [Item details](https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-frontend/src/components/DetailsPage/DetailsPage.js): `giftlink-frontend/src/components/DetailsPage/DetailsPage.js`
- [Login page](https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-frontend/src/components/LoginPage/LoginPage.js): `giftlink-frontend/src/components/LoginPage/LoginPage.js`
- [Registration](https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-frontend/src/components/RegisterPage/RegisterPage.js): `giftlink-frontend/src/components/RegisterPage/RegisterPage.js`
- [User profile](https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-frontend/src/components/Profile/Profile.js): `giftlink-frontend/src/components/Profile/Profile.js`
- [Auth context](https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-frontend/src/context/AuthContext.js): `giftlink-frontend/src/context/AuthContext.js`
- [API URL config](https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-frontend/src/config.js): `giftlink-frontend/src/config.js`

### GiftLink API

- [Express app](https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-backend/app.js): `giftlink-backend/app.js`
- [Auth routes](https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-backend/routes/authRoutes.js): `giftlink-backend/routes/authRoutes.js`
- [Gift routes](https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-backend/routes/giftRoutes.js): `giftlink-backend/routes/giftRoutes.js`
- [Search route](https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-backend/routes/searchRoutes.js): `giftlink-backend/routes/searchRoutes.js`
- [Request logging](https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-backend/logger.js): `giftlink-backend/logger.js`

### Catalogue data

- [DB connection](https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-backend/models/db.js): `giftlink-backend/models/db.js`
- **MongoDB**
- [Catalogue importer](https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/giftlink-backend/util/import-mongo/index.js): `giftlink-backend/util/import-mongo/index.js`

### Optional service

- [Sentiment endpoint](https://github.com/abd-allatif/fullstack-giftlink-express/blob/main/sentiment/index.js): `sentiment/index.js`

### Other components

- **Gift seeker**

## Connections

- Gift seeker → React routes: uses (evidence: `giftlink-frontend/src/App.js`)
- React routes → Navigation: renders (evidence: `giftlink-frontend/src/App.js`)
- React routes → Gift catalogue: routes to (evidence: `giftlink-frontend/src/App.js`)
- React routes → Login page: routes to (evidence: `giftlink-frontend/src/App.js`)
- React routes → Registration: routes to (evidence: `giftlink-frontend/src/App.js`)
- React routes → Search filters: routes to (evidence: `giftlink-frontend/src/App.js`)
- Search filters → Item details: navigates to (evidence: `giftlink-frontend/src/components/SearchPage/SearchPage.js`)
- Login page → Auth context: updates state (evidence: `giftlink-frontend/src/components/LoginPage/LoginPage.js`)
- Registration → Auth context: updates state (evidence: `giftlink-frontend/src/components/RegisterPage/RegisterPage.js`)
- Navigation → Auth context: reads state (evidence: `giftlink-frontend/src/components/Navbar/Navbar.js`)
- Login page → API URL config: gets API URL (evidence: `giftlink-frontend/src/components/LoginPage/LoginPage.js`)
- Registration → API URL config: gets API URL (evidence: `giftlink-frontend/src/components/RegisterPage/RegisterPage.js`)
- Search filters → API URL config: gets API URL (evidence: `giftlink-frontend/src/components/SearchPage/SearchPage.js`)
- Item details → API URL config: gets API URL (evidence: `giftlink-frontend/src/components/DetailsPage/DetailsPage.js`)
- User profile → API URL config: gets API URL (evidence: `giftlink-frontend/src/components/Profile/Profile.js`)
- Login page → Auth routes: posts login (evidence: `giftlink-frontend/src/components/LoginPage/LoginPage.js`)
- Registration → Auth routes: posts registration (evidence: `giftlink-frontend/src/components/RegisterPage/RegisterPage.js`)
- Search filters → Gift routes: fetches catalogue (evidence: `giftlink-frontend/src/components/SearchPage/SearchPage.js`)
- Search filters → Search route: submits filters (evidence: `giftlink-frontend/src/components/SearchPage/SearchPage.js`)
- Item details → Gift routes: fetches item (evidence: `giftlink-frontend/src/components/DetailsPage/DetailsPage.js`)
- User profile → Auth routes: updates profile (evidence: `giftlink-frontend/src/components/Profile/Profile.js`)
- Express app → Auth routes: mounts routes (evidence: `giftlink-backend/app.js`)
- Express app → Gift routes: mounts routes (evidence: `giftlink-backend/app.js`)
- Express app → Search route: mounts routes (evidence: `giftlink-backend/app.js`)
- Express app → DB connection: connects at startup (evidence: `giftlink-backend/app.js`)
- Express app → Request logging: configures logging (evidence: `giftlink-backend/app.js`)
- Auth routes → DB connection: queries users (evidence: `giftlink-backend/routes/authRoutes.js`)
- Gift routes → DB connection: queries gifts (evidence: `giftlink-backend/routes/giftRoutes.js`)
- Search route → DB connection: queries gifts (evidence: `giftlink-backend/routes/searchRoutes.js`)
- DB connection → MongoDB: selects giftdb (evidence: `giftlink-backend/models/db.js`)
- Catalogue importer → MongoDB: seeds catalogue (evidence: `README.md`)
- Sentiment endpoint → Gift seeker: classifies text (evidence: `README.md`)
