# davipeter07/alice-blog architecture

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

- Interactive diagram: https://gitdiagram.com/davipeter07/alice-blog
- Repository: https://github.com/davipeter07/alice-blog

## Overview

Alice-Blog is a Next.js publication for essays, with reader-facing landing and paginated/tag-filtered articles, nested comments and likes, plus account and admin workflows. The graph shows routes invoking data access or Server Actions, with Prisma as persistence, and captures the documented theme and no-login reading preferences. Unsampled feature paths are included only at directory level when the tree and README establish the capability; their internal links are omitted where no relationship is evidenced.

Main entry points: [`src/app/blog/[slug]/page.tsx`](https://github.com/davipeter07/alice-blog/blob/main/src/app/blog/%5Bslug%5D/page.tsx) (Article detail), [`src/data-access/posts.ts`](https://github.com/davipeter07/alice-blog/blob/main/src/data-access/posts.ts) (Post data access), [`src/lib/prisma.ts`](https://github.com/davipeter07/alice-blog/blob/main/src/lib/prisma.ts) (PostgreSQL), [`src/app/page.tsx`](https://github.com/davipeter07/alice-blog/blob/main/src/app/page.tsx) (Landing experience)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_publishing["Reader publishing"]
  node_landing["Landing experience<br/>[page.tsx]"]
  node_landing_sections["Landing sections"]
  node_article_list["Article listing<br/>[page.tsx]"]
  node_post_cards["Post cards<br/>[post-card.tsx]"]
  node_article_detail["Article detail<br/>[page.tsx]"]
  node_markdown["Markdown rendering<br/>[page.tsx]"]
end

subgraph group_engagement["Reader engagement"]
  node_comments["Nested comments"]
  node_comment_hook["Comment interactions"]
  node_comment_actions["Comment actions<br/>[comments.ts]"]
  node_likes["Post likes<br/>[likes.ts]"]
end

subgraph group_identity["Identity and admin"]
  node_admin_posts["Post administration"]
  node_post_editor["Post editor<br/>[post-form.tsx]"]
  node_auth_routes["Login and registration"]
  node_auth_actions["Authentication actions<br/>[auth.ts]"]
  node_session["Cookie sessions<br/>[auth.ts]"]
end

subgraph group_personalization["Reader preferences"]
  node_preferences_ui["Preferences panel"]
  node_preference_hook["Preference state<br/>[use-preferences.ts]"]
  node_theme_mode["Theme mode<br/>[use-theme-mode.ts]"]
  node_preferences_store["Local preferences<br/>[preferences.ts]"]
end

subgraph group_runtime["Application services"]
  node_post_data["Post data access<br/>[posts.ts]"]
  node_users_data["User data access<br/>[users.ts]"]
  node_comments_data["Comment data access<br/>[comments.ts]"]
  node_likes_data["Like data access<br/>[likes.ts]"]
  node_database[("PostgreSQL<br/>[prisma.ts]")]
end

node_reader(("Reader"))

node_reader -->|"opens"| node_landing
node_reader -->|"browses"| node_article_list
node_reader -->|"reads"| node_article_detail
node_landing -->|"renders"| node_landing_sections
node_landing -->|"loads posts"| node_post_data
node_article_list -->|"loads page"| node_post_data
node_article_list -->|"renders"| node_post_cards
node_article_detail -->|"loads post"| node_post_data
node_article_detail -->|"renders content"| node_markdown
node_article_detail -->|"reads session"| node_session
node_article_detail -->|"checks like"| node_likes_data
node_reader -->|"signs in"| node_auth_routes
node_auth_routes -->|"submits forms"| node_auth_actions
node_auth_actions -->|"looks up user"| node_users_data
node_auth_actions -->|"creates session"| node_session
node_admin_posts -->|"loads posts"| node_post_data
node_admin_posts -->|"opens editor"| node_post_editor
node_post_editor -.->|"saves via actions"| node_database
node_comments -.->|"uses interactions"| node_comment_hook
node_comment_hook -->|"submits comments"| node_comment_actions
node_comment_actions -.->|"persists comments"| node_comments_data
node_likes -.->|"records likes"| node_likes_data
node_preferences_ui -->|"reads settings"| node_preference_hook
node_preferences_ui -->|"sets theme mode"| node_theme_mode
node_preference_hook -->|"loads and saves"| node_preferences_store
node_theme_mode -->|"reads mode"| node_preferences_store
node_post_data -->|"queries"| node_database
node_users_data -.->|"queries"| node_database
node_comments_data -.->|"queries"| node_database
node_likes_data -->|"queries"| node_database

click node_landing "https://github.com/davipeter07/alice-blog/blob/main/src/app/page.tsx"
click node_landing_sections "https://github.com/davipeter07/alice-blog/tree/main/src/components/blog"
click node_article_list "https://github.com/davipeter07/alice-blog/blob/main/src/app/blog/page.tsx"
click node_post_cards "https://github.com/davipeter07/alice-blog/blob/main/src/components/blog/post-card.tsx"
click node_article_detail "https://github.com/davipeter07/alice-blog/blob/main/src/app/blog/%5Bslug%5D/page.tsx"
click node_markdown "https://github.com/davipeter07/alice-blog/blob/main/src/app/blog/%5Bslug%5D/page.tsx"
click node_admin_posts "https://github.com/davipeter07/alice-blog/tree/main/src/app/admin/posts"
click node_post_editor "https://github.com/davipeter07/alice-blog/blob/main/src/components/admin/post-form.tsx"
click node_auth_routes "https://github.com/davipeter07/alice-blog/tree/main/src/app/auth"
click node_auth_actions "https://github.com/davipeter07/alice-blog/blob/main/src/actions/auth.ts"
click node_session "https://github.com/davipeter07/alice-blog/blob/main/src/lib/auth.ts"
click node_comments "https://github.com/davipeter07/alice-blog/blob/main/src/components/blog/comment-section.tsx"
click node_comment_hook "https://github.com/davipeter07/alice-blog/blob/main/src/hooks/use-comment-section.ts"
click node_comment_actions "https://github.com/davipeter07/alice-blog/blob/main/src/actions/comments.ts"
click node_likes "https://github.com/davipeter07/alice-blog/blob/main/src/actions/likes.ts"
click node_preferences_ui "https://github.com/davipeter07/alice-blog/blob/main/src/components/preferences/preferences-panel.tsx"
click node_preference_hook "https://github.com/davipeter07/alice-blog/blob/main/src/hooks/use-preferences.ts"
click node_theme_mode "https://github.com/davipeter07/alice-blog/blob/main/src/hooks/use-theme-mode.ts"
click node_preferences_store "https://github.com/davipeter07/alice-blog/blob/main/src/lib/preferences.ts"
click node_post_data "https://github.com/davipeter07/alice-blog/blob/main/src/data-access/posts.ts"
click node_users_data "https://github.com/davipeter07/alice-blog/blob/main/src/data-access/users.ts"
click node_comments_data "https://github.com/davipeter07/alice-blog/blob/main/src/data-access/comments.ts"
click node_likes_data "https://github.com/davipeter07/alice-blog/blob/main/src/data-access/likes.ts"
click node_database "https://github.com/davipeter07/alice-blog/blob/main/src/lib/prisma.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_landing,node_landing_sections,node_article_list,node_post_cards,node_article_detail,node_markdown toneBlue
class node_comments,node_comment_hook,node_comment_actions,node_likes toneAmber
class node_admin_posts,node_post_editor,node_auth_routes,node_auth_actions,node_session toneMint
class node_preferences_ui,node_preference_hook,node_theme_mode,node_preferences_store toneRose
class node_post_data,node_users_data,node_comments_data,node_likes_data,node_database,node_reader toneIndigo
```

## Components

### Reader publishing

- [Landing experience](https://github.com/davipeter07/alice-blog/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Landing sections](https://github.com/davipeter07/alice-blog/tree/main/src/components/blog): `src/components/blog`
- [Article listing](https://github.com/davipeter07/alice-blog/blob/main/src/app/blog/page.tsx): `src/app/blog/page.tsx`
- [Post cards](https://github.com/davipeter07/alice-blog/blob/main/src/components/blog/post-card.tsx): `src/components/blog/post-card.tsx`
- [Article detail](https://github.com/davipeter07/alice-blog/blob/main/src/app/blog/%5Bslug%5D/page.tsx): `src/app/blog/[slug]/page.tsx`
- [Markdown rendering](https://github.com/davipeter07/alice-blog/blob/main/src/app/blog/%5Bslug%5D/page.tsx): `src/app/blog/[slug]/page.tsx`

### Reader engagement

- [Nested comments](https://github.com/davipeter07/alice-blog/blob/main/src/components/blog/comment-section.tsx): `src/components/blog/comment-section.tsx`
- [Comment interactions](https://github.com/davipeter07/alice-blog/blob/main/src/hooks/use-comment-section.ts): `src/hooks/use-comment-section.ts`
- [Comment actions](https://github.com/davipeter07/alice-blog/blob/main/src/actions/comments.ts): `src/actions/comments.ts`
- [Post likes](https://github.com/davipeter07/alice-blog/blob/main/src/actions/likes.ts): `src/actions/likes.ts`

### Identity and admin

- [Post administration](https://github.com/davipeter07/alice-blog/tree/main/src/app/admin/posts): `src/app/admin/posts`
- [Post editor](https://github.com/davipeter07/alice-blog/blob/main/src/components/admin/post-form.tsx): `src/components/admin/post-form.tsx`
- [Login and registration](https://github.com/davipeter07/alice-blog/tree/main/src/app/auth): `src/app/auth`
- [Authentication actions](https://github.com/davipeter07/alice-blog/blob/main/src/actions/auth.ts): `src/actions/auth.ts`
- [Cookie sessions](https://github.com/davipeter07/alice-blog/blob/main/src/lib/auth.ts): `src/lib/auth.ts`

### Reader preferences

- [Preferences panel](https://github.com/davipeter07/alice-blog/blob/main/src/components/preferences/preferences-panel.tsx): `src/components/preferences/preferences-panel.tsx`
- [Preference state](https://github.com/davipeter07/alice-blog/blob/main/src/hooks/use-preferences.ts): `src/hooks/use-preferences.ts`
- [Theme mode](https://github.com/davipeter07/alice-blog/blob/main/src/hooks/use-theme-mode.ts): `src/hooks/use-theme-mode.ts`
- [Local preferences](https://github.com/davipeter07/alice-blog/blob/main/src/lib/preferences.ts): `src/lib/preferences.ts`

### Application services

- [Post data access](https://github.com/davipeter07/alice-blog/blob/main/src/data-access/posts.ts): `src/data-access/posts.ts`
- [User data access](https://github.com/davipeter07/alice-blog/blob/main/src/data-access/users.ts): `src/data-access/users.ts`
- [Comment data access](https://github.com/davipeter07/alice-blog/blob/main/src/data-access/comments.ts): `src/data-access/comments.ts`
- [Like data access](https://github.com/davipeter07/alice-blog/blob/main/src/data-access/likes.ts): `src/data-access/likes.ts`
- [PostgreSQL](https://github.com/davipeter07/alice-blog/blob/main/src/lib/prisma.ts): `src/lib/prisma.ts`

### Other components

- **Reader**

## Connections

- Reader → Landing experience: opens
- Reader → Article listing: browses
- Reader → Article detail: reads
- Landing experience → Landing sections: renders (evidence: `src/app/page.tsx`)
- Landing experience → Post data access: loads posts (evidence: `src/app/page.tsx`)
- Article listing → Post data access: loads page (evidence: `src/app/blog/page.tsx`)
- Article listing → Post cards: renders (evidence: `src/app/blog/page.tsx`)
- Article detail → Post data access: loads post (evidence: `src/app/blog/[slug]/page.tsx`)
- Article detail → Markdown rendering: renders content (evidence: `src/app/blog/[slug]/page.tsx`)
- Article detail → Cookie sessions: reads session (evidence: `src/app/blog/[slug]/page.tsx`)
- Article detail → Like data access: checks like (evidence: `src/app/blog/[slug]/page.tsx`)
- Reader → Login and registration: signs in
- Login and registration → Authentication actions: submits forms (evidence: `src/app/auth/login/login-form.tsx`)
- Authentication actions → User data access: looks up user (evidence: `src/actions/auth.ts`)
- Authentication actions → Cookie sessions: creates session (evidence: `src/actions/auth.ts`)
- Post administration → Post data access: loads posts (evidence: `src/app/admin/posts/page.tsx`)
- Post administration → Post editor: opens editor (evidence: `src/app/admin/posts/new/page.tsx`)
- Post editor → PostgreSQL: saves via actions
- Nested comments → Comment interactions: uses interactions
- Comment interactions → Comment actions: submits comments (evidence: `src/hooks/use-comment-section.ts`)
- Comment actions → Comment data access: persists comments
- Post likes → Like data access: records likes
- Preferences panel → Preference state: reads settings (evidence: `src/components/preferences/preferences-panel.tsx`)
- Preferences panel → Theme mode: sets theme mode (evidence: `src/components/preferences/preferences-panel.tsx`)
- Preference state → Local preferences: loads and saves (evidence: `src/hooks/use-preferences.ts`)
- Theme mode → Local preferences: reads mode (evidence: `src/hooks/use-theme-mode.ts`)
- Post data access → PostgreSQL: queries (evidence: `src/data-access/posts.ts`)
- User data access → PostgreSQL: queries (evidence: `src/data-access/users.ts`)
- Comment data access → PostgreSQL: queries
- Like data access → PostgreSQL: queries (evidence: `src/data-access/likes.ts`)
