Overview
rs-tunnel is organized as a pnpm workspace monorepo using Turborepo for task orchestration. The repository contains applications, shared packages, and configuration.Workspace Configuration
The workspace is defined inpnpm-workspace.yaml:
pnpm-workspace.yaml
Directory Structure
Apps Directory
Theapps/ directory contains the deployable applications:
apps/api
@ripeseed/apiFastify-based REST API that handles:
- User authentication via Slack OAuth
- Cloudflare tunnel lifecycle management
- DNS record creation/deletion
- Tunnel lease management and heartbeats
- Background cleanup worker for stale tunnels
apps/cli
@ripeseed/rs-tunnelCommand-line interface for users:
login- Authenticate with API via Slackup- Start tunnel with ngrok-style dashboardlist- View active tunnelsstop- Stop tunnel and cleanup DNSlogout- Clear authenticationdoctor- Diagnose connection issues
Packages Directory
Thepackages/ directory contains shared libraries:
packages/shared
@ripeseed/sharedShared TypeScript contracts and Zod schemas consumed by both API and CLI:
- Request/response types
- Validation schemas
- API contract definitions
- Domain models
packages/config
@ripeseed/configShared configuration for development tools:
- ESLint configuration
- Prettier configuration
- TypeScript base config
- Vitest setup
Dependency Graph
Turborepo Pipeline
The build pipeline is defined inturbo.json:
turbo.json
Pipeline Behavior
- build
- typecheck
- test
- dev
- Dependencies:
^build(build dependencies first) - Outputs:
dist/**,.next/** - Cached: Yes
@ripeseed/shared package builds first, then api and cli.Package Scripts
Each package defines standard npm scripts. From the repository root:Root-level commands
Package-specific commands
Workspace Dependencies
Packages reference each other using workspace protocol:apps/cli/package.json
The
workspace:* protocol ensures packages always use the local workspace version during development. During publish, pnpm automatically replaces this with the actual version number.Build Output
All packages compile TypeScript to thedist/ directory:
The project uses ESM (ECMAScript modules) exclusively. All imports use
.js extensions, even in TypeScript source files:Publishing Strategy
Two packages are published to npm:- @ripeseed/shared - Public package with shared contracts
- @ripeseed/rs-tunnel - Public CLI package
@ripeseed/api) is private and deployed as a service.
Package Metadata
Next Steps
Local Setup
Get the development environment running
Testing
Learn about the testing strategy
Contributing
Guidelines for contributing code
Release Process
How packages are published to npm

