|
| 1 | +--- |
| 2 | +title: Installation |
| 3 | +description: Learn how to install Vorsteh Queue packages for your preferred ORM adapter. |
| 4 | +--- |
| 5 | + |
| 6 | +## Prerequisites |
| 7 | + |
| 8 | +Before installing Vorsteh Queue, ensure you have: |
| 9 | + |
| 10 | +- **Node.js 20+** |
| 11 | +- **PostgreSQL 12+** database |
| 12 | +- **ESM project** - Add `"type": "module"` to your `package.json` or use `.mjs` file extensions |
| 13 | + |
| 14 | +## Quick Start with CLI (Recommended) |
| 15 | + |
| 16 | +The fastest way to get started is using the `create-vorsteh-queue` CLI tool: |
| 17 | + |
| 18 | +```bash |
| 19 | +# Interactive setup |
| 20 | +npx create-vorsteh-queue my-queue-app |
| 21 | + |
| 22 | +# Or with specific options |
| 23 | +npx create-vorsteh-queue worker-service \ |
| 24 | + --template=drizzle-postgres \ |
| 25 | + --package-manager=pnpm \ |
| 26 | + --quiet |
| 27 | +``` |
| 28 | + |
| 29 | +### Available Templates |
| 30 | + |
| 31 | +- **drizzle-pg** - Basic Drizzle ORM with node-postgres |
| 32 | +- **drizzle-pglite** - Zero-setup with embedded PostgreSQL |
| 33 | +- **drizzle-postgres** - Advanced with recurring jobs |
| 34 | +- **event-system** - Comprehensive event monitoring |
| 35 | +- **progress-tracking** - Real-time progress updates |
| 36 | +- **pm2-workers** - Multi-process workers with PM2 |
| 37 | + |
| 38 | +## Manual Installation |
| 39 | + |
| 40 | +If you prefer to add Vorsteh Queue to an existing project: |
| 41 | + |
| 42 | +### Drizzle ORM (PostgreSQL) |
| 43 | + |
| 44 | +<PackageInstall |
| 45 | + packages={["@vorsteh-queue/core", "@vorsteh-queue/adapter-drizzle"]} |
| 46 | + className={{ container: "not-prose", code: "not-prose" }} |
| 47 | +/> |
| 48 | + |
| 49 | +### Prisma ORM (PostgreSQL) |
| 50 | + |
| 51 | +<PackageInstall |
| 52 | + packages={["@vorsteh-queue/core", "@vorsteh-queue/adapter-prisma"]} |
| 53 | + className={{ container: "not-prose", code: "not-prose" }} |
| 54 | +/> |
| 55 | + |
| 56 | +## Database Setup |
| 57 | + |
| 58 | +After installation, you'll need to set up the required database tables. Each adapter provides migration scripts or schema definitions: |
| 59 | + |
| 60 | +- **Drizzle**: Use the provided schema and run migrations |
| 61 | +- **Prisma**: Add the schema to your `schema.prisma` and run `prisma migrate` |
| 62 | + |
| 63 | +Refer to the specific adapter documentation for detailed setup instructions. |
| 64 | + |
| 65 | +## Verify Installation |
| 66 | + |
| 67 | +Create a simple test file to verify your installation: |
| 68 | + |
| 69 | +```typescript |
| 70 | +import { Queue } from "@vorsteh-queue/core" |
| 71 | + |
| 72 | +// Your adapter import will vary based on your choice |
| 73 | +console.log("Vorsteh Queue installed successfully!") |
| 74 | +``` |
| 75 | + |
| 76 | +Run the file with Node.js to confirm everything is working correctly. |
0 commit comments