Getting started

Installation

This page walks one app from nothing to a running screen: how tent is run, a table, a query, a screen with its data, a link, a form, a sign-in, the seed and tent dev. Every file below is whole, and the app it makes runs as it is written.

Running tent

tent comes with the package tentjs of npm, which brings the Node.js it runs on:

Terminal
npm install -g tentjs

Each command of these docs is then tent <command>. A project names its own tentjs in its package.json, and tent builds and runs a project with the version it names. A program of your own that imports the framework, as topic.engine shows one, finds it in the tentjs that the project holds.

A new project

Terminal
tent new my-app
cd my-app

npm create tent my-app makes the same project with nothing installed first, by tent new of the newest tentjs. tent new writes a bare project: tent.ts, package.json, AGENTS.md, one screen at / and the query it reads. The files below take their place. A definition is a top-level export const made by a word of tentjs; tent check after every change reports every mistake at once, each with its fix.

The project and its people

tent.ts
import { project } from 'tentjs'

export const myApp = project('myApp', {
  title: 'My App',
  signInPath: '/sign-in',
})

The engine reads id and roles of each row of users; the rest is the project's own. The password is stored as its hash, in a column that no rule lets anyone read.

tables/users.ts
import { list, table, text } from 'tentjs'

export const users = table('users', {
  columns: {
    email: text({ unique: true, personal: true }),
    name: text({ optional: true, personal: true }),
    password: text({ optional: true, private: true }),
    roles: list(text()),
  },
  access: { read: 'owner' },
})

Every page

The same pages that tent docs prints, in the version of Tent.js that made this site.

Topics

69

How a part of the framework works, walked through with whole examples.

Words

95

Each word of tentjs that makes a definition or works out a value.

Options

395

Each option of a word, with its value and an example.

Tags

3

The tags of tentjs/ui: Link, Form and Image.

Hooks

12

The hooks a view calls.

Handles

17

The handles that code is given: mail, files, sessions and the others.

Adapters

15

The interfaces by which a part of your own takes the place of one of ours.

Commands

37

Each command of tent, with its flags and what it prints.

Codes

188

Each code a finding or a failure carries, with its fix.

Tent.js