# fdenepal/fde architecture

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

- Interactive diagram: https://gitdiagram.com/fdenepal/fde
- Repository: https://github.com/fdenepal/fde

## Overview

Forum for Digital Equality is an Express/EJS public website with a MongoDB-backed CMS. Visitors browse organization pages, projects, research and stories, and can submit contact messages or subscribe; administrators sign in to edit pages and settings, manage content, review submissions, and upload media. The graph shows the route handlers as workflow owners, with model groups representing persistence. Source excerpts support the main route, bootstrap, and media relationships; unsampled templates and some model internals are represented at their documented paths.

Main entry points: [`routes/admin.js`](https://github.com/fdenepal/fde/blob/main/routes/admin.js) (Admin routes), [`server.js`](https://github.com/fdenepal/fde/blob/main/server.js) (Express server), [`routes/public.js`](https://github.com/fdenepal/fde/blob/main/routes/public.js) (Public routes), [`lib/bootstrap.js`](https://github.com/fdenepal/fde/blob/main/lib/bootstrap.js) (Initial setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Application runtime"]
  node_server["Express server<br/>[server.js]"]
  node_bootstrap["Initial setup<br/>[bootstrap.js]"]
  node_auth["Admin auth<br/>[auth.js]"]
  node_media["Media uploads<br/>[cloudinary.js]"]
end

subgraph group_public["Public website"]
  node_public_routes["Public routes<br/>[public.js]"]
  node_public_views["Public pages"]
end

subgraph group_cms["Content management"]
  node_admin_routes["Admin routes<br/>[admin.js]"]
  node_admin_views["Admin screens"]
  node_page_fields["Page field specs<br/>[pageFields.js]"]
end

subgraph group_data["Domain data"]
  node_page_settings[("Pages and settings")]
  node_identity[("Admin users<br/>[User.js]")]
  node_editorial[("Editorial content")]
  node_audience[("Contact and subscribers")]
end

node_visitor(("Visitor"))
node_administrator(("Administrator"))
node_mongodb[("MongoDB")]
node_cloudinary_service[("Cloudinary")]

node_visitor -->|"requests pages"| node_server
node_administrator -->|"requests admin"| node_server
node_server -->|"initializes data"| node_bootstrap
node_server -->|"mounts routes"| node_public_routes
node_server -->|"mounts routes"| node_admin_routes
node_server -->|"loads settings"| node_page_settings
node_server -->|"connects"| node_mongodb
node_server -->|"configures uploads"| node_media
node_bootstrap -->|"creates admin"| node_identity
node_bootstrap -->|"ensures records"| node_page_settings
node_bootstrap -->|"reads page specs"| node_page_fields
node_public_routes -->|"renders pages"| node_public_views
node_public_routes -->|"reads page content"| node_page_settings
node_public_routes -->|"reads content"| node_editorial
node_public_routes -->|"saves submissions"| node_audience
node_admin_routes -->|"checks access"| node_auth
node_admin_routes -->|"renders screens"| node_admin_views
node_admin_routes -->|"checks credentials"| node_identity
node_admin_routes -->|"edits pages and settings"| node_page_settings
node_admin_routes -->|"manages content"| node_editorial
node_admin_routes -->|"reviews submissions"| node_audience
node_admin_routes -->|"uses page specs"| node_page_fields
node_admin_routes -->|"uploads media"| node_media
node_media -.->|"uploads remotely"| node_cloudinary_service
node_media -.->|"stores local fallback"| node_server

click node_server "https://github.com/fdenepal/fde/blob/main/server.js"
click node_bootstrap "https://github.com/fdenepal/fde/blob/main/lib/bootstrap.js"
click node_auth "https://github.com/fdenepal/fde/blob/main/middleware/auth.js"
click node_media "https://github.com/fdenepal/fde/blob/main/lib/cloudinary.js"
click node_public_routes "https://github.com/fdenepal/fde/blob/main/routes/public.js"
click node_public_views "https://github.com/fdenepal/fde/tree/main/views/pages"
click node_admin_routes "https://github.com/fdenepal/fde/blob/main/routes/admin.js"
click node_admin_views "https://github.com/fdenepal/fde/tree/main/views/admin"
click node_page_fields "https://github.com/fdenepal/fde/blob/main/lib/pageFields.js"
click node_page_settings "https://github.com/fdenepal/fde/tree/main/models"
click node_identity "https://github.com/fdenepal/fde/blob/main/models/User.js"
click node_editorial "https://github.com/fdenepal/fde/tree/main/models"
click node_audience "https://github.com/fdenepal/fde/tree/main/models"

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_server,node_bootstrap,node_auth,node_media toneBlue
class node_public_routes,node_public_views,node_mongodb,node_cloudinary_service toneAmber
class node_admin_routes,node_admin_views,node_page_fields toneMint
class node_page_settings,node_identity,node_editorial,node_audience toneRose
class node_visitor,node_administrator toneIndigo
```

## Components

### Application runtime

- [Express server](https://github.com/fdenepal/fde/blob/main/server.js): `server.js`
- [Initial setup](https://github.com/fdenepal/fde/blob/main/lib/bootstrap.js): `lib/bootstrap.js`
- [Admin auth](https://github.com/fdenepal/fde/blob/main/middleware/auth.js): `middleware/auth.js`
- [Media uploads](https://github.com/fdenepal/fde/blob/main/lib/cloudinary.js): `lib/cloudinary.js`

### Public website

- [Public routes](https://github.com/fdenepal/fde/blob/main/routes/public.js): `routes/public.js`
- [Public pages](https://github.com/fdenepal/fde/tree/main/views/pages): `views/pages`

### Content management

- [Admin routes](https://github.com/fdenepal/fde/blob/main/routes/admin.js): `routes/admin.js`
- [Admin screens](https://github.com/fdenepal/fde/tree/main/views/admin): `views/admin`
- [Page field specs](https://github.com/fdenepal/fde/blob/main/lib/pageFields.js): `lib/pageFields.js`

### Domain data

- [Pages and settings](https://github.com/fdenepal/fde/tree/main/models): `models`
- [Admin users](https://github.com/fdenepal/fde/blob/main/models/User.js): `models/User.js`
- [Editorial content](https://github.com/fdenepal/fde/tree/main/models): `models`
- [Contact and subscribers](https://github.com/fdenepal/fde/tree/main/models): `models`

### Other components

- **Visitor**
- **Administrator**
- **MongoDB**
- **Cloudinary**

## Connections

- Visitor → Express server: requests pages (evidence: `server.js`)
- Administrator → Express server: requests admin (evidence: `server.js`)
- Express server → Initial setup: initializes data (evidence: `server.js`)
- Express server → Public routes: mounts routes (evidence: `server.js`)
- Express server → Admin routes: mounts routes (evidence: `server.js`)
- Express server → Pages and settings: loads settings (evidence: `server.js`)
- Express server → MongoDB: connects (evidence: `server.js`)
- Express server → Media uploads: configures uploads (evidence: `server.js`)
- Initial setup → Admin users: creates admin (evidence: `lib/bootstrap.js`)
- Initial setup → Pages and settings: ensures records (evidence: `lib/bootstrap.js`)
- Initial setup → Page field specs: reads page specs (evidence: `lib/bootstrap.js`)
- Public routes → Public pages: renders pages (evidence: `routes/public.js`)
- Public routes → Pages and settings: reads page content (evidence: `routes/public.js`)
- Public routes → Editorial content: reads content (evidence: `routes/public.js`)
- Public routes → Contact and subscribers: saves submissions (evidence: `routes/public.js`)
- Admin routes → Admin auth: checks access (evidence: `routes/admin.js`)
- Admin routes → Admin screens: renders screens (evidence: `routes/admin.js`)
- Admin routes → Admin users: checks credentials (evidence: `routes/admin.js`)
- Admin routes → Pages and settings: edits pages and settings (evidence: `routes/admin.js`)
- Admin routes → Editorial content: manages content (evidence: `routes/admin.js`)
- Admin routes → Contact and subscribers: reviews submissions (evidence: `routes/admin.js`)
- Admin routes → Page field specs: uses page specs (evidence: `routes/admin.js`)
- Admin routes → Media uploads: uploads media (evidence: `routes/admin.js`)
- Media uploads → Cloudinary: uploads remotely (evidence: `lib/cloudinary.js`)
- Media uploads → Express server: stores local fallback (evidence: `lib/cloudinary.js`)
