# mgalen007/tether architecture

> Architecture diagram of the GitHub repository mgalen007/tether, 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/mgalen007/tether
- Repository: https://github.com/mgalen007/tether

## Overview

This appears to be a NestJS bookmark-management API, despite the README describing a generic Nest starter. Its main workflow is account registration or login, followed by authenticated bookmark and collection operations backed by PostgreSQL through Prisma. The sampled controllers and services establish those calls and persistence operations; user-service internals and application bootstrap wiring beyond the visible module imports were not sampled, so their internal links are omitted.

Main entry points: [`src/app.module.ts`](https://github.com/mgalen007/tether/blob/main/src/app.module.ts) (Application modules), [`src/modules/bookmarks/bookmarks.controller.ts`](https://github.com/mgalen007/tether/blob/main/src/modules/bookmarks/bookmarks.controller.ts) (Bookmark endpoints), [`src/modules/collections/collections.controller.ts`](https://github.com/mgalen007/tether/blob/main/src/modules/collections/collections.controller.ts) (Collection endpoints), [`src/modules/prisma/prisma.service.ts`](https://github.com/mgalen007/tether/blob/main/src/modules/prisma/prisma.service.ts) (Prisma database client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Application runtime"]
  node_appmodule["Application modules<br/>[app.module.ts]"]
  node_health["Health endpoint<br/>[app.controller.ts]"]
  node_appservice["Health response<br/>[app.service.ts]"]
end

subgraph group_identity["Identity and access"]
  node_authcontroller["Auth endpoints<br/>[auth.controller.ts]"]
  node_authservice["Authentication<br/>[auth.service.ts]"]
  node_userservice["User operations<br/>[users.service.ts]"]
  node_usercontroller["User endpoints"]
  node_jwt["JWT service"]
  node_jwtguard["JWT guard<br/>[jwt-auth.guard.ts]"]
end

subgraph group_bookmarks["Bookmark management"]
  node_bookmarkcontroller["Bookmark endpoints"]
  node_bookmarkservice["Bookmark operations"]
end

subgraph group_collections["Collections and storage"]
  node_collectioncontroller["Collection endpoints"]
  node_collectionservice["Collection operations"]
  node_prisma["Prisma database client<br/>[prisma.service.ts]"]
end

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

node_appmodule -->|"imports auth module"| node_authcontroller
node_appmodule -->|"imports bookmarks module"| node_bookmarkcontroller
node_appmodule -->|"imports collections module"| node_collectioncontroller
node_appmodule -->|"imports users module"| node_usercontroller
node_appmodule -->|"imports Prisma module"| node_prisma
node_client -->|"requests health"| node_health
node_health -->|"calls health check"| node_appservice
node_client -->|"registers or logs in"| node_authcontroller
node_authcontroller -->|"calls auth methods"| node_authservice
node_authservice -->|"creates or finds user"| node_userservice
node_authservice -->|"signs token"| node_jwt
node_client -->|"requests user data"| node_usercontroller
node_usercontroller -->|"calls user methods"| node_userservice
node_client -->|"requests bookmark operations"| node_bookmarkcontroller
node_bookmarkcontroller -->|"requires authentication"| node_jwtguard
node_bookmarkcontroller -->|"calls bookmark methods"| node_bookmarkservice
node_bookmarkservice -->|"reads and writes bookmarks"| node_prisma
node_client -->|"requests collection operations"| node_collectioncontroller
node_collectioncontroller -->|"requires authentication"| node_jwtguard
node_collectioncontroller -->|"calls collection methods"| node_collectionservice
node_collectionservice -->|"reads and writes collections"| node_prisma
node_prisma -->|"connects through pg adapter"| node_postgres

click node_appmodule "https://github.com/mgalen007/tether/blob/main/src/app.module.ts"
click node_health "https://github.com/mgalen007/tether/blob/main/src/app.controller.ts"
click node_appservice "https://github.com/mgalen007/tether/blob/main/src/app.service.ts"
click node_authcontroller "https://github.com/mgalen007/tether/blob/main/src/modules/auth/auth.controller.ts"
click node_authservice "https://github.com/mgalen007/tether/blob/main/src/modules/auth/auth.service.ts"
click node_userservice "https://github.com/mgalen007/tether/blob/main/src/modules/users/users.service.ts"
click node_usercontroller "https://github.com/mgalen007/tether/blob/main/src/modules/users/users.controller.ts"
click node_jwtguard "https://github.com/mgalen007/tether/blob/main/src/modules/auth/guards/jwt-auth.guard.ts"
click node_bookmarkcontroller "https://github.com/mgalen007/tether/blob/main/src/modules/bookmarks/bookmarks.controller.ts"
click node_bookmarkservice "https://github.com/mgalen007/tether/blob/main/src/modules/bookmarks/bookmarks.service.ts"
click node_collectioncontroller "https://github.com/mgalen007/tether/blob/main/src/modules/collections/collections.controller.ts"
click node_collectionservice "https://github.com/mgalen007/tether/blob/main/src/modules/collections/collections.service.ts"
click node_prisma "https://github.com/mgalen007/tether/blob/main/src/modules/prisma/prisma.service.ts"

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_appmodule,node_health,node_appservice,node_client toneBlue
class node_authcontroller,node_authservice,node_userservice,node_usercontroller,node_jwt,node_jwtguard,node_postgres toneAmber
class node_bookmarkcontroller,node_bookmarkservice toneMint
class node_collectioncontroller,node_collectionservice,node_prisma toneRose
```

## Components

### Application runtime

- [Application modules](https://github.com/mgalen007/tether/blob/main/src/app.module.ts): `src/app.module.ts`
- [Health endpoint](https://github.com/mgalen007/tether/blob/main/src/app.controller.ts): `src/app.controller.ts`
- [Health response](https://github.com/mgalen007/tether/blob/main/src/app.service.ts): `src/app.service.ts`

### Identity and access

- [Auth endpoints](https://github.com/mgalen007/tether/blob/main/src/modules/auth/auth.controller.ts): `src/modules/auth/auth.controller.ts`
- [Authentication](https://github.com/mgalen007/tether/blob/main/src/modules/auth/auth.service.ts): `src/modules/auth/auth.service.ts`
- [User operations](https://github.com/mgalen007/tether/blob/main/src/modules/users/users.service.ts): `src/modules/users/users.service.ts`
- [User endpoints](https://github.com/mgalen007/tether/blob/main/src/modules/users/users.controller.ts): `src/modules/users/users.controller.ts`
- **JWT service**
- [JWT guard](https://github.com/mgalen007/tether/blob/main/src/modules/auth/guards/jwt-auth.guard.ts): `src/modules/auth/guards/jwt-auth.guard.ts`

### Bookmark management

- [Bookmark endpoints](https://github.com/mgalen007/tether/blob/main/src/modules/bookmarks/bookmarks.controller.ts): `src/modules/bookmarks/bookmarks.controller.ts`
- [Bookmark operations](https://github.com/mgalen007/tether/blob/main/src/modules/bookmarks/bookmarks.service.ts): `src/modules/bookmarks/bookmarks.service.ts`

### Collections and storage

- [Collection endpoints](https://github.com/mgalen007/tether/blob/main/src/modules/collections/collections.controller.ts): `src/modules/collections/collections.controller.ts`
- [Collection operations](https://github.com/mgalen007/tether/blob/main/src/modules/collections/collections.service.ts): `src/modules/collections/collections.service.ts`
- [Prisma database client](https://github.com/mgalen007/tether/blob/main/src/modules/prisma/prisma.service.ts): `src/modules/prisma/prisma.service.ts`

### Other components

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

## Connections

- Application modules → Auth endpoints: imports auth module
- Application modules → Bookmark endpoints: imports bookmarks module
- Application modules → Collection endpoints: imports collections module
- Application modules → User endpoints: imports users module
- Application modules → Prisma database client: imports Prisma module
- API client → Health endpoint: requests health
- Health endpoint → Health response: calls health check
- API client → Auth endpoints: registers or logs in
- Auth endpoints → Authentication: calls auth methods
- Authentication → User operations: creates or finds user
- Authentication → JWT service: signs token
- API client → User endpoints: requests user data
- User endpoints → User operations: calls user methods
- API client → Bookmark endpoints: requests bookmark operations
- Bookmark endpoints → JWT guard: requires authentication
- Bookmark endpoints → Bookmark operations: calls bookmark methods
- Bookmark operations → Prisma database client: reads and writes bookmarks
- API client → Collection endpoints: requests collection operations
- Collection endpoints → JWT guard: requires authentication
- Collection endpoints → Collection operations: calls collection methods
- Collection operations → Prisma database client: reads and writes collections
- Prisma database client → PostgreSQL: connects through pg adapter
