Skip to content
4 changes: 4 additions & 0 deletions packages/docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ export default defineConfig({
text: "Starting the Engine",
link: "/starting",
},
{
text: "Backends",
link: "/backends",
},
{
text: "Enqueueing Jobs",
link: "/enqueue",
Expand Down
64 changes: 63 additions & 1 deletion packages/docs/dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,68 @@ await Sidequest.start({
});
```

## Starting only the Dashboard

In some scenarios, you may want to run only the dashboard without starting the Sidequest engine. This is useful for monitoring existing job queues, creating dedicated monitoring instances, or separating concerns in your architecture.

### Installation

First, install the dashboard package:

```bash
npm install @sidequest/dashboard
# or
yarn add @sidequest/dashboard
```

You'll also need to install the appropriate backend driver for your database:

```bash
# For PostgreSQL (recommended)
npm install @sidequest/postgres-backend

# For SQLite
npm install @sidequest/sqlite-backend

# For MySQL
npm install @sidequest/mysql-backend

# For MongoDB
npm install @sidequest/mongo-backend
```

### Basic Usage

Use the `SidequestDashboard` class to create a standalone dashboard instance:

```typescript
// or import form `sidequest` directly if you have the full library
import { SidequestDashboard } from "@sidequest/dashboard";

const dashboard = new SidequestDashboard();

await dashboard.start({
enabled: true,
port: 8678,
backendConfig: {
driver: "@sidequest/postgres-backend",
config: "postgresql://localhost:5432/sidequest",
},
});

console.log("Dashboard available at http://localhost:8678");
```

### Shutting Down

To properly close the dashboard and clean up resources:

```typescript
// Graceful shutdown
await dashboard.close();
console.log("Dashboard stopped and resources cleaned up");
```

## Dashboard Features

### 1. Job Statistics Overview
Expand Down Expand Up @@ -263,7 +325,7 @@ Real-time queue monitoring with:

The dashboard includes a clean navigation structure:

```
```text
Dashboard Home -> Overview and Statistics
├── Jobs -> Job listing, filtering, and management
├── Queues -> Queue status and controls
Expand Down
33 changes: 29 additions & 4 deletions packages/docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ Sidequest is built as a monorepo with the following packages:
- **`@sidequest/dashboard`** - Web dashboard with Express.js, EJS, and HTMX
- **`@sidequest/cli`** - Command-line interface tools

## Setup
## Build

If you want to build Sidequest from source, follow these steps:

```bash
# Clone the repository
Expand All @@ -43,10 +45,33 @@ yarn install

# Build all packages
yarn build
```

# Run tests
yarn test
## Development Mode

# Start development mode
If you want to develop Sidequest, you can run the development server for the entire application, including the documentation site:

```bash
yarn dev
```

This will enable the dev server, which will watch for changes in the source code and automatically rebuild the affected packages. The documentation site will also be available at `http://localhost:5173`.

## Testing

To run the tests, first either build the application or run it in development mode. Then, you can execute the tests for all packages in a separate terminal:

```bash
# Starts all the test DBs in Docker containers
yarn db:all

# Run tests for all packages
yarn test:all
```

If you'd rather not run backend tests, you can run the minified test suite without starting any DB containers:

```bash
# Run tests without backend implementations
yarn test
```
Loading
Loading