-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/add basic docs #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5909ec9
d982f25
7c3e4f9
0a7305d
2a10e24
ddcf847
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| --- | ||
| name: Bug Report | ||
| about: Create a report to help us improve | ||
| title: '[BUG] ' | ||
| labels: bug | ||
| assignees: '' | ||
| --- | ||
|
|
||
| ## Describe the Bug | ||
| A clear and concise description of what the bug is. | ||
|
|
||
| ## Expected Behavior | ||
| A clear and concise description of what you expected to happen. | ||
|
|
||
| ## Screenshots | ||
| If applicable, add screenshots to help explain your problem. | ||
|
|
||
| ## Environment | ||
| - Package: [core/server/cli/dashboard/client] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Correct package name: The package list includes 🤖 Prompt for AI Agents |
||
| - Version: [e.g., 1.0.0] | ||
| - OS: [e.g., Windows/Mac/Linux] | ||
| - Node Version: [e.g., 18.x] | ||
| - Browser: [e.g., Chrome, Safari] | ||
|
|
||
| ## Additional Context | ||
| Add any other context about the problem here. | ||
|
Comment on lines
+9
to
+26
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Add missing fields expected by CONTRIBUTING.md. The template omits sections that CONTRIBUTING.md explicitly requests: "Steps to Reproduce", "Actual Behavior", and "Any relevant error logs". Add these to ensure bug reports contain triage-critical details. 🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| --- | ||
| name: Feature Request | ||
| about: Suggest an idea for this project | ||
| title: '[FEATURE] ' | ||
| labels: enhancement | ||
| assignees: '' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Fix Same issue as bug_report.md: 🤖 Prompt for AI Agents |
||
| --- | ||
|
|
||
| ## Is your feature request related to a problem? | ||
| A clear and concise description of what the problem is. | ||
|
|
||
| ## Describe the solution you'd like | ||
| A clear and concise description of what you want to happen. | ||
|
|
||
| ## Describe alternatives you've considered | ||
| A clear and concise description of any alternative solutions or features you've considered. | ||
|
|
||
| ## Which package does this affect? | ||
| - [ ] Core | ||
| - [ ] Frontend Dashboard | ||
| - [ ] Cli Dashboard | ||
| - [ ] Serve | ||
| - [ ] Client | ||
| - [ ] Documentation | ||
|
|
||
| ## Additional context | ||
| Add any other context or screenshots about the feature request here. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,164 @@ | ||
| # JetQueue Architecture | ||
|
|
||
| ## Packages | ||
| ## Overview | ||
|
|
||
| - `@jet-queue/core` – engine (events, retries, storage) | ||
| - `@jet-queue/server` – Bun server (REST + WebSocket) | ||
| - `@jet-queue/client` – SDK for any environment | ||
| - `@jet-queue/cli` – terminal dashboard | ||
| - `@jet-queue/dashboard` – web dashboard (Next.js) | ||
| JetQueue is a modular background job processing system built with TypeScript. It consists of five core packages that work together to provide a complete job queue solution, from task definition to execution monitoring. | ||
|
|
||
| --- | ||
|
|
||
| ## Package Structure | ||
|
|
||
| ### `@jet-queue/core` | ||
|
|
||
| The heart of JetQueue – a standalone queue engine that handles all job lifecycle management. | ||
|
|
||
| - **Job lifecycle management**: Create, track, update, and remove jobs | ||
| - **Retry logic**: Fixed, linear, and exponential backoff strategies | ||
| - **Storage abstraction**: In-memory by default, with SQLite persistence (built into Bun/Node.js) | ||
| - **Event system**: Emits typed events for every job state change | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Correct misleading SQLite claim. "built into Bun/Node.js" is incorrect — Node.js does not include a built-in SQLite module. Bun has 🤖 Prompt for AI Agents |
||
| - **Priority queue**: Four priority levels (critical > high > normal > low) | ||
| - **Concurrency control**: Configurable worker pool size | ||
|
|
||
| **Dependencies**: None (pure TypeScript) | ||
|
|
||
| --- | ||
|
|
||
| ### `@jet-queue/server` | ||
|
|
||
| A ready-to-use Bun server that wraps the core engine with REST and WebSocket APIs. | ||
|
|
||
| - **REST endpoints**: Job submission, retrieval, cancellation, retry, stats, and health checks | ||
| - **WebSocket server**: Real-time job events (start, complete, fail, progress, stats updates) | ||
| - **Built-in SQLite persistence**: Jobs persist between server restarts (using Bun/Node.js SQLite) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Correct misleading SQLite persistence claim. "Built-in SQLite persistence" and "using Bun/Node.js SQLite" implies SQLite is native to both runtimes. Node.js requires installing 🤖 Prompt for AI Agents |
||
| - **Ready to run**: Zero-configuration setup for development and production | ||
| - **Customizable**: Developers can extend or replace with their own server implementation | ||
|
|
||
| **Dependencies**: `@jet-queue/core`, Bun runtime | ||
|
|
||
| --- | ||
|
|
||
| ### `@jet-queue/client` | ||
|
|
||
| TypeScript/JavaScript SDK for interacting with JetQueue servers. | ||
|
|
||
| **Capabilities**: | ||
|
|
||
| - Submit jobs with full configuration (priority, delay, retry, timeout, tags, metadata) | ||
| - Subscribe to job events via WebSocket (progress, completion, failure, etc.) | ||
| - Fetch job status, stats, and list jobs | ||
| - Cancel or retry existing jobs | ||
| - Type-safe API with full TypeScript support | ||
| - Works in any environment: Node.js, Bun, browsers, edge functions | ||
|
|
||
| **Dependencies**: None (pure TypeScript) | ||
|
|
||
| --- | ||
|
|
||
| ### `@jet-queue/cli` | ||
|
|
||
| Terminal-based dashboard for server management. | ||
|
|
||
| **Features**: | ||
|
|
||
| - View queue stats (pending, running, completed, failed, delayed, total) | ||
| - List and filter jobs by status or tags | ||
| - Inspect job details (data, metadata, error messages) | ||
| - Cancel or retry jobs directly from the terminal | ||
| - Monitor real-time job progress | ||
| - Connect to local or remote servers | ||
|
|
||
| **Dependencies**: `@jet-queue/client` | ||
|
|
||
| --- | ||
|
|
||
| ### `@jet-queue/dashboard` | ||
|
|
||
| Web-based administrative UI built with Next.js. | ||
|
|
||
| **Features**: | ||
|
|
||
| - Real-time job monitoring with auto-refresh | ||
| - Visual queue statistics and charts | ||
| - Job search and filtering (by status, tags, name) | ||
| - Detailed job inspection with expandable data/error views | ||
| - Manual job management (cancel, retry, add) | ||
| - Responsive design for desktop and mobile | ||
|
|
||
| **Dependencies**: `@jet-queue/client`, Next.js | ||
|
|
||
| --- | ||
|
|
||
| ## Core Domain Model | ||
|
|
||
| ### Job States | ||
|
|
||
| ```typescript | ||
| type JobStatus = | ||
| | "pending" // Waiting in queue | ||
| | "running" // Currently executing | ||
| | "completed" // Finished successfully | ||
| | "failed" // Failed (will stay in this state until manual retry) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Correct "manual retry" description. The comment claims failed jobs "will stay in this state until manual retry" but the implementation auto-retries based on 🤖 Prompt for AI Agents |
||
| | "delayed" // Scheduled for future execution | ||
| | "cancelled"; // Manually cancelled | ||
| ``` | ||
|
|
||
| ### Job Configuration | ||
|
|
||
| Each job supports: | ||
|
|
||
| - **Priority**: `critical` (0) > `high` (1) > `normal` (2) > `low` (3) | ||
| - **Retry strategies**: Fixed, linear, or exponential backoff | ||
| - **Timeout**: Per-job execution time limit | ||
| - **Delay**: Schedule for future execution | ||
| - **Max attempts**: Retry limit before marking as failed | ||
| - **Tags & Metadata**: For filtering and custom data | ||
|
|
||
| ## Data Flow | ||
|
|
||
| ```text | ||
| App → client.addJob() → HTTP POST /api/jobs → server → queue.add() → process | ||
| App ← client.onJobCompleted() ← WebSocket ← server ← queue.emit('job:completed') | ||
| ```mermaid | ||
| sequenceDiagram | ||
| participant Client as Client<br/>(SDK/App) | ||
| participant Server as Server<br/>(Bun) | ||
| participant Core as Core Engine | ||
| participant DB as SQLite Database | ||
|
|
||
| Client->>Server: HTTP POST /api/jobs | ||
| Server->>Core: Process job | ||
| Core->>DB: Read/Write data | ||
|
|
||
| loop Real-time Updates | ||
| Core-->>Client: WebSocket Events<br/>job:completed, job:failed,<br/>job:progress, stats, etc. | ||
| DB-->>Client: Events | ||
| end | ||
|
Comment on lines
+129
to
+132
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Remove incorrect DB→Client event flow.
🤖 Prompt for AI Agents |
||
| ``` | ||
|
|
||
| ### Step-by-Step Flow | ||
|
|
||
| 1. Job Submission | ||
| - Client calls `client.addJob()` with job data and options | ||
| - HTTP request sent to `POST /api/jobs` | ||
| - Server validates and passes job to Core engine | ||
| - Core stores job in SQLite and adds to queue | ||
| - Server returns job ID to client | ||
| 2. Job Processing | ||
| - Core engine picks next job based on priority and concurrency limits | ||
| - Job status transitions: pending → running | ||
| - Task function executes with configured timeout | ||
| - Progress updates can be emitted during execution | ||
| 3. Completion | ||
| - Success: Status → completed, result stored | ||
| - Failure: Status → failed, error stored | ||
| - All state changes persisted to SQLite | ||
| 4. Real-time Updates | ||
| - Core emits events for every state change | ||
| - Server broadcasts events via WebSocket to connected clients | ||
| - Clients receive typed events in real-time | ||
|
|
||
| ## Design Principles | ||
|
|
||
| 1. **Modular** – Each package can be used independently | ||
| 2. **Simple** – Zero-config defaults, easy to extend | ||
| 3. **Type-safe** – Full TypeScript with strict typing | ||
| 4. **Event-driven** – Real-time updates for all state changes | ||
| 5. **Persistent by default** – SQLite ensures jobs survive restarts | ||
| 6. **Developer-first** – Clear API, excellent dev experience | ||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,6 +4,14 @@ | |||||||||
|
|
||||||||||
| ```bash | ||||||||||
| npm install @jet-queue/core | ||||||||||
|
|
||||||||||
| # or | ||||||||||
|
|
||||||||||
| pnpm add @jet-queue/core | ||||||||||
|
|
||||||||||
| # or | ||||||||||
|
|
||||||||||
| yarn add @jet-queue/core | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| ## Your First Queue | ||||||||||
|
|
@@ -30,6 +38,8 @@ queue.on("queue:drain", () => { | |||||||||
| ```bash | ||||||||||
| npx @jet-queue/server --port 3001 | ||||||||||
| ``` | ||||||||||
| > [!TIP] | ||||||||||
| > you can use whatever package manger you want, here is the npm example | ||||||||||
|
Comment on lines
+41
to
+42
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Fix typo and grammar in tip. "package manger" → "package manager". Also capitalize "You" and add punctuation: "You can use whatever package manager you want. Here is the npm example:" 📝 Proposed fix > [!TIP]
-> you can use whatever package manger you want, here is the npm example
+> You can use whatever package manager you want. Here is the npm example:📝 Committable suggestion
Suggested change
🧰 Tools🪛 LanguageTool[grammar] ~42-~42: Ensure spelling is correct (QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||||||||||
|
|
||||||||||
| Then connect with the client: | ||||||||||
|
|
||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # JetQueue - Background job processor | ||
| **Keep your API snappy. Process heavy tasks in the background.** | ||
|
|
||
| > JetQueue moves time-consuming operations out of your request/response cycle, giving users sub-100ms response times while emails send, PDFs generate, and data processes in parallel. | ||
|
|
||
|
|
||
| ## Features | ||
| - **Concurrent Processing** - Run N jobs simultaneously | ||
| - **Auto-Retry** - Exponential, linear, or fixed backoff strategies | ||
| - **Priority Queues** - Critical jobs jump the line | ||
| - **Delayed & Recurring Jobs** - Schedule work for later | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Verify if recurring job support exists in the codebase
rg -nP --type=ts '\b(cron|recur|repeat|interval)\b' packages/core/src/Repository: arxja/jet-queue Length of output: 259 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '\n== types.ts around recurrence ==\n'
sed -n '110,150p' packages/core/src/types.ts
printf '\n== search for repeat/cron usage in core ==\n'
rg -n --type ts '\b(repeat|cron|type:\s*[\'"]once[\'"]\s*\|\s*[\'"]repeat[\'"])\b' packages/core/src
printf '\n== queue/job implementation references ==\n'
rg -n --type ts '\b(delay|cron|repeat|once)\b' packages/core/src | sed -n '1,220p'Repository: arxja/jet-queue Length of output: 1338 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '\n== recurrence-related type and implementation references ==\n'
rg -n --type ts --type md '\b(repeat|cron|timezone|ScheduleJobs|once)\b' packages core docs . 2>/dev/null | sed -n '1,260p'
printf '\n== locate ScheduleJobs usage ==\n'
rg -n --type ts 'ScheduleJobs' packages core . 2>/dev/null
printf '\n== inspect likely scheduling code paths ==\n'
fd -a --type f '.*(queue|job|schedule).*\.ts$' packages core . 2>/dev/null | sed -n '1,120p'Repository: arxja/jet-queue Length of output: 1982 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '\n== queue.ts scheduling-related sections ==\n'
ast-grep outline packages/core/src/queue.ts --view expanded | sed -n '1,220p'
printf '\n== schedule-related symbols in queue.ts ==\n'
rg -n --type ts 'schedule|delay|cron|repeat|timezone|ScheduleJobs' packages/core/src/queue.ts packages/core/src/*.ts
printf '\n== job and queue type definitions ==\n'
sed -n '1,220p' packages/core/src/types.tsRepository: arxja/jet-queue Length of output: 12910 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '\n== addRepeating implementation ==\n'
sed -n '180,240p' packages/core/src/queue.ts
printf '\n== any cron/timezone handling ==\n'
rg -n --type ts '\b(cron|timezone)\b' packages/core/src packages/core/testsRepository: arxja/jet-queue Length of output: 1575 Clarify the recurring-jobs claim 🤖 Prompt for AI Agents |
||
|
|
||
| ## **Where** and **Why** you should use it | ||
|
|
||
| > Be decisive can use it every where that you are working with asynchronous tasks and queues | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Fix grammatical errors in use case intro. "Be decisive can use it every where that you are working with asynchronous tasks and queues" contains multiple errors. Suggest: "You can use it everywhere you work with asynchronous tasks and queues." 🤖 Prompt for AI Agents |
||
|
|
||
| | Industry | Examples | | ||
| |---|---| | ||
| | **E-commerce** | Order confirmation emails, inventory sync, invoice PDF generation | | ||
| | **Social Media** | Image/video processing, notification dispatch, feed generation | | ||
| | **SaaS** | Report generation, data exports, search indexing, billing | | ||
| | **AI/ML** | Model inference, data preprocessing, batch predictions | | ||
| | **IoT** | Sensor data processing, device command queues | | ||
|
|
||
| ## Examples and demo | ||
|
|
||
| *For better understanding of what does actually JetQueue do check out our examples [here](./examples.md)* | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,8 @@ | ||
| # JetQueue - version 1 check list | ||
|
|
||
| - [ ] Add v1 docs | ||
| - [x] Add v1 docs | ||
| - [ ] Add docs for each package | ||
| - [ ] Update each package.json files | ||
| - [ ] Fix web dashboard build time error | ||
| - [ ] Polish the codebase for the v1 | ||
| - [ ] Polish the codebase for the v1 | ||
| - [x] Update deps |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,10 +18,11 @@ | |
| }, | ||
| "devDependencies": { | ||
| "@types/bun": "^1.3.13", | ||
| "@types/node": "^26.0.1", | ||
| "tsup": "^8.0.0", | ||
| "typescript": "^5.3.0" | ||
| }, | ||
| "engines": { | ||
| "engines": { | ||
|
Comment on lines
+21
to
+25
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
python - <<'PY'
import json
from pathlib import Path
pkg = json.loads(Path("packages/core/package.json").read_text())
print("packages/core/package.json")
print(" engines.node =", pkg.get("engines", {}).get("node"))
print(" devDependencies.@types/node =", pkg.get("devDependencies", {}).get("`@types/node`"))
print(" devDependencies.typescript =", pkg.get("devDependencies", {}).get("typescript"))
PY
echo
echo "Node API call sites worth double-checking against the supported engine:"
rg -n --type=ts -C2 '\b(process|crypto\.randomUUID|node:)\b' packages/core/srcRepository: arxja/jet-queue Length of output: 2703 Align
🤖 Prompt for AI Agents |
||
| "node": ">=22.5.0" | ||
| }, | ||
| "peerDependencies": { | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Fix
assigneesformat in YAML frontmatter.assignees: ''sets an empty string rather than an empty list. Useassignees: []or omit the key entirely for unassigned issues.🤖 Prompt for AI Agents