# sveltejs/realworld architecture

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

- Interactive diagram: https://gitdiagram.com/sveltejs/realworld
- Repository: https://github.com/sveltejs/realworld

## Overview

This is Conduit, a SvelteKit RealWorld example app. Users browse global, tagged, or personalized article feeds; open articles and manage comments; and, when signed in, create or edit articles, favorite and follow authors, and manage their account. Route server modules handle page data and form actions, while Svelte components render the experience. The README documents CRUD and authentication; the excerpts show article-list rendering and profile article retrieval. Several route implementations and the API client were not excerpted, so uncertain links are omitted or marked unverified.

Main entry points: [`src/routes/+page.svelte`](https://github.com/sveltejs/realworld/blob/master/src/routes/%2Bpage.svelte) (Feed view), [`src/routes/article/[slug]/CommentContainer.svelte`](https://github.com/sveltejs/realworld/blob/master/src/routes/article/%5Bslug%5D/CommentContainer.svelte) (Comment list and form), [`src/routes/profile`](https://github.com/sveltejs/realworld/tree/master/src/routes/profile) (Profile routes), [`src/routes/profile/@[user]/get_articles.js`](https://github.com/sveltejs/realworld/blob/master/src/routes/profile/%40%5Buser%5D/get_articles.js) (Profile article query)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["Application shell"]
  node_layout["Page shell<br/>[+layout.svelte]"]
  node_navigation["Navigation<br/>[Nav.svelte]"]
  node_loading["Loading indicator"]
end

subgraph group_discovery["Article discovery"]
  node_feed_route["Feed route<br/>[+page.server.js]"]
  node_feed_view["Feed view<br/>[+page.svelte]"]
  node_article_list["Article list<br/>[index.svelte]"]
  node_article_preview["Article preview"]
  node_pagination["Pagination<br/>[Pagination.svelte]"]
end

subgraph group_content["Articles and discussion"]
  node_api_client["API client<br/>[api.js]"]
  node_article_routes["Article detail and comments"]
  node_article_meta["Article actions<br/>[ArticleMeta.svelte]"]
  node_comment_container["Comment list and form"]
  node_comment["Comment card<br/>[Comment.svelte]"]
  node_comment_input["Comment input"]
  node_editor_routes["Article editor routes"]
  node_editor["Article editor<br/>[Editor.svelte]"]
end

subgraph group_accounts["Accounts and profiles"]
  node_profile_articles["Profile article query<br/>[get_articles.js]"]
  node_profile_routes["Profile routes"]
  node_account_routes["Sign-in and account settings"]
end

node_visitor(("Visitor"))
node_member(("Signed-in user"))
node_realworld_api[("RealWorld API")]

node_layout -->|"renders"| node_navigation
node_layout -->|"renders"| node_loading
node_visitor -.->|"browses"| node_feed_view
node_member -.->|"browses"| node_feed_view
node_feed_view -->|"renders"| node_article_list
node_article_list -->|"renders"| node_article_preview
node_feed_view -->|"renders"| node_pagination
node_feed_view -.->|"loads data"| node_feed_route
node_profile_routes -->|"loads articles"| node_profile_articles
node_profile_routes -->|"loads favorites"| node_profile_articles
node_profile_articles -->|"requests articles"| node_api_client
node_api_client -.->|"requests data"| node_realworld_api
node_article_routes -->|"renders"| node_article_meta
node_article_routes -->|"renders"| node_comment_container
node_comment_container -->|"renders"| node_comment
node_comment_container -->|"renders"| node_comment_input
node_editor_routes -.->|"renders"| node_editor
node_member -.->|"creates or edits"| node_editor_routes
node_visitor -.->|"authenticates"| node_account_routes
node_member -.->|"views profile"| node_profile_routes

click node_layout "https://github.com/sveltejs/realworld/blob/master/src/routes/%2Blayout.svelte"
click node_navigation "https://github.com/sveltejs/realworld/blob/master/src/routes/Nav.svelte"
click node_loading "https://github.com/sveltejs/realworld/blob/master/src/routes/PreloadingIndicator.svelte"
click node_feed_route "https://github.com/sveltejs/realworld/blob/master/src/routes/%2Bpage.server.js"
click node_feed_view "https://github.com/sveltejs/realworld/blob/master/src/routes/%2Bpage.svelte"
click node_article_list "https://github.com/sveltejs/realworld/blob/master/src/lib/ArticleList/index.svelte"
click node_article_preview "https://github.com/sveltejs/realworld/blob/master/src/lib/ArticleList/ArticlePreview.svelte"
click node_pagination "https://github.com/sveltejs/realworld/blob/master/src/routes/Pagination.svelte"
click node_profile_articles "https://github.com/sveltejs/realworld/blob/master/src/routes/profile/%40%5Buser%5D/get_articles.js"
click node_profile_routes "https://github.com/sveltejs/realworld/tree/master/src/routes/profile"
click node_account_routes "https://github.com/sveltejs/realworld/tree/master/src/routes/login"
click node_api_client "https://github.com/sveltejs/realworld/blob/master/src/lib/api.js"
click node_article_routes "https://github.com/sveltejs/realworld/tree/master/src/routes/article/%5Bslug%5D"
click node_article_meta "https://github.com/sveltejs/realworld/blob/master/src/routes/article/%5Bslug%5D/ArticleMeta.svelte"
click node_comment_container "https://github.com/sveltejs/realworld/blob/master/src/routes/article/%5Bslug%5D/CommentContainer.svelte"
click node_comment "https://github.com/sveltejs/realworld/blob/master/src/routes/article/%5Bslug%5D/Comment.svelte"
click node_comment_input "https://github.com/sveltejs/realworld/blob/master/src/routes/article/%5Bslug%5D/CommentInput.svelte"
click node_editor_routes "https://github.com/sveltejs/realworld/tree/master/src/routes/editor"
click node_editor "https://github.com/sveltejs/realworld/blob/master/src/routes/editor/Editor.svelte"

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_layout,node_navigation,node_loading,node_member toneBlue
class node_feed_route,node_feed_view,node_article_list,node_article_preview,node_pagination,node_realworld_api toneAmber
class node_api_client,node_article_routes,node_article_meta,node_comment_container,node_comment,node_comment_input,node_editor_routes,node_editor toneMint
class node_profile_articles,node_profile_routes,node_account_routes toneRose
class node_visitor toneIndigo
```

## Components

### Application shell

- [Page shell](https://github.com/sveltejs/realworld/blob/master/src/routes/%2Blayout.svelte): `src/routes/+layout.svelte`
- [Navigation](https://github.com/sveltejs/realworld/blob/master/src/routes/Nav.svelte): `src/routes/Nav.svelte`
- [Loading indicator](https://github.com/sveltejs/realworld/blob/master/src/routes/PreloadingIndicator.svelte): `src/routes/PreloadingIndicator.svelte`

### Article discovery

- [Feed route](https://github.com/sveltejs/realworld/blob/master/src/routes/%2Bpage.server.js): `src/routes/+page.server.js`
- [Feed view](https://github.com/sveltejs/realworld/blob/master/src/routes/%2Bpage.svelte): `src/routes/+page.svelte`
- [Article list](https://github.com/sveltejs/realworld/blob/master/src/lib/ArticleList/index.svelte): `src/lib/ArticleList/index.svelte`
- [Article preview](https://github.com/sveltejs/realworld/blob/master/src/lib/ArticleList/ArticlePreview.svelte): `src/lib/ArticleList/ArticlePreview.svelte`
- [Pagination](https://github.com/sveltejs/realworld/blob/master/src/routes/Pagination.svelte): `src/routes/Pagination.svelte`

### Articles and discussion

- [API client](https://github.com/sveltejs/realworld/blob/master/src/lib/api.js): `src/lib/api.js`
- [Article detail and comments](https://github.com/sveltejs/realworld/tree/master/src/routes/article/%5Bslug%5D): `src/routes/article/[slug]`
- [Article actions](https://github.com/sveltejs/realworld/blob/master/src/routes/article/%5Bslug%5D/ArticleMeta.svelte): `src/routes/article/[slug]/ArticleMeta.svelte`
- [Comment list and form](https://github.com/sveltejs/realworld/blob/master/src/routes/article/%5Bslug%5D/CommentContainer.svelte): `src/routes/article/[slug]/CommentContainer.svelte`
- [Comment card](https://github.com/sveltejs/realworld/blob/master/src/routes/article/%5Bslug%5D/Comment.svelte): `src/routes/article/[slug]/Comment.svelte`
- [Comment input](https://github.com/sveltejs/realworld/blob/master/src/routes/article/%5Bslug%5D/CommentInput.svelte): `src/routes/article/[slug]/CommentInput.svelte`
- [Article editor routes](https://github.com/sveltejs/realworld/tree/master/src/routes/editor): `src/routes/editor`
- [Article editor](https://github.com/sveltejs/realworld/blob/master/src/routes/editor/Editor.svelte): `src/routes/editor/Editor.svelte`

### Accounts and profiles

- [Profile article query](https://github.com/sveltejs/realworld/blob/master/src/routes/profile/%40%5Buser%5D/get_articles.js): `src/routes/profile/@[user]/get_articles.js`
- [Profile routes](https://github.com/sveltejs/realworld/tree/master/src/routes/profile): `src/routes/profile`
- [Sign-in and account settings](https://github.com/sveltejs/realworld/tree/master/src/routes/login): `src/routes/login`

### Other components

- **Visitor**
- **Signed-in user**
- **RealWorld API**

## Connections

- Page shell → Navigation: renders (evidence: `src/routes/+layout.svelte`)
- Page shell → Loading indicator: renders (evidence: `src/routes/+layout.svelte`)
- Visitor → Feed view: browses
- Signed-in user → Feed view: browses
- Feed view → Article list: renders (evidence: `src/routes/+page.svelte`)
- Article list → Article preview: renders (evidence: `src/lib/ArticleList/index.svelte`)
- Feed view → Pagination: renders (evidence: `src/routes/+page.svelte`)
- Feed view → Feed route: loads data
- Profile routes → Profile article query: loads articles (evidence: `src/routes/profile/@[user]/+page.server.js`)
- Profile routes → Profile article query: loads favorites (evidence: `src/routes/profile/@[user]/favorites/+page.server.js`)
- Profile article query → API client: requests articles (evidence: `src/routes/profile/@[user]/get_articles.js`)
- API client → RealWorld API: requests data
- Article detail and comments → Article actions: renders (evidence: `src/routes/article/[slug]/+page.svelte`)
- Article detail and comments → Comment list and form: renders (evidence: `src/routes/article/[slug]/+page.svelte`)
- Comment list and form → Comment card: renders (evidence: `src/routes/article/[slug]/CommentContainer.svelte`)
- Comment list and form → Comment input: renders (evidence: `src/routes/article/[slug]/CommentContainer.svelte`)
- Article editor routes → Article editor: renders (evidence: `src/routes/editor/[slug]/+page.svelte`)
- Signed-in user → Article editor routes: creates or edits
- Visitor → Sign-in and account settings: authenticates
- Signed-in user → Profile routes: views profile
