Quickstart
Prerequisites
Section titled “Prerequisites”- Node.js >= 20
- pnpm >= 9 (recommended) or npm
- AWS credentials configured (for deployment)
1. Install the CLI
Section titled “1. Install the CLI”npm install -g @venturekit/cli@dev2. Create a New Project
Section titled “2. Create a New Project”vk init my-appYou’ll be prompted to choose a template:
| Template | Description |
|---|---|
| API (default) | REST API with auth and scoped endpoints |
| API + Database | API with Postgres database and migrations |
| API + Queue | API with SQS queue consumer |
| API + Storage | API with S3 storage and file uploads |
| Fullstack | API + Database + Storage + Queue |
Dependencies are installed automatically. Or skip prompts with defaults:
vk init my-app --yes3. Explore the Project
Section titled “3. Explore the Project”Your project has this structure:
my-app/├── config/│ ├── base.ts # Project identity (name, region)│ ├── security.ts # OAuth scopes and app clients│ ├── dev.ts # Dev environment (preset + overrides)│ └── prod.ts # Production environment (preset + overrides)├── src/│ └── routes/│ ├── health/│ │ └── get.ts # GET /health│ └── tasks/│ ├── get.ts # GET /tasks (authenticated)│ └── post.ts # POST /tasks (authenticated)├── vk.config.ts # Entry point — base, security, infra definitions, envs├── package.json└── tsconfig.jsonvk.config.ts
Section titled “vk.config.ts”This is the entry point. It wires everything together:
import { defineVenture } from '@venturekit/infra';import { base } from './config/base';import { security } from './config/security';import { dev } from './config/dev';import { prod } from './config/prod';
export default defineVenture({ base, security, envs: { dev, prod },});src/routes/health/get.ts
Section titled “src/routes/health/get.ts”A public endpoint — no scopes means no authentication required:
import { handler } from '@venturekit/runtime';
export const main = handler(async (_body, ctx, logger) => { logger.info('Health check requested'); return { status: 'healthy', timestamp: ctx.timestamp.toISOString(), requestId: ctx.requestId, };});4. Start Development
Section titled “4. Start Development”vk devThis starts a local development server with Docker services for your infrastructure. Handlers are loaded at runtime — edit a file and the next request uses the new code.
Test your endpoint:
curl http://localhost:3000/health5. Add a Route
Section titled “5. Add a Route”Generate a new route with a dynamic segment:
vk g route "tasks/[id]" -m put --scopes tasks.writeThis creates src/routes/tasks/[id]/put.ts:
import { handler } from '@venturekit/runtime';
export const main = handler( async (body, ctx, logger) => { logger.info('PUT /tasks/{id}', { requestId: ctx.requestId }); return { message: 'Hello from PUT /tasks/{id}' }; }, { scopes: ['tasks.write'] });6. Deploy
Section titled “6. Deploy”# Deploy to devvk deploy
# Deploy to productionvk deploy --stage prodNext Steps
Section titled “Next Steps”- Configuration — Understand the layered config system.
- File-Based Routing — Learn the routing conventions.
- Handlers — Deep dive into the unified handler.
- Infrastructure Intents — Declare databases, storage, queues, and more.