VelaVela
Getting Started

Project Structure

Understand the application created by vela new.

vela new my-api creates four source files and the configuration needed to run them in Cloudflare Workers:

worker.ts
app.module.ts
app.controller.ts
app.service.ts
.swcrc
wrangler.jsonc
package.json
pnpm-workspace.yaml
tsconfig.json
README.md
FileResponsibility
src/worker.tsExports native Workers handlers with environment-scoped application initialization.
src/app.module.tsRegisters the controller and injectable service.
src/app.controller.tsHandles GET / and delegates to its injected service.
src/app.service.tsSupplies the greeting.
.swcrcCompiles TypeScript, legacy decorators, and constructor metadata.
wrangler.jsoncRuns the custom SWC build and loads dist/worker.js.
tsconfig.jsonConfigures strict TypeScript checking without emitting JavaScript.
pnpm-workspace.yamlAllows the native build dependencies used by SWC and Wrangler.

The application uses published npm dependencies. It has no dependency catalog, workspace ranges, or links to a Vela source checkout. pnpm install creates a lockfile that you should commit.

Add a feature

As the application grows, group a feature's controller, service, and module in one directory. Import that feature module from the root module. Keep request handling in controllers and reusable application logic in services.

You can create these files manually; feature generators are not yet included.

Edit on GitHub

Last updated on

On this page