feat: Add Employee Directory Demo Plugin (2M Records Performance Showcase)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 18/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- react, sqlite, tailwindcss, typescript, vite
- 領域
- api, backend, data, frontend, performance
調査の方向性
Start with the monorepo root package.json workspaces and an existing packages/ plugin to copy its layout, then read the local edgecache-demo source the issue points to. The work touches packages/employee-directory-demo/src/schema, src/routes/employees.ts and src/seed/generator.ts, plus the frontend components and demo/wrangler.toml. Done means the package builds, /api/v1/employees returns filtered, paginated results with a source field, and the demo deploys. The scope is large and the thread has been quiet for about eight months, so confirm with maintainers before starting.
索引モデルが issue の本文から書いたものです。
説明
Overview
Import the Edge Cache Demo from the standalone repository into the SonicJS monorepo as a dedicated Employee Directory Demo Plugin. This demo showcases SonicJS's exceptional performance handling large datasets (2M+ records with relations) on Cloudflare's edge infrastructure.
Live Demo: https://edgecache-demo.pages.dev/
Source Repository: https://github.com/lane711/edgecache-demo (to be imported from local /Users/lane/Dev/refs/edgecache-demo)
Motivation
- Performance Showcase: Demonstrates SonicJS handling 2 million employee records with department relations at sub-50ms response times
- Edge Computing Benefits: Shows the speed advantage of edge-cached APIs vs traditional origin servers
- Plugin Architecture Example: Serves as a reference implementation for building demo plugins
- Marketing Asset: Provides tangible performance proof for the SonicJS website and documentation
Proposed Implementation
1. Create Demo Plugin Package
Add a new package at packages/employee-directory-demo/ with the following structure:
packages/employee-directory-demo/
├── package.json
├── README.md
├── src/
│ ├── index.ts # Plugin export
│ ├── schema/
│ │ └── employees.ts # Employee + Department schema definitions
│ ├── routes/
│ │ └── employees.ts # API routes for employee listing
│ ├── seed/
│ │ └── generator.ts # Seed data generator for 2M records
│ └── frontend/
│ ├── App.tsx # React demo frontend
│ ├── components/
│ │ ├── Sidebar.tsx
│ │ ├── Persons.tsx
│ │ ├── Stats.tsx
│ │ ├── Pagination.tsx
│ │ └── ...
│ └── index.css
└── demo/
├── wrangler.toml # Cloudflare Pages config
└── index.html
2. Core Features to Include
Backend (Plugin):
- Employee content type with fields: name, email, avatar, department (relation), region, gender
- Department content type
- Efficient API endpoints with filtering:
/api/v1/employees?filters[department][$eq]=Engineering - Support for pagination:
limit,offsetquery params - Performance headers:
sonicjs-source: cache|origin
Frontend (Demo App):
- Employee grid view with avatar cards
- Sidebar filters: Department, Gender, Region (multi-select)
- Real-time performance stats display (response time in ms)
- Toggle between "Edge Cache" and "Origin" modes to compare speed
- Pagination controls
- API URL display for transparency
3. Current Demo Dependencies
The existing demo uses:
- React 18.3
- Tailwind CSS 3.4
- @headlessui/react 2.1 (for filter UI)
- @heroicons/react 2.1 (for icons)
- Vite 5.4 (bundler)
4. Tasks
- Create
packages/employee-directory-demo/package structure - Define Employee and Department schemas using SonicJS content types
- Port existing React components from edgecache-demo repo
- Convert JSX to TypeScript/TSX
- Create seed data generator script for populating demo database
- Add deployment configuration for Cloudflare Pages
- Update monorepo
workspacesin rootpackage.json - Add to www site navigation/demo section
- Document plugin usage and deployment steps
5. API Design
Employee Listing Endpoint:
GET /api/v1/employees
Query params:
- limit (default: 18)
- offset (default: 0)
- filters[department][$eq]=<department_name>
- filters[gender][$eq]=<male|female>
- filters[region][$eq]=<region_name>
Response:
{
"data": [...employees],
"total": 2000000,
"source": "cache" | "origin"
}
6. Benefits of Plugin Architecture
- Isolated codebase: All demo code lives in one package
- Reusable schema: Other apps can extend or reference the employee data model
- Independent deployment: Demo can be deployed separately to showcase performance
- Test fixture: Useful for performance testing and benchmarking
Additional Considerations
- Should support both D1 (SQLite) and Turso database adapters
- Consider pre-generated sample avatars or use a deterministic avatar service
- May want to add OpenAPI documentation for the demo endpoints
References
- Current live demo: https://edgecache-demo.pages.dev/
- SonicJS Docs: https://sonicjs.com/docs
- Cloudflare Workers: https://developers.cloudflare.com/workers/
/cc @lane711
- 主要言語
- TypeScript
- スター
- 1.8k
- フォーク
- 219
- 平均マージ
- 2日 21時間
- マージ済み PR(30日)
- 67
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
SonicJs-Org/sonicjs のほかの issue
-
bug(admin/users): server error returns bare alert HTML causing black-shape visual artifact対応中かも @lane711 が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
SonicJs-Org/sonicjs#1211 ·
メンテナーはふだん 1 日以内に返信
-
area: api bug priority: P2
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
SonicJs-Org/sonicjs#1200 ·
メンテナーはふだん 1 日以内に返信
-
ResendProvider cannot send on Workers: unbound `fetch` stored as an instance property throws "Illegal invocation"対応中かも @lane711 が 23 日前に担当しました。 オープンarea: email bug priority: P1
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
SonicJs-Org/sonicjs#1099 ·
メンテナーはふだん 1 日以内に返信
-
Email plugin settings are never read: loadDbEmailSettings queries a v2 `plugins` table that does not exist in v3対応中かも @lane711 が 23 日前に担当しました。 オープンarea: email bug priority: P1
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
SonicJs-Org/sonicjs#1098 ·
メンテナーはふだん 1 日以内に返信
-
area: documentation bug documentation priority: P2
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
SonicJs-Org/sonicjs#1012 ·
メンテナーはふだん 1 日以内に返信
SonicJs-Org/sonicjs の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
liberation-data/drivine#826 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
zhitongblog/solomd#623 ·
メンテナーはふだん 1 日以内に返信
-
aufwand: klein documentation Einsteiger-Familie freigegeben Haushalts-Admin
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
enhancement frontend
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
openwallet-foundation/eudiplo#1600 ·
-
docs(website): add a GitLab CI/CD button next to the GitHub Action button on the homepage対応中かも @shryssssss-maker が今日担当しました。 オープンdocumentation enhancement first-timers-only good first issue
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
OWASP/cve-lite-cli#1739 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信