# tres-joli/metapress architecture

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

- Interactive diagram: https://gitdiagram.com/tres-joli/metapress
- Repository: https://github.com/tres-joli/metapress

## Overview

MetaPress is a single full-stack web application organized as a TanStack Start app inside a Turborepo monorepo. The repo is centered on `apps/web`, which contains the browser UI, server routes/API handlers, domain services, database access, and shared validation/types. There is no separate backend service in the tree; the application server, API endpoints, and SSR route handlers live together in the same app.

At a high level, the architecture has these main layers:

1. Presentation layer
2. Route and request orchestration layer
3. Domain/service layer
4. Persistence and infrastructure layer
5. Shared contracts and utilities

##### 1) Presentation layer

The React UI lives in `apps/web/src/components` and `apps/web/src/routes`.

The UI is split into:
- generic UI primitives under `components/ui`  
  These are the reusable shadcn/Radix-style controls such as buttons, dialogs, inputs, drawers, tooltips, skeletons, and so on.
- layout/navigation components under `components/sidebar`, `footer.tsx`, `theme-toggle.tsx`, etc.
- domain-specific widgets such as:
  - `content-editor.tsx` and `content-viewer.tsx`
  - `comment.tsx`
  - `like.tsx`
  - `share.tsx`
  - `author.tsx`
  - `user-grid.tsx`, `grid.tsx`, list variants
  - auth/account controls like `logout.tsx`, `delete-user.tsx`, `edit-delete.tsx`
- provider wrappers in `components/providers`
  - session provider
  - alert provider
  - root providers composition

These components are what the route pages assemble into actual screens.

The route tree shows the app’s top-level UX boundaries:
- public/auth flows under `routes/(auth)`
  - sign in
  - sign up
  - forgot password
  - reset password
- protected application flows under `routes/(protected)`
  - feed
  - browse
  - create blog
  - edit blog
  - account/profile
  - liked posts
  - admin dashboard
  - user blog pages under `/$username` and `/$username/$blogid`
- public informational pages:
  - home
  - about
  - contact
  - policies

This split is important architecturally: public routes are unauthenticated, protected routes are guarded, and admin routes are a stricter subset.

##### 2) Route and request orchestration layer

TanStack Router/TanStack Start are the main orchestration mechanism.

Routes do not appear to fetch data directly from ad hoc client-side fetch calls; instead, they rely on server query options and loader prefetching. The README confirms the pattern:
- route loaders prefetch data using `context.queryClient.ensureQueryData(...)`
- components consume that data via `useSuspenseQuery(...)`

This creates a clear request/data flow:
- route match happens
- loader prefetches server query data
- React Query cache is populated
- the page component reads from the cache with suspense

That pattern is used throughout the protected content areas like feed, profile, blog detail, and admin views.

There is also route-level request handling for:
- auth callback flow in `routes/callback/oauth.tsx`
- API endpoints under `routes/api`
- middleware-based protection in `src/middleware/auth.ts`
- root app shell in `routes/__root.tsx`
- protected route wrapper in `routes/(protected)/route.tsx`
- auth route wrapper in `routes/(auth)/route.tsx`
- admin wrapper in `routes/(protected)/admin/route.tsx`

##### 3) Domain/service layer

The server side is organized by domain under `src/server`. Each domain generally has the same shape:

- `*.controller.ts`  
  entry points from routes/API handlers
- `*.service.ts`  
  business logic
- `*.repository.ts`  
  database access
- `*.query.ts`  
  React Query option factories for SSR/client data fetching
- `*.schema.ts`  
  request/response validation with Zod-style contracts
- `*.error.ts`  
  domain-specific error types
- `*.type.ts` / `*.types.ts`  
  domain typings

The major domains are:

- `auth`
- `blog`
- `comment`
- `user`
- `general`
- `image`
- `mail`
- `cache`
- `mcp`

This organization is a major architectural boundary. UI code and route handlers should depend on controllers/query helpers, not on database tables directly. Repositories isolate DB access. Schemas validate inputs at the edge. Services contain the actual business rules.

###### Blog domain
The blog subsystem is the core of the product:
- create/edit/fetch blog posts
- list feeds and browse pages
- fetch blog detail by slug/id
- manage blog metadata and content
- likely integrate likes, comments, author data, and cache

###### Comment domain
Handles:
- comment creation
- comment listing
- moderation/validation
- comment data joins with blog and user

###### User domain
Handles:
- profiles
- usernames
- role info
- liked posts
- admin/user separation
- profile/account-related flows

###### General domain
Usually used for cross-cutting non-resource-specific app logic, likely site-wide lookups and aggregates.

###### Image domain
A critical subsystem for content moderation and media handling:
- image upload
- image validation
- NSFW detection
- image-related response contracts

###### Mail domain
Supports transactional email flows such as:
- password reset
- verification
- account-related notifications

###### Cache domain
Wraps Redis usage:
- cache keys
- TTLs
- cache service abstraction

###### MCP domain
Exposes Model Context Protocol tool schemas and handlers for AI integrations.

##### 4) Persistence and infrastructure layer

###### Database
Database code lives in `src/db`:
- `schema.ts`
- `relations.ts`
- `defaults.ts`
- `snowflake.ts`
- `index.ts`

This is Drizzle ORM over PostgreSQL. The data model in the README indicates the core tables/entities are:
- users
- blogs
- comments
- likes
- migrations

The presence of `relations.ts` implies the app uses explicit relational mapping for joins and eager relationships across users, blogs, comments, and likes.

`drizzle.config.ts` and the root docs indicate schema migration and push workflows are part of the architecture.

###### Cache
Redis is a first-class infrastructure dependency, not just an optional optimization:
- `src/lib/redis.ts`
- `src/server/cache/*`

The cache layer likely supports feed/blog/user lookups, rate limiting, and sync jobs. The repo also includes a cron endpoint for syncing likes, which suggests some materialized or periodically reconciled state.

###### Auth
Authentication is built around Better Auth:
- `src/lib/auth.ts`
- `src/lib/auth-client.ts`
- `src/server/auth/auth.controller.ts`
- `routes/api/auth/$.ts`
- OAuth callback route in `routes/callback/oauth.tsx`

The auth system is split between:
- client session state
- server auth handlers
- protected route middleware
- API handlers for auth-specific endpoints

This means auth is both a routing concern and a domain concern.

###### Image moderation and uploads
The content pipeline includes:
- upload support
- Cloudinary integration
- NSFW detection using a local model asset at `public/models/320n.onnx`
- profanity filtering via `src/lib/profanity.ts`

So image/content safety is not just cosmetic; it is part of the server-side validation/moderation pipeline before content is accepted or published.

###### MCP integration
There is an AI/tooling boundary exposed through Model Context Protocol:
- route handlers under `routes/api/mcp/$.ts`
- schema in `src/server/mcp/mcp.schema.ts`

The README says there are HTTP, SSE, and WebSocket transports. That means the app exposes a tool-facing API separate from the normal user-facing UI/API flow.

##### Data flow across the system

###### Blog creation/editing flow
1. A protected route renders the editor UI.
2. The editor component collects rich text, embeds, images, and metadata.
3. Client-side utilities perform slugging, profanity filtering, and content helpers.
4. Image upload goes through the image subsystem, which can moderate and push assets to Cloudinary.
5. The route/controller validates input through shared/server schemas.
6. The blog service persists data through the repository into PostgreSQL.
7. Cache entries may be invalidated or refreshed in Redis.
8. The page/feed queries read from the server query layer and React Query cache.

###### Reading a feed/blog/profile
1. A route loader prefetches query data.
2. Query helpers call controllers/services.
3. Controllers read from repositories and may consult cache.
4. The response is hydrated into the client cache.
5. The UI renders via suspense using shared data.

###### Commenting/liking
1. Client interaction happens in `comment.tsx` or `like.tsx`.
2. The corresponding server domain validates and persists the action.
3. Likes may be synced periodically via `routes/api/cron/sync-likes.ts`.
4. Related feed/profile counts are refreshed through cache-aware query paths.

###### Auth flow
1. Public auth routes render sign-in/sign-up/reset forms.
2. Better Auth handles credential/OAuth mechanics.
3. API auth routes and callback routes complete the handshake.
4. Session state is provided to the UI through the session provider.
5. Protected routes use auth middleware to block unauthenticated access.

###### Admin flow
1. Admin routes are nested under the protected area.
2. Access is role-gated, based on user role in the database/session.
3. Admin dashboard components call the same domain service layer, but with elevated permissions and moderation actions.

##### Shared contracts and boundary enforcement

The `src/shared` directory is a deliberate architecture boundary between client and server:
- shared auth schemas/types/constants
- shared blog schemas/constants
- shared user schemas/constants
- common schemas/types
- shared error types

This means validation and domain shapes are not duplicated across route and server code. The same schemas/types likely define:
- input validation
- request payload shape
- response shape
- consistent error reporting

`domain-error.ts` and `unique-violation.ts` show that domain failures are normalized rather than leaking raw database or framework errors into the UI.

##### Supporting utilities and runtime concerns

A number of `src/lib` modules act as cross-cutting helpers:
- `env.ts` for environment parsing
- `utils.ts` for general helpers
- `slugify.ts`
- `hashids.ts`
- `redis.ts`
- `content/utils.ts`
- `image/*`
- `profanity.ts`

These utilities support the higher-level domains rather than representing separate subsystems.

##### Deployment/runtime shape

The repo is built for:
- Bun runtime/package management
- Vite-based dev/build
- TanStack Start SSR/full-stack rendering
- Vercel deployment
- Docker compose for local PostgreSQL/Redis

So operationally, the app expects:
- a web server that can serve SSR routes and API endpoints
- PostgreSQL for persistence
- Redis for caching and possibly rate-limiting/session-related support
- Cloudinary for media storage
- optional email and OAuth providers
- MCP endpoints for AI/tool integrations

##### Diagram-worthy boundaries to highlight

If you are drawing an architecture diagram, the main boundaries are:

- Browser UI vs. server routes
- Public/auth routes vs. protected/admin routes
- Route handlers vs. domain services/controllers
- Domain services vs. repositories/DB
- App data vs. shared schemas/types
- Primary DB vs. Redis cache
- User-generated content pipeline vs. moderation/image services
- Standard app API vs. MCP tool API
- Auth/session boundary spanning client provider, middleware, and server auth handlers

In short, MetaPress is a monolithic full-stack blogging platform with a clean domain-oriented server structure, SSR/query-prefetch-driven pages, authenticated protected route groups, Drizzle/Postgres persistence, Redis caching, Cloudinary/media moderation, Better Auth-based auth, and a separate MCP integration surface for AI tooling.

Main entry points: [`apps/web/src/server/blog/blog.controller.ts`](https://github.com/tres-joli/metapress/blob/master/apps/web/src/server/blog/blog.controller.ts) (Blog domain), [`apps/web/src/shared/common/common.schema.ts`](https://github.com/tres-joli/metapress/blob/master/apps/web/src/shared/common/common.schema.ts) (Shared schemas), [`apps/web/src/server/user/user.controller.ts`](https://github.com/tres-joli/metapress/blob/master/apps/web/src/server/user/user.controller.ts) (User domain), [`apps/web/src/db/schema.ts`](https://github.com/tres-joli/metapress/blob/master/apps/web/src/db/schema.ts) (Database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Presentation"]
  node_ui_components["UI components<br/>presentation library<br/>[button.tsx]"]
  node_editor_views["Content views<br/>blog UI<br/>[content-editor.tsx]"]
  node_account_views["Account UI<br/>user UI<br/>[logout.tsx]"]
  node_auth_provider["Session provider<br/>client auth state"]
end

subgraph group_routing["Routing"]
  node_root_shell["App shell<br/>TanStack Start root<br/>[__root.tsx]"]
  node_public_routes["Public routes<br/>auth/public pages<br/>[index.tsx]"]
  node_protected_routes["Protected routes<br/>guarded app routes<br/>[route.tsx]"]
  node_admin_routes["Admin routes<br/>role-gated routes<br/>[route.tsx]"]
  node_auth_routes["Auth routes<br/>auth flow routes<br/>[route.tsx]"]
  node_api_routes["API routes<br/>HTTP handlers<br/>[$.ts]"]
end

subgraph group_server["Server domains"]
  node_blog_domain["Blog domain<br/>content orchestration<br/>[blog.controller.ts]"]
  node_comment_domain["Comment domain<br/>discussion orchestration"]
  node_user_domain["User domain<br/>profile orchestration<br/>[user.controller.ts]"]
  node_general_domain["General domain<br/>cross-cutting app logic"]
  node_image_domain["Image domain<br/>media moderation"]
  node_mail_domain["Mail domain<br/>notification service<br/>[mail.service.ts]"]
  node_mcp_domain["MCP schema<br/>tool API contract<br/>[mcp.schema.ts]"]
end

subgraph group_infra["Infrastructure"]
  node_db_layer[("Database<br/>Drizzle/Postgres<br/>[schema.ts]")]
  node_cache_layer[("Redis cache<br/>cache service<br/>[cache.service.ts]")]
  node_auth_infra["Auth core<br/>Better Auth<br/>[auth.ts]"]
  node_media_infra["Media tools<br/>content utilities<br/>[upload-image.ts]"]
end

subgraph group_shared["Shared contracts"]
  node_shared_contracts["Shared schemas<br/>contracts and types<br/>[common.schema.ts]"]
end

node_root_shell -->|"composes"| node_ui_components
node_root_shell -->|"wraps"| node_auth_provider
node_public_routes -->|"renders"| node_ui_components
node_auth_routes -->|"uses"| node_auth_provider
node_protected_routes -->|"renders"| node_editor_views
node_protected_routes -->|"renders"| node_account_views
node_admin_routes -->|"calls"| node_user_domain
node_api_routes -->|"calls"| node_blog_domain
node_api_routes -->|"calls"| node_comment_domain
node_api_routes -->|"exposes"| node_mcp_domain
node_blog_domain -->|"persists via"| node_db_layer
node_comment_domain -->|"persists via"| node_db_layer
node_user_domain -->|"persists via"| node_db_layer
node_blog_domain -->|"uses"| node_cache_layer
node_user_domain -->|"uses"| node_cache_layer
node_blog_domain -->|"depends on"| node_image_domain
node_image_domain -->|"uses"| node_media_infra
node_blog_domain -->|"validates with"| node_shared_contracts
node_comment_domain -->|"validates with"| node_shared_contracts
node_user_domain -->|"validates with"| node_shared_contracts
node_auth_infra -->|"backs"| node_auth_routes
node_auth_infra -->|"guards"| node_protected_routes
node_mail_domain -->|"uses"| node_shared_contracts
node_db_layer -->|"aligns with"| node_shared_contracts

click node_root_shell "https://github.com/tres-joli/metapress/blob/master/apps/web/src/routes/__root.tsx"
click node_public_routes "https://github.com/tres-joli/metapress/blob/master/apps/web/src/routes/index.tsx"
click node_protected_routes "https://github.com/tres-joli/metapress/blob/master/apps/web/src/routes/(protected)/route.tsx"
click node_admin_routes "https://github.com/tres-joli/metapress/blob/master/apps/web/src/routes/(protected)/admin/route.tsx"
click node_auth_routes "https://github.com/tres-joli/metapress/blob/master/apps/web/src/routes/(auth)/route.tsx"
click node_api_routes "https://github.com/tres-joli/metapress/blob/master/apps/web/src/routes/api/auth/$.ts"
click node_ui_components "https://github.com/tres-joli/metapress/blob/master/apps/web/src/components/ui/button.tsx"
click node_editor_views "https://github.com/tres-joli/metapress/blob/master/apps/web/src/components/content-editor.tsx"
click node_account_views "https://github.com/tres-joli/metapress/blob/master/apps/web/src/components/logout.tsx"
click node_auth_provider "https://github.com/tres-joli/metapress/blob/master/apps/web/src/components/providers/session-provider.tsx"
click node_blog_domain "https://github.com/tres-joli/metapress/blob/master/apps/web/src/server/blog/blog.controller.ts"
click node_comment_domain "https://github.com/tres-joli/metapress/blob/master/apps/web/src/server/comment/comment.controller.ts"
click node_user_domain "https://github.com/tres-joli/metapress/blob/master/apps/web/src/server/user/user.controller.ts"
click node_general_domain "https://github.com/tres-joli/metapress/blob/master/apps/web/src/server/general/general.controller.ts"
click node_image_domain "https://github.com/tres-joli/metapress/blob/master/apps/web/src/server/image/image.controller.ts"
click node_mail_domain "https://github.com/tres-joli/metapress/blob/master/apps/web/src/server/mail/mail.service.ts"
click node_mcp_domain "https://github.com/tres-joli/metapress/blob/master/apps/web/src/server/mcp/mcp.schema.ts"
click node_db_layer "https://github.com/tres-joli/metapress/blob/master/apps/web/src/db/schema.ts"
click node_cache_layer "https://github.com/tres-joli/metapress/blob/master/apps/web/src/server/cache/cache.service.ts"
click node_auth_infra "https://github.com/tres-joli/metapress/blob/master/apps/web/src/lib/auth.ts"
click node_media_infra "https://github.com/tres-joli/metapress/blob/master/apps/web/src/lib/image/upload-image.ts"
click node_shared_contracts "https://github.com/tres-joli/metapress/blob/master/apps/web/src/shared/common/common.schema.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_ui_components,node_editor_views,node_account_views,node_auth_provider toneBlue
class node_root_shell,node_public_routes,node_protected_routes,node_admin_routes,node_auth_routes,node_api_routes toneAmber
class node_blog_domain,node_comment_domain,node_user_domain,node_general_domain,node_image_domain,node_mail_domain,node_mcp_domain toneMint
class node_db_layer,node_cache_layer,node_auth_infra,node_media_infra toneRose
class node_shared_contracts toneIndigo
```

## Components

### Presentation

React UI components and route screens

- [UI components](https://github.com/tres-joli/metapress/blob/master/apps/web/src/components/ui/button.tsx): presentation library · Reusable primitives, layout pieces, and domain widgets · `apps/web/src/components/ui/button.tsx`
- [Content views](https://github.com/tres-joli/metapress/blob/master/apps/web/src/components/content-editor.tsx): blog UI · Editor, viewer, like/share, comment, author, and content-specific widgets · `apps/web/src/components/content-editor.tsx`
- [Account UI](https://github.com/tres-joli/metapress/blob/master/apps/web/src/components/logout.tsx): user UI · Profile, logout, delete-user, and related account controls · `apps/web/src/components/logout.tsx`
- [Session provider](https://github.com/tres-joli/metapress/blob/master/apps/web/src/components/providers/session-provider.tsx): client auth state · Root client-side session and alert provider composition · `apps/web/src/components/providers/session-provider.tsx`

### Routing

TanStack Start route shells, loaders, middleware, and APIs

- [App shell](https://github.com/tres-joli/metapress/blob/master/apps/web/src/routes/__root.tsx): TanStack Start root · Root layout, providers, and global app wiring · `apps/web/src/routes/__root.tsx`
- [Public routes](https://github.com/tres-joli/metapress/blob/master/apps/web/src/routes/index.tsx): auth/public pages · Home and informational pages plus auth entry points · `apps/web/src/routes/index.tsx`
- [Protected routes](https://github.com/tres-joli/metapress/blob/master/apps/web/src/routes/(protected)/route.tsx): guarded app routes · Authenticated app pages for feed, browse, profiles, blog actions, and account areas · `apps/web/src/routes/(protected)/route.tsx`
- [Admin routes](https://github.com/tres-joli/metapress/blob/master/apps/web/src/routes/(protected)/admin/route.tsx): role-gated routes · Admin-only wrapper and dashboard area · `apps/web/src/routes/(protected)/admin/route.tsx`
- [Auth routes](https://github.com/tres-joli/metapress/blob/master/apps/web/src/routes/(auth)/route.tsx): auth flow routes · Sign-in, sign-up, reset-password, and auth callback flow · `apps/web/src/routes/(auth)/route.tsx`
- [API routes](https://github.com/tres-joli/metapress/blob/master/apps/web/src/routes/api/auth/$.ts): HTTP handlers · Auth, cron, and MCP endpoint surface · `apps/web/src/routes/api/auth/$.ts`

### Server domains

Domain controllers, services, queries, and repositories

- [Blog domain](https://github.com/tres-joli/metapress/blob/master/apps/web/src/server/blog/blog.controller.ts): content orchestration · Blog controllers, services, queries, repository, and schema boundary · `apps/web/src/server/blog/blog.controller.ts`
- [Comment domain](https://github.com/tres-joli/metapress/blob/master/apps/web/src/server/comment/comment.controller.ts): discussion orchestration · Comment creation, listing, validation, and persistence · `apps/web/src/server/comment/comment.controller.ts`
- [User domain](https://github.com/tres-joli/metapress/blob/master/apps/web/src/server/user/user.controller.ts): profile orchestration · Profiles, usernames, roles, and account-related data access · `apps/web/src/server/user/user.controller.ts`
- [General domain](https://github.com/tres-joli/metapress/blob/master/apps/web/src/server/general/general.controller.ts): cross-cutting app logic · Site-wide query and service layer for shared app operations · `apps/web/src/server/general/general.controller.ts`
- [Image domain](https://github.com/tres-joli/metapress/blob/master/apps/web/src/server/image/image.controller.ts): media moderation · Upload, validation, and NSFW/moderation pipeline for media · `apps/web/src/server/image/image.controller.ts`
- [Mail domain](https://github.com/tres-joli/metapress/blob/master/apps/web/src/server/mail/mail.service.ts): notification service · Transactional email templates and delivery logic · `apps/web/src/server/mail/mail.service.ts`
- [MCP schema](https://github.com/tres-joli/metapress/blob/master/apps/web/src/server/mcp/mcp.schema.ts): tool API contract · Model Context Protocol tool-facing schema surface · `apps/web/src/server/mcp/mcp.schema.ts`

### Infrastructure

Database, cache, auth, media, and runtime helpers

- [Database](https://github.com/tres-joli/metapress/blob/master/apps/web/src/db/schema.ts): Drizzle/Postgres · Schema, relations, defaults, and database access layer · `apps/web/src/db/schema.ts`
- [Redis cache](https://github.com/tres-joli/metapress/blob/master/apps/web/src/server/cache/cache.service.ts): cache service · Cache keys, TTLs, and Redis-backed application cache · `apps/web/src/server/cache/cache.service.ts`
- [Auth core](https://github.com/tres-joli/metapress/blob/master/apps/web/src/lib/auth.ts): Better Auth · Server/client auth adapters and middleware-protected session boundary · `apps/web/src/lib/auth.ts`
- [Media tools](https://github.com/tres-joli/metapress/blob/master/apps/web/src/lib/image/upload-image.ts): content utilities · Slugging, profanity filtering, upload helpers, and image moderation support · `apps/web/src/lib/image/upload-image.ts`

### Shared contracts

Cross-boundary schemas, types, and error shapes

- [Shared schemas](https://github.com/tres-joli/metapress/blob/master/apps/web/src/shared/common/common.schema.ts): contracts and types · Shared auth, blog, user, common schemas, constants, and domain errors · `apps/web/src/shared/common/common.schema.ts`

## Connections

- App shell → UI components: composes · Root app shell mounts global providers and common UI building blocks
- App shell → Session provider: wraps · Provides session and alert context to the app
- Public routes → UI components: renders · Public and auth pages assemble reusable UI primitives
- Auth routes → Session provider: uses · Auth pages rely on session-aware client state
- Protected routes → Content views: renders · Protected screens use domain-specific content widgets
- Protected routes → Account UI: renders · Account and profile flows use account controls
- Admin routes → User domain: calls · Admin views use elevated user-management operations
- API routes → Blog domain: calls · HTTP endpoints dispatch into domain controllers
- API routes → Comment domain: calls · HTTP endpoints dispatch into domain controllers
- API routes → MCP schema: exposes · MCP route serves tool schema and transport handlers
- Blog domain → Database: persists via · Blog repository reads and writes PostgreSQL through Drizzle
- Comment domain → Database: persists via · Comment repository stores discussion data
- User domain → Database: persists via · User repository reads profiles, roles, and account data
- Blog domain → Redis cache: uses · Blog reads and invalidations go through Redis-backed cache
- User domain → Redis cache: uses · User/profile queries may be cache-aware
- Blog domain → Image domain: depends on · Blog creation/editing pipelines use media validation and uploads
- Image domain → Media tools: uses · Image moderation and upload utilities support the media pipeline
- Blog domain → Shared schemas: validates with · Domain input and response shapes are shared across client and server
- Comment domain → Shared schemas: validates with · Comment contracts are shared at the boundary
- User domain → Shared schemas: validates with · User/auth/profile contracts are shared at the boundary
- Auth core → Auth routes: backs · Auth routes and callbacks rely on the auth core
- Auth core → Protected routes: guards · Middleware enforces authenticated access to protected areas
- Mail domain → Shared schemas: uses · Mail flows share validated payload and error shapes
- Database → Shared schemas: aligns with · Database domain errors and types map to shared contracts
