Skip to content

1. Install & first route

Create a Tyravel app, boot the HTTP kernel, and return your first HTML page.

Create the project

bash
npm create tyravel@latest blog
cd blog
npm install

The default scaffold uses SQLite, a database queue, and log mail — no Redis or cloud SDKs required.

Project layout

Key files:

  • src/main.ts — boots providers and the HTTP kernel
  • src/routes/web.ts — web routes (or routes/web.ts depending on scaffold)
  • config/ — typed configuration modules
  • resources/views/.tyr templates

See Application structure for the full map.

First route

typescript
import { Route, View } from '@tyravel/core';
import { Response } from '@tyravel/http';

Route.get('/', async () =>
  Response.html(await View.render('welcome', { title: 'Hello Tyravel' })),
);

Route.get('/health', async () => Response.json({ ok: true }));

Create the view:

bash
tyravel make:view welcome

Run the dev server

bash
tyravel dev

tyravel dev starts the server with view, config, and route hot reload. Use tyravel debug:watch in a second terminal after tyravel debug:install to tail request timelines.

Visit http://127.0.0.1:3000 and /health.

Verified in CI

The examples/hello-world reference app exercises this step. Its feature test asserts the welcome page contains Hello Tyravel:

bash
cd examples/hello-world && npm test

Named routes

typescript
Route.get('/posts', async () => Response.json([])).name('posts.index');

List routes with tyravel route:list — filters and JSON output are documented in the routing guide.

Next

Continue to Auth & database to persist users and protect routes.

Released under the MIT License.