# scynes/textlight architecture

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

- Interactive diagram: https://gitdiagram.com/scynes/textlight
- Repository: https://github.com/scynes/textlight

## Overview

Textlight is a Pastebin-style code-sharing application that stores snippets and presents shareable, syntax-highlighted views. The principal workflow is to open the creation page, configure and submit a snippet, then visit its slug to retrieve and display it; the README also describes beautified snippet images, though the sampled route shows HTML highlighting rather than image generation. Authentication and feedback are separate product branches. The graph follows the supplied route and component references; action and middleware internals were not excerpted, so some backend details remain limited.

Main entry points: [`src/app/s/[slug]/page.tsx`](https://github.com/scynes/textlight/blob/main/src/app/s/%5Bslug%5D/page.tsx) (Shared snippet route), [`src/components/core/navigation/navigation-bar.tsx`](https://github.com/scynes/textlight/blob/main/src/components/core/navigation/navigation-bar.tsx) (Navigation bar), [`src/features/snippet/actions/submit-snippet.ts`](https://github.com/scynes/textlight/blob/main/src/features/snippet/actions/submit-snippet.ts) (Snippet submission), [`src/features/snippet/actions/get-snippet.ts`](https://github.com/scynes/textlight/blob/main/src/features/snippet/actions/get-snippet.ts) (Snippet retrieval)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and navigation"]
  node_home["Landing page<br/>[page.tsx]"]
  node_hero["Hero presentation<br/>[hero.tsx]"]
  node_navigation["Navigation bar<br/>[navigation-bar.tsx]"]
end

subgraph group_snippets["Snippet sharing"]
  node_create_route["Create route<br/>[page.tsx]"]
  node_snippet_form["Snippet editor<br/>[snippet-form.tsx]"]
  node_submit_snippet["Snippet submission<br/>[submit-snippet.ts]"]
  node_share_route["Shared snippet route<br/>[page.tsx]"]
  node_get_snippet["Snippet retrieval<br/>[get-snippet.ts]"]
  node_snippet_view["Snippet presentation<br/>[snippet-view.tsx]"]
  node_highlighter["Syntax highlighting<br/>[highlighter.ts]"]
  node_snippet_types["Snippet model<br/>[snippet.ts]"]
end

subgraph group_auth["Authentication"]
  node_auth_modal["Auth modal<br/>[auth-modal.tsx]"]
  node_signin["Sign-in form<br/>[signin-form.tsx]"]
  node_signup["Sign-up form<br/>[signup-form.tsx]"]
  node_auth_actions["Auth actions<br/>[signin.ts]"]
  node_auth_store["Auth session store<br/>[use-auth-store.ts]"]
  node_auth_provider["Auth provider<br/>[auth-provider.tsx]"]
end

subgraph group_feedback["Feedback"]
  node_feedback_ui["Feedback form<br/>[feedback.tsx]"]
  node_feedback_action["Feedback submission<br/>[submit-feedback.ts]"]
end

subgraph group_infra["Services and utilities"]
  node_snippet_db["Supabase data service<br/>[server.ts]"]
  node_database[("Supabase / PostgreSQL")]
  node_feedback_db["Feedback data access<br/>[server.ts]"]
  node_date_util["Snippet date utilities<br/>[date.ts]"]
end

node_visitor(("Visitor"))

node_visitor -->|"visits"| node_home
node_home -->|"renders"| node_hero
node_visitor -->|"uses"| node_navigation
node_navigation -->|"links to"| node_create_route
node_visitor -->|"opens"| node_create_route
node_create_route -->|"renders"| node_snippet_form
node_snippet_form -->|"submits"| node_submit_snippet
node_submit_snippet -->|"uses"| node_snippet_db
node_submit_snippet -->|"uses"| node_snippet_types
node_snippet_db -.->|"connects to"| node_database
node_visitor -->|"opens slug"| node_share_route
node_share_route -->|"loads"| node_get_snippet
node_get_snippet -->|"uses"| node_snippet_db
node_get_snippet -->|"returns data"| node_snippet_types
node_share_route -->|"renders"| node_snippet_view
node_share_route -.->|"highlights code"| node_highlighter
node_snippet_view -->|"formats date"| node_date_util
node_navigation -->|"opens"| node_feedback_ui
node_feedback_ui -->|"submits"| node_feedback_action
node_feedback_action -->|"uses"| node_feedback_db
node_feedback_db -.->|"connects to"| node_database
node_auth_modal -->|"renders"| node_signin
node_auth_modal -->|"renders"| node_signup
node_signin -->|"calls"| node_auth_actions
node_signup -->|"calls"| node_auth_actions
node_auth_provider -->|"initializes"| node_auth_store

click node_home "https://github.com/scynes/textlight/blob/main/src/app/page.tsx"
click node_hero "https://github.com/scynes/textlight/blob/main/src/components/core/hero/hero.tsx"
click node_navigation "https://github.com/scynes/textlight/blob/main/src/components/core/navigation/navigation-bar.tsx"
click node_create_route "https://github.com/scynes/textlight/blob/main/src/app/s/page.tsx"
click node_snippet_form "https://github.com/scynes/textlight/blob/main/src/features/snippet/components/snippet-form.tsx"
click node_submit_snippet "https://github.com/scynes/textlight/blob/main/src/features/snippet/actions/submit-snippet.ts"
click node_share_route "https://github.com/scynes/textlight/blob/main/src/app/s/%5Bslug%5D/page.tsx"
click node_get_snippet "https://github.com/scynes/textlight/blob/main/src/features/snippet/actions/get-snippet.ts"
click node_snippet_view "https://github.com/scynes/textlight/blob/main/src/features/snippet/components/snippet-view.tsx"
click node_highlighter "https://github.com/scynes/textlight/blob/main/src/utils/shiki/highlighter.ts"
click node_snippet_types "https://github.com/scynes/textlight/blob/main/src/features/snippet/types/snippet.ts"
click node_snippet_db "https://github.com/scynes/textlight/blob/main/src/utils/supabase/server.ts"
click node_auth_modal "https://github.com/scynes/textlight/blob/main/src/features/auth/components/auth-modal.tsx"
click node_signin "https://github.com/scynes/textlight/blob/main/src/features/auth/components/signin-form.tsx"
click node_signup "https://github.com/scynes/textlight/blob/main/src/features/auth/components/signup-form.tsx"
click node_auth_actions "https://github.com/scynes/textlight/blob/main/src/features/auth/actions/signin.ts"
click node_auth_store "https://github.com/scynes/textlight/blob/main/src/stores/use-auth-store.ts"
click node_auth_provider "https://github.com/scynes/textlight/blob/main/src/context/auth/auth-provider.tsx"
click node_feedback_ui "https://github.com/scynes/textlight/blob/main/src/components/core/feedback/feedback.tsx"
click node_feedback_action "https://github.com/scynes/textlight/blob/main/src/actions/submit-feedback.ts"
click node_feedback_db "https://github.com/scynes/textlight/blob/main/src/utils/supabase/server.ts"
click node_date_util "https://github.com/scynes/textlight/blob/main/src/utils/date.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_home,node_hero,node_navigation toneBlue
class node_create_route,node_snippet_form,node_submit_snippet,node_share_route,node_get_snippet,node_snippet_view,node_highlighter,node_snippet_types toneAmber
class node_auth_modal,node_signin,node_signup,node_auth_actions,node_auth_store,node_auth_provider toneMint
class node_feedback_ui,node_feedback_action toneRose
class node_snippet_db,node_database,node_feedback_db,node_date_util,node_visitor toneIndigo
```

## Components

### App and navigation

- [Landing page](https://github.com/scynes/textlight/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Hero presentation](https://github.com/scynes/textlight/blob/main/src/components/core/hero/hero.tsx): `src/components/core/hero/hero.tsx`
- [Navigation bar](https://github.com/scynes/textlight/blob/main/src/components/core/navigation/navigation-bar.tsx): `src/components/core/navigation/navigation-bar.tsx`

### Snippet sharing

- [Create route](https://github.com/scynes/textlight/blob/main/src/app/s/page.tsx): `src/app/s/page.tsx`
- [Snippet editor](https://github.com/scynes/textlight/blob/main/src/features/snippet/components/snippet-form.tsx): `src/features/snippet/components/snippet-form.tsx`
- [Snippet submission](https://github.com/scynes/textlight/blob/main/src/features/snippet/actions/submit-snippet.ts): `src/features/snippet/actions/submit-snippet.ts`
- [Shared snippet route](https://github.com/scynes/textlight/blob/main/src/app/s/%5Bslug%5D/page.tsx): `src/app/s/[slug]/page.tsx`
- [Snippet retrieval](https://github.com/scynes/textlight/blob/main/src/features/snippet/actions/get-snippet.ts): `src/features/snippet/actions/get-snippet.ts`
- [Snippet presentation](https://github.com/scynes/textlight/blob/main/src/features/snippet/components/snippet-view.tsx): `src/features/snippet/components/snippet-view.tsx`
- [Syntax highlighting](https://github.com/scynes/textlight/blob/main/src/utils/shiki/highlighter.ts): `src/utils/shiki/highlighter.ts`
- [Snippet model](https://github.com/scynes/textlight/blob/main/src/features/snippet/types/snippet.ts): `src/features/snippet/types/snippet.ts`

### Authentication

- [Auth modal](https://github.com/scynes/textlight/blob/main/src/features/auth/components/auth-modal.tsx): `src/features/auth/components/auth-modal.tsx`
- [Sign-in form](https://github.com/scynes/textlight/blob/main/src/features/auth/components/signin-form.tsx): `src/features/auth/components/signin-form.tsx`
- [Sign-up form](https://github.com/scynes/textlight/blob/main/src/features/auth/components/signup-form.tsx): `src/features/auth/components/signup-form.tsx`
- [Auth actions](https://github.com/scynes/textlight/blob/main/src/features/auth/actions/signin.ts): `src/features/auth/actions/signin.ts`
- [Auth session store](https://github.com/scynes/textlight/blob/main/src/stores/use-auth-store.ts): `src/stores/use-auth-store.ts`
- [Auth provider](https://github.com/scynes/textlight/blob/main/src/context/auth/auth-provider.tsx): `src/context/auth/auth-provider.tsx`

### Feedback

- [Feedback form](https://github.com/scynes/textlight/blob/main/src/components/core/feedback/feedback.tsx): `src/components/core/feedback/feedback.tsx`
- [Feedback submission](https://github.com/scynes/textlight/blob/main/src/actions/submit-feedback.ts): `src/actions/submit-feedback.ts`

### Services and utilities

- [Supabase data service](https://github.com/scynes/textlight/blob/main/src/utils/supabase/server.ts): `src/utils/supabase/server.ts`
- **Supabase / PostgreSQL**
- [Feedback data access](https://github.com/scynes/textlight/blob/main/src/utils/supabase/server.ts): `src/utils/supabase/server.ts`
- [Snippet date utilities](https://github.com/scynes/textlight/blob/main/src/utils/date.ts): `src/utils/date.ts`

### Other components

- **Visitor**

## Connections

- Visitor → Landing page: visits (evidence: `src/app/page.tsx`)
- Landing page → Hero presentation: renders (evidence: `src/app/page.tsx`)
- Visitor → Navigation bar: uses (evidence: `src/components/core/navigation/navigation-bar.tsx`)
- Navigation bar → Create route: links to (evidence: `src/components/core/navigation/navigation-bar.tsx`)
- Visitor → Create route: opens (evidence: `src/app/s/page.tsx`)
- Create route → Snippet editor: renders (evidence: `src/app/s/page.tsx`)
- Snippet editor → Snippet submission: submits (evidence: `src/features/snippet/components/snippet-form.tsx`)
- Snippet submission → Supabase data service: uses (evidence: `src/features/snippet/actions/submit-snippet.ts`)
- Snippet submission → Snippet model: uses (evidence: `src/features/snippet/actions/submit-snippet.ts`)
- Supabase data service → Supabase / PostgreSQL: connects to
- Visitor → Shared snippet route: opens slug (evidence: `src/app/s/[slug]/page.tsx`)
- Shared snippet route → Snippet retrieval: loads (evidence: `src/app/s/[slug]/page.tsx`)
- Snippet retrieval → Supabase data service: uses (evidence: `src/features/snippet/actions/get-snippet.ts`)
- Snippet retrieval → Snippet model: returns data (evidence: `src/features/snippet/actions/get-snippet.ts`)
- Shared snippet route → Snippet presentation: renders (evidence: `src/app/s/[slug]/page.tsx`)
- Shared snippet route → Syntax highlighting: highlights code
- Snippet presentation → Snippet date utilities: formats date (evidence: `src/features/snippet/components/snippet-view.tsx`)
- Navigation bar → Feedback form: opens (evidence: `src/components/core/navigation/navigation-bar.tsx`)
- Feedback form → Feedback submission: submits (evidence: `src/components/core/feedback/feedback.tsx`)
- Feedback submission → Feedback data access: uses (evidence: `src/actions/submit-feedback.ts`)
- Feedback data access → Supabase / PostgreSQL: connects to
- Auth modal → Sign-in form: renders (evidence: `src/features/auth/components/auth-modal.tsx`)
- Auth modal → Sign-up form: renders (evidence: `src/features/auth/components/auth-modal.tsx`)
- Sign-in form → Auth actions: calls (evidence: `src/features/auth/components/signin-form.tsx`)
- Sign-up form → Auth actions: calls (evidence: `src/features/auth/components/signup-form.tsx`)
- Auth provider → Auth session store: initializes (evidence: `src/context/auth/auth-provider.tsx`)
