Forjr: the framework for whole apps, made for AI to build apps and for apps with AI built in
翻译准备中
正在加载完整 README。
查看完整 README ↗npm install -g forjr
forjr new my-app
cd my-app && forjr dev
The app runs at http://localhost:3000, and each save shows in the open page. With nothing installed first, npm create forjr my-app makes the same project, and npx forjr dev runs it.
AGENTS.md, the full docs ship inside the package, and forjr map and forjr check give a coding agent the whole app and every problem in it at once.forjr dev on your laptop. forjr start on any server, with HTTPS for your domains, and many readers beside one writer when one machine is not enough. Open source, MIT licence.In the project that forjr new made: a table with who may read and add its rows, a query, a change, and a screen that reads the one and calls the other, in place of the first screen.
// notes.ts
import { anyone, change, input, query, table, text } from 'forjr'
export const notes = table('notes', {
columns: { body: text({ min: 1, max: 280 }) },
access: { read: anyone('the notes are public'), add: anyone('every visitor may sign') },
})
export const latestNotes = query('latestNotes', {
access: anyone('the notes are public'),
rows: notes.newest('createdAt').limit(20),
})
export const addNote = change('addNote', {
access: anyone('every visitor may sign'),
input: { body: text({ min: 1, max: 280 }) },
set: notes.add({ body: input('body') }),
})
// screens/home.tsx
import { anyone, read, screen, Form } from 'forjr/ui'
import { addNote, latestNotes } from '../notes'
export const homeScreen = screen('homeScreen', {
path: '/',
access: anyone('the guestbook is public'),
data: { notes: read(latestNotes) },
view: ({ notes }) => (
<main>
<h1>Guestbook</h1>
<Form call={addNote}>
<input name="body" />
<button type="submit">Sign</button>
</Form>
<ul>
{notes.map((note) => (
<li key={note.id}>{note.body}</li>
))}
</ul>
</main>
),
})
forjr check reports every mistake at once, each with its fix, and forjr dev runs it.
The docs ship inside the package, so they always match the version you run:
forjr docs opens on the first page, which walks one app from nothing.forjr docs <name or code> prints one page: forjr docs query, forjr docs F1003.forjr docs --reference prints every word, option, tag, hook, command and code.They are also on the site: forjr.dev.
examples/ holds whole apps built with Forjr, each with a README of how to run it:
orders: an orders tool for a shop's staff and customers, with a sign-in, roles, live updates and two languages.marketing-site: the site of a product, in two languages, with a gallery, a contact form and a sitemap.help-desk: mail becomes tickets, and an AI agent drafts answers from a guide of PDF files, asks before a refund, and listens and speaks.app-builder: people describe an app in a chat and an AI builds it, each in a workspace of their own.bots: always-on bots on your own computer, with a memory each, routines, MCP tools and an ask before anything that sends, pays or deletes.Questions, ideas and bugs go to the issues. To work on Forjr itself, read CONTRIBUTING.md.
Please do not report a security issue in a public issue. SECURITY.md says where to send it.
MIT. Made by Tentis Labs. The parts Forjr ships from others, with their licences, are listed in THIRD-PARTY.md.