Logo

Command Palette

Search for a command to run...

Project Structure

Understand the RocketX monorepo layout: API routes, shared models, and the web app.

The project uses Turborepo for workspace management and npm workspaces.

Monorepo Overview

.
├── apps/
│   ├── api/          # Express.js backend (TypeScript, OpenAPI/Scalar, RBAC)
│   └── web/          # Next.js frontend (React, Tailwind v4, Shadcn UI)
└── packages/
    └── shared/       # Mongoose models, session crypto, email, PayID utils
  • docker-compose.yml — runs MongoDB and both apps locally.
  • turbo.json — build pipeline configuration.

Apps

apps/api — Express Backend

All REST routes live under /v1/. Responses follow { success, data, message }.

PathPurpose
src/routes/developer.tsStrategy CRUD, GitHub OAuth, version submissions, framework detection
src/routes/marketplace.tsPublic strategy discovery and instance activation
src/routes/payments.tsCRDTS wallet top-ups and transfers
src/routes/subscriptions.tsPlan checkout, renewal, and reconciliation
src/routes/webhooks.tsIncoming GitHub App webhooks
src/middleware/auth.tsSession and API key verification
src/middleware/rbac.tsTeam role enforcement

apps/web — Next.js Frontend

The App Router separates concerns into three route groups:

Route groupPurpose
app/(site)/Public landing page, guides, legal
app/(app)/Authenticated dashboard, marketplace, developer portal, instances
app/(auth)/Login, register, password reset

Key frontend paths:

  • app/(app)/marketplace/ — browse and activate strategies.
  • app/(app)/developer/ — developer portal: create and manage strategies.
  • app/(app)/developer/strategies/[strategyId]/ — version submissions, pipeline results.
  • app/(app)/instances/ — monitor running strategy instances.
  • app/(app)/wallet/ — CRDTS balance, top-up, transaction history.
  • utils/marketplace/ — typed API service layer and shared interfaces.

Shared Package

packages/shared

Single source of truth for all Mongoose models consumed by both the API and web server components.

ModuleContents
lib/models/User, Team, Strategy, StrategyVersion, StrategyInstance, Wallet, etc.
lib/notifications/events.tsCanonical notification event type registry
utils/Session encryption, email helpers, PayID PKCE

packages/tsconfig

Shared TypeScript compiler settings for consistent strictness across the monorepo.


Key Patterns

  • Schema-driven: All API request/response shapes flow from shared Mongoose models → TypeScript interfaces in utils/marketplace/types.ts → typed service methods → UI.
  • Server-side auth: Sessions are verified on the Express API; Next.js RSCs read the session via ENCRYPTION_KEY for server-rendered pages.
  • Proxy rewrites: next.config.ts rewrites /api/* to the Express server so the browser talks to one origin.