# franwik/mememuseum architecture

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

- Interactive diagram: https://gitdiagram.com/franwik/mememuseum
- Repository: https://github.com/franwik/mememuseum

## Overview

Meme Museum is an Angular and Express web app for registering users and sharing, discovering, voting on, and commenting on memes. The main journey runs from browser navigation through Angular pages and API services to Express routes and controllers, which read or update PostgreSQL-backed data; uploads also pass through a file uploader. Search, daily memes, tags, and meme details are distinct discovery stages. The source index and excerpts support the frontend routing, service calls, route dispatch, and database access shown; unsampled HTTP wiring is marked unverified.

Main entry points: [`frontend/src/app/app.routes.ts`](https://github.com/franwik/mememuseum/blob/main/frontend/src/app/app.routes.ts) (Page routing), [`frontend/src/app/_services/meme.service.ts`](https://github.com/franwik/mememuseum/blob/main/frontend/src/app/_services/meme.service.ts) (Meme service), [`backend/routes/memeRoutes.js`](https://github.com/franwik/mememuseum/blob/main/backend/routes/memeRoutes.js) (Meme routes), [`backend/data/remote/Database.js`](https://github.com/franwik/mememuseum/blob/main/backend/data/remote/Database.js) (Sequelize models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Angular application"]
  node_app["App shell<br/>[app.ts]"]
  node_routing["Page routing<br/>[app.routes.ts]"]
  node_authpages["Login and register<br/>[login.ts]"]
  node_createpage["Meme creation<br/>[create-meme.ts]"]
  node_explorepage["Explore memes<br/>[explore-meme.ts]"]
  node_searchpage["Search memes<br/>[search.ts]"]
  node_homepage["Home feed<br/>[home.ts]"]
  node_detailpage["Meme details<br/>[memedetails.ts]"]
  node_preview["Meme preview<br/>[meme-preview.ts]"]
  node_memeservice["Meme service<br/>[meme.service.ts]"]
  node_toastservice["Toast service<br/>[toast.service.ts]"]
  node_toastui["Toast display<br/>[toast.ts]"]
end

subgraph group_backend["Express API"]
  node_authroutes["Auth routes<br/>[authRoutes.js]"]
  node_memeroutes["Meme routes<br/>[memeRoutes.js]"]
  node_memecontroller["Meme controller<br/>[memeController.js]"]
end

subgraph group_data["Persistence and uploads"]
  node_uploader["Image uploader<br/>[uploader.js]"]
  node_database[("Sequelize models<br/>[Database.js]")]
end

subgraph group_identity["Authentication"]
  node_authservice["Auth service<br/>[auth.service.ts]"]
  node_guard["Auth guards"]
  node_authcontroller["Auth controller<br/>[authController.js]"]
  node_authmiddleware["JWT middleware<br/>[authMiddleware.js]"]
end

node_browser(("Browser user"))
node_postgres[("PostgreSQL")]

node_browser -->|"navigates"| node_routing
node_routing -->|"routes to"| node_homepage
node_routing -->|"routes to"| node_authpages
node_routing -->|"routes to"| node_searchpage
node_routing -->|"routes to"| node_detailpage
node_routing -->|"routes to"| node_createpage
node_routing -->|"routes to"| node_explorepage
node_app -.->|"hosts"| node_routing
node_app -->|"renders"| node_toastui
node_authpages -->|"calls"| node_authservice
node_createpage -->|"calls"| node_memeservice
node_explorepage -->|"calls"| node_memeservice
node_searchpage -->|"calls"| node_memeservice
node_homepage -->|"calls"| node_memeservice
node_detailpage -->|"calls"| node_memeservice
node_detailpage -->|"calls"| node_authservice
node_explorepage -->|"renders"| node_preview
node_searchpage -->|"renders"| node_preview
node_guard -->|"checks identity"| node_authservice
node_toastui -->|"subscribes"| node_toastservice
node_authservice -.->|"HTTP requests"| node_authroutes
node_memeservice -.->|"HTTP requests"| node_memeroutes
node_authroutes -->|"dispatches"| node_authcontroller
node_memeroutes -->|"dispatches"| node_memecontroller
node_memeroutes -->|"protects routes"| node_authmiddleware
node_memeroutes -->|"uploads through"| node_uploader
node_authcontroller -->|"queries users"| node_database
node_authmiddleware -->|"loads user"| node_database
node_memecontroller -->|"queries and updates"| node_database
node_database -->|"persists data"| node_postgres

click node_app "https://github.com/franwik/mememuseum/blob/main/frontend/src/app/app.ts"
click node_routing "https://github.com/franwik/mememuseum/blob/main/frontend/src/app/app.routes.ts"
click node_authpages "https://github.com/franwik/mememuseum/blob/main/frontend/src/app/pages/login/login.ts"
click node_createpage "https://github.com/franwik/mememuseum/blob/main/frontend/src/app/pages/create-meme/create-meme.ts"
click node_explorepage "https://github.com/franwik/mememuseum/blob/main/frontend/src/app/pages/explore-meme/explore-meme.ts"
click node_searchpage "https://github.com/franwik/mememuseum/blob/main/frontend/src/app/pages/search/search.ts"
click node_homepage "https://github.com/franwik/mememuseum/blob/main/frontend/src/app/pages/home/home.ts"
click node_detailpage "https://github.com/franwik/mememuseum/blob/main/frontend/src/app/pages/memedetails/memedetails.ts"
click node_preview "https://github.com/franwik/mememuseum/blob/main/frontend/src/app/components/meme-preview/meme-preview.ts"
click node_authservice "https://github.com/franwik/mememuseum/blob/main/frontend/src/app/_services/auth.service.ts"
click node_guard "https://github.com/franwik/mememuseum/blob/main/frontend/src/app/_auth/auth.guard-guard.ts"
click node_memeservice "https://github.com/franwik/mememuseum/blob/main/frontend/src/app/_services/meme.service.ts"
click node_toastservice "https://github.com/franwik/mememuseum/blob/main/frontend/src/app/_services/toast.service.ts"
click node_toastui "https://github.com/franwik/mememuseum/blob/main/frontend/src/app/components/toast/toast.ts"
click node_authroutes "https://github.com/franwik/mememuseum/blob/main/backend/routes/authRoutes.js"
click node_memeroutes "https://github.com/franwik/mememuseum/blob/main/backend/routes/memeRoutes.js"
click node_authcontroller "https://github.com/franwik/mememuseum/blob/main/backend/controllers/authController.js"
click node_authmiddleware "https://github.com/franwik/mememuseum/blob/main/backend/middleware/authMiddleware.js"
click node_memecontroller "https://github.com/franwik/mememuseum/blob/main/backend/controllers/memeController.js"
click node_uploader "https://github.com/franwik/mememuseum/blob/main/backend/data/local/multerStorage/uploader.js"
click node_database "https://github.com/franwik/mememuseum/blob/main/backend/data/remote/Database.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_routing,node_authpages,node_createpage,node_explorepage,node_searchpage,node_homepage,node_detailpage,node_preview,node_memeservice,node_toastservice,node_toastui,node_browser toneBlue
class node_authroutes,node_memeroutes,node_memecontroller,node_postgres toneAmber
class node_uploader,node_database toneMint
class node_authservice,node_guard,node_authcontroller,node_authmiddleware toneRose
```

## Components

### Angular application

- [App shell](https://github.com/franwik/mememuseum/blob/main/frontend/src/app/app.ts): `frontend/src/app/app.ts`
- [Page routing](https://github.com/franwik/mememuseum/blob/main/frontend/src/app/app.routes.ts): `frontend/src/app/app.routes.ts`
- [Login and register](https://github.com/franwik/mememuseum/blob/main/frontend/src/app/pages/login/login.ts): `frontend/src/app/pages/login/login.ts`
- [Meme creation](https://github.com/franwik/mememuseum/blob/main/frontend/src/app/pages/create-meme/create-meme.ts): `frontend/src/app/pages/create-meme/create-meme.ts`
- [Explore memes](https://github.com/franwik/mememuseum/blob/main/frontend/src/app/pages/explore-meme/explore-meme.ts): `frontend/src/app/pages/explore-meme/explore-meme.ts`
- [Search memes](https://github.com/franwik/mememuseum/blob/main/frontend/src/app/pages/search/search.ts): `frontend/src/app/pages/search/search.ts`
- [Home feed](https://github.com/franwik/mememuseum/blob/main/frontend/src/app/pages/home/home.ts): `frontend/src/app/pages/home/home.ts`
- [Meme details](https://github.com/franwik/mememuseum/blob/main/frontend/src/app/pages/memedetails/memedetails.ts): `frontend/src/app/pages/memedetails/memedetails.ts`
- [Meme preview](https://github.com/franwik/mememuseum/blob/main/frontend/src/app/components/meme-preview/meme-preview.ts): `frontend/src/app/components/meme-preview/meme-preview.ts`
- [Meme service](https://github.com/franwik/mememuseum/blob/main/frontend/src/app/_services/meme.service.ts): `frontend/src/app/_services/meme.service.ts`
- [Toast service](https://github.com/franwik/mememuseum/blob/main/frontend/src/app/_services/toast.service.ts): `frontend/src/app/_services/toast.service.ts`
- [Toast display](https://github.com/franwik/mememuseum/blob/main/frontend/src/app/components/toast/toast.ts): `frontend/src/app/components/toast/toast.ts`

### Express API

- [Auth routes](https://github.com/franwik/mememuseum/blob/main/backend/routes/authRoutes.js): `backend/routes/authRoutes.js`
- [Meme routes](https://github.com/franwik/mememuseum/blob/main/backend/routes/memeRoutes.js): `backend/routes/memeRoutes.js`
- [Meme controller](https://github.com/franwik/mememuseum/blob/main/backend/controllers/memeController.js): `backend/controllers/memeController.js`

### Persistence and uploads

- [Image uploader](https://github.com/franwik/mememuseum/blob/main/backend/data/local/multerStorage/uploader.js): `backend/data/local/multerStorage/uploader.js`
- [Sequelize models](https://github.com/franwik/mememuseum/blob/main/backend/data/remote/Database.js): `backend/data/remote/Database.js`

### Authentication

- [Auth service](https://github.com/franwik/mememuseum/blob/main/frontend/src/app/_services/auth.service.ts): `frontend/src/app/_services/auth.service.ts`
- [Auth guards](https://github.com/franwik/mememuseum/blob/main/frontend/src/app/_auth/auth.guard-guard.ts): `frontend/src/app/_auth/auth.guard-guard.ts`
- [Auth controller](https://github.com/franwik/mememuseum/blob/main/backend/controllers/authController.js): `backend/controllers/authController.js`
- [JWT middleware](https://github.com/franwik/mememuseum/blob/main/backend/middleware/authMiddleware.js): `backend/middleware/authMiddleware.js`

### Other components

- **Browser user**
- **PostgreSQL**

## Connections

- Browser user → Page routing: navigates
- Page routing → Home feed: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Page routing → Login and register: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Page routing → Search memes: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Page routing → Meme details: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Page routing → Meme creation: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Page routing → Explore memes: routes to (evidence: `frontend/src/app/app.routes.ts`)
- App shell → Page routing: hosts
- App shell → Toast display: renders (evidence: `frontend/src/app/app.ts`)
- Login and register → Auth service: calls (evidence: `frontend/src/app/pages/login/login.ts`)
- Meme creation → Meme service: calls (evidence: `frontend/src/app/pages/create-meme/create-meme.ts`)
- Explore memes → Meme service: calls (evidence: `frontend/src/app/pages/explore-meme/explore-meme.ts`)
- Search memes → Meme service: calls (evidence: `frontend/src/app/pages/search/search.ts`)
- Home feed → Meme service: calls (evidence: `frontend/src/app/pages/home/home.ts`)
- Meme details → Meme service: calls (evidence: `frontend/src/app/pages/memedetails/memedetails.ts`)
- Meme details → Auth service: calls (evidence: `frontend/src/app/pages/memedetails/memedetails.ts`)
- Explore memes → Meme preview: renders (evidence: `frontend/src/app/pages/explore-meme/explore-meme.ts`)
- Search memes → Meme preview: renders (evidence: `frontend/src/app/pages/search/search.ts`)
- Auth guards → Auth service: checks identity (evidence: `frontend/src/app/_auth/auth.guard-guard.ts`)
- Toast display → Toast service: subscribes (evidence: `frontend/src/app/components/toast/toast.ts`)
- Auth service → Auth routes: HTTP requests
- Meme service → Meme routes: HTTP requests
- Auth routes → Auth controller: dispatches (evidence: `backend/routes/authRoutes.js`)
- Meme routes → Meme controller: dispatches (evidence: `backend/routes/memeRoutes.js`)
- Meme routes → JWT middleware: protects routes (evidence: `backend/routes/memeRoutes.js`)
- Meme routes → Image uploader: uploads through (evidence: `backend/routes/memeRoutes.js`)
- Auth controller → Sequelize models: queries users (evidence: `backend/controllers/authController.js`)
- JWT middleware → Sequelize models: loads user (evidence: `backend/middleware/authMiddleware.js`)
- Meme controller → Sequelize models: queries and updates (evidence: `backend/controllers/memeController.js`)
- Sequelize models → PostgreSQL: persists data (evidence: `backend/data/remote/Database.js`)
