Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9cbaec1
docs: add comprehensive LinearLite to TanStack port plan
claude Oct 21, 2025
dc82ee0
refactor: replace tRPC with TanStack Start server functions
claude Oct 21, 2025
8265378
fix: update remaining tRPC reference to server function
claude Oct 21, 2025
1f44f5c
feat: initialize linearlite example with TanStack Start
claude Oct 21, 2025
846e6f5
feat: add authentication, server functions, and collections
claude Oct 21, 2025
edd6676
feat: add basic route structure and app entry points
claude Oct 21, 2025
235bce9
feat: add all UI components and authenticated routes
claude Oct 21, 2025
98cb408
fix: resolve linting issues and add missing dependencies
claude Oct 21, 2025
851fd2e
refactor: configure for SPA mode with HTTP API client
claude Oct 21, 2025
d9bb929
refactor: configure TanStack Start for SPA mode (no SSR)
claude Oct 21, 2025
5684e3c
feat: Implement file-based API routes and query param filtering
KyleAMathews Nov 3, 2025
b08975c
chore: update dependencies to latest versions
KyleAMathews Nov 18, 2025
1ca4072
Merge remote-tracking branch 'origin/main' into claude/port-linearlit…
KyleAMathews Nov 18, 2025
5789864
chore: regenerate pnpm-lock.yaml after merging main
KyleAMathews Nov 18, 2025
449180d
feat: simplify linearlarge example with list-only view and query opti…
KyleAMathews Nov 19, 2025
7099dd0
feat: add database indexes and configurable seeding for performance
KyleAMathews Nov 19, 2025
cde554d
fix: correct composite index syntax in schema
KyleAMathews Nov 19, 2025
8bf402e
up overscan
KyleAMathews Nov 19, 2025
ce486eb
refactor: implement pre-created live queries with caching and route l…
KyleAMathews Nov 19, 2025
954de1a
fix: improve cache persistence and preloading for smooth navigation
KyleAMathews Nov 20, 2025
061cd61
Merge remote-tracking branch 'origin/main' into claude/port-linearlit…
KyleAMathews Nov 20, 2025
0241bba
Merge remote-tracking branch 'origin/main' into claude/port-linearlit…
KyleAMathews Nov 20, 2025
098a026
fix: implement production server for TanStack Start SPA mode
KyleAMathews Nov 20, 2025
ca11454
fix: optimize navigation performance and caching
KyleAMathews Nov 20, 2025
bd7b310
Merge branch 'main' into claude/port-linearlite-tanstack-011CULn8TcMQ…
KyleAMathews Nov 22, 2025
7b01d82
perf(linearlarge): optimize rendering and query management
KyleAMathews Nov 22, 2025
2ae440a
fix: handle empty countData array
KyleAMathews Nov 22, 2025
673a9f3
fix: pass full filterState to preload functions for cache consistency
KyleAMathews Nov 22, 2025
45ec6e1
Added pacer library to deps
kevin-dp Nov 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,747 changes: 1,747 additions & 0 deletions LINEARLITE_TANSTACK_PORT_PLAN.md

Large diffs are not rendered by default.

2,570 changes: 2,570 additions & 0 deletions TANSTACK_START_COMPREHENSIVE_GUIDE.md

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions examples/react/linearlarge/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Database
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/linearlite

# ElectricSQL
ELECTRIC_URL=http://localhost:3000/v1/shape
ELECTRIC_API_URL=http://localhost:3000

# Auth
BETTER_AUTH_SECRET=your-secret-key-here-change-in-production
BETTER_AUTH_URL=http://localhost:3001

# Mode
NODE_ENV=development
26 changes: 26 additions & 0 deletions examples/react/linearlarge/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Dependencies
node_modules/
pnpm-lock.yaml

# Build outputs
dist/
.output/
.vinxi/

# Environment
.env
.env.local

# IDE
.vscode/
.idea/
*.swp
*.swo

# OS
.DS_Store
Thumbs.db

# Misc
*.log
.cache/
5 changes: 5 additions & 0 deletions examples/react/linearlarge/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": false,
"singleQuote": true,
"trailingComma": "es5"
}
88 changes: 88 additions & 0 deletions examples/react/linearlarge/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# LinearLite - TanStack Start + TanStack DB Example

A modern issue tracker demonstrating the power of TanStack Start and TanStack DB. This example ports the original [LinearLite](https://github.com/electric-sql/electric/tree/main/examples/linearlite) from Electric SQL + PGlite to use TanStack's ecosystem.

## Features

- **Dual Sync Modes**: Toggle between Query (polling) and Electric (real-time) modes
- **Full CRUD**: Create, read, update, and delete issues and comments
- **Kanban Board**: Drag-and-drop interface with fractional indexing
- **Rich Text Editing**: TipTap editor with markdown support
- **Real-time Updates**: Automatic UI updates with TanStack DB's reactive queries
- **Optimistic UI**: Instant feedback with automatic rollback on errors
- **User Isolation**: See only your own data plus demo content
- **Authentication**: Better Auth integration
- **Offline-First**: Works offline in Electric mode

## Getting Started

### Prerequisites

- Node.js 18+
- pnpm
- PostgreSQL (via Docker or local install)

### Installation

```bash
# Install dependencies
pnpm install

# Start PostgreSQL
docker compose up -d

# Generate database schema
pnpm db:push

# Seed demo data
pnpm db:seed

# Start development server
pnpm dev
```

Visit http://localhost:3000

## Project Structure

```
src/
├── components/ # React components
├── db/ # Database schema and connection
├── hooks/ # Custom React hooks
├── lib/ # Utilities and configurations
│ ├── collections/ # TanStack DB collections
│ ├── auth.ts # Better Auth setup
│ └── mode-context.tsx # Mode switcher
├── routes/ # TanStack Router routes
├── server/ # Server functions
│ └── functions/ # CRUD operations
└── styles/ # Global styles
```

## Tech Stack

- **Framework**: [TanStack Start](https://tanstack.com/start)
- **Data Store**: [TanStack DB](https://tanstack.com/db)
- **Database**: PostgreSQL with Drizzle ORM
- **Authentication**: Better Auth
- **Real-time Sync**: ElectricSQL (optional)
- **UI Components**: Custom with Tailwind CSS
- **Editor**: TipTap
- **Drag & Drop**: @dnd-kit

## Scripts

- `pnpm dev` - Start development server
- `pnpm build` - Build for production
- `pnpm db:push` - Push schema to database
- `pnpm db:seed` - Seed demo data
- `pnpm lint` - Lint code
- `pnpm format` - Format code

## Learn More

- [TanStack Start Documentation](https://tanstack.com/start)
- [TanStack DB Documentation](https://tanstack.com/db)
- [Original LinearLite](https://github.com/electric-sql/electric/tree/main/examples/linearlite)
- [Porting Plan](../../LINEARLITE_TANSTACK_PORT_PLAN.md)
36 changes: 36 additions & 0 deletions examples/react/linearlarge/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
services:
postgres:
image: postgres:17-alpine
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: linearlite
ports:
- '5432:5432'
volumes:
- postgres_data:/var/lib/postgresql/data
command:
- -c
- listen_addresses=*
- -c
- wal_level=logical
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U postgres']
interval: 5s
timeout: 5s
retries: 5

electric:
image: electricsql/electric:latest
environment:
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/linearlite?sslmode=disable
ELECTRIC_INSECURE: true
ports:
- '3001:3000'
depends_on:
postgres:
condition: service_healthy

volumes:
postgres_data:
13 changes: 13 additions & 0 deletions examples/react/linearlarge/drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { Config } from 'drizzle-kit'
import * as dotenv from 'dotenv'

dotenv.config()

export default {
schema: './src/db/schema.ts',
out: './src/db/migrations',
dialect: 'postgresql',
dbCredentials: {
url: process.env.DATABASE_URL!,
},
} satisfies Config
73 changes: 73 additions & 0 deletions examples/react/linearlarge/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import js from "@eslint/js"
import tsParser from "@typescript-eslint/parser"
import tsPlugin from "@typescript-eslint/eslint-plugin"
import reactPlugin from "eslint-plugin-react"
import prettierPlugin from "eslint-plugin-prettier"
import prettierConfig from "eslint-config-prettier"
import globals from "globals"
import { includeIgnoreFile } from "@eslint/compat"
import { fileURLToPath } from "url"

const gitignorePath = fileURLToPath(new URL(".gitignore", import.meta.url))

export default [
includeIgnoreFile(gitignorePath, "Imported .gitignore patterns"),
{
ignores: [
"*.config.js",
"*.config.ts",
"*.config.mjs",
"drizzle.config.ts",
"vite.config.ts",
"eslint.config.mjs",
],
},
{
files: ["src/**/*.{js,jsx,ts,tsx,mjs}"],
languageOptions: {
ecmaVersion: 2022,
sourceType: `module`,
parser: tsParser,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
globals: {
...globals.browser,
...globals.es2021,
...globals.node,
},
},
settings: {
react: {
version: `detect`,
},
},
plugins: {
"@typescript-eslint": tsPlugin,
react: reactPlugin,
prettier: prettierPlugin,
},
rules: {
...js.configs.recommended.rules,
...tsPlugin.configs.recommended.rules,
...reactPlugin.configs.recommended.rules,
...prettierConfig.rules,
"prettier/prettier": `error`,
"react/react-in-jsx-scope": `off`,
"react/jsx-uses-react": `off`,
"no-undef": `off`,
"@typescript-eslint/no-undef": "off",
"@typescript-eslint/no-unused-vars": [
`error`,
{
argsIgnorePattern: `^_`,
varsIgnorePattern: `^_`,
destructuredArrayIgnorePattern: `^_`,
caughtErrorsIgnorePattern: `^_`,
},
],
},
},
]
13 changes: 13 additions & 0 deletions examples/react/linearlarge/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>LinearLite - TanStack Start + TanStack DB</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
97 changes: 97 additions & 0 deletions examples/react/linearlarge/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
{
"name": "tanstack-start-db-linearlite-example",
"private": true,
"type": "module",
"scripts": {
"dev": "docker compose up -d && vite dev",
"start": "node server.mjs",
"build": "vite build",
"db:generate": "drizzle-kit generate",
"db:migrate": "drizzle-kit migrate",
"db:push": "drizzle-kit push",
"db:seed": "tsx src/db/seed.ts",
"serve": "node server.mjs",
"test": "vitest run",
"lint:check": "eslint .",
"lint": "eslint . --fix",
"format": "prettier --write .",
"format:check": "prettier --check ."
},
"dependencies": {
"@dnd-kit/core": "^6.3.1",
"@dnd-kit/sortable": "^9.0.0",
"@dnd-kit/utilities": "^3.2.2",
"@electric-sql/client": "^1.1.3",
"@firefox-devtools/react-contextmenu": "^5.2.3",
"@tailwindcss/vite": "^4.1.16",
"@tanstack/electric-db-collection": "^0.1.7",
"@tanstack/pacer-lite": "^0.1.0",
"@tanstack/query-core": "^5.90.7",
"@tanstack/query-db-collection": "^0.2.32",
"@tanstack/react-db": "https://pkg.pr.new/@tanstack/react-db@763",
"@tanstack/react-router": "^1.134.12",
"@tanstack/react-router-devtools": "^1.134.12",
"@tanstack/react-router-with-query": "^1.130.17",
"@tanstack/react-start": "^1.134.12",
"@tanstack/react-virtual": "^3.13.12",
"@tanstack/router-plugin": "^1.134.12",
"@tiptap/extension-table": "^2.27.1",
"@tiptap/extension-table-cell": "^2.27.1",
"@tiptap/extension-table-header": "^2.27.1",
"@tiptap/extension-table-row": "^2.27.1",
"@tiptap/react": "^2.27.1",
"@tiptap/starter-kit": "^2.27.1",
"better-auth": "^1.3.34",
"classnames": "^2.5.1",
"clsx": "^2.1.1",
"dayjs": "^1.11.19",
"dotenv": "^17.2.3",
"drizzle-orm": "^0.44.7",
"drizzle-zod": "^0.8.3",
"fractional-indexing": "^3.2.0",
"lucide-react": "^0.469.0",
"pg": "^8.16.3",
"react": "^19.2.0",
"react-aria-components": "^1.13.0",
"react-dom": "^19.2.0",
"react-icons": "^5.5.0",
"tailwind-merge": "^3.0.1",
"tailwindcss": "^4.1.16",
"tiptap-markdown": "^0.9.0",
"vite": "^6.3.5",
"vite-tsconfig-paths": "^5.1.4",
"zod": "^4.1.12"
},
"devDependencies": {
"@eslint/compat": "^1.4.1",
"@eslint/js": "^9.39.1",
"@tanstack/start-vite-plugin": "^1.91.1",
"@testing-library/dom": "^10.4.1",
"@testing-library/react": "^16.3.0",
"@types/node": "^22.19.0",
"@types/pg": "^8.15.6",
"@types/react": "^19.2.6",
"@types/react-dom": "^19.2.2",
"@typescript-eslint/eslint-plugin": "^8.47.0",
"@typescript-eslint/parser": "^8.47.0",
"@vitejs/plugin-react": "^5.1.0",
"autoprefixer": "^10.4.21",
"concurrently": "^9.2.1",
"drizzle-kit": "^0.31.6",
"eslint": "^9.39.1",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.4",
"eslint-plugin-react": "^7.37.5",
"globals": "^16.5.0",
"jsdom": "^27.1.0",
"postcss": "^8.4.49",
"prettier": "^3.6.2",
"serve": "^14.2.5",
"tsx": "^4.20.6",
"typescript": "^5.9.2",
"vite": "^6.4.1",
"vite-plugin-svgr": "^4.5.0",
"vitest": "^3.2.4",
"web-vitals": "^5.1.0"
}
}
4 changes: 4 additions & 0 deletions examples/react/linearlarge/public/tanstack-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading