NyxCode is a token-efficient language designed for AI. Database, auth, API, and frontend โ all in a single
.nyx
file.
# Install globally
$ npm i -g @fabudde/nyxcode
$ nyx build app.nyx
โ Full-stack app generated ๐ฆ
A full-stack blog with auth, database, and CRUD. Measured with cl100k_base tokenizer.
table posts { title text required, body text, created auto }
security { login email password, token jwt, protect /api/posts write }
theme { colors { primary: #667eea } }
page / {
h1 "My Blog"
form /api/posts auth {
input title, input body
submit "Post", success -> reload
}
data posts = get /api/posts
each posts -> div {
h3 .title, p .body
}
}
// prisma/schema.prisma
model Post {
id Int @id @default(autoincrement())
title String
body String
author User @relation(...)
}
// app/api/posts/route.ts
import { prisma } from "@/lib/db";
import { getServerSession } from "next-auth";
export async function POST(req: Request) {
const session = await getServerSession();
if (!session) return NextResponse.json(
{ error: "Unauthorized" }, { status: 401 });
const body = await req.json();
return NextResponse.json(
await prisma.post.create({ data: body }));
}
// + auth/[...nextauth].ts (180 tokens)
// + app/page.tsx (220 tokens)
// + components/PostForm.tsx (140 tokens)
// + middleware.ts, tailwind.config.ts, ...
// ... 800+ more tokens across 8 files
82%
fewer tokens vs Next.js
25%
fewer tokens vs Tailwind
1
file, zero config
Full-stack primitives, designed for a world where most code is written by AI.
Tables, auth, API routes, and UI in a single .nyx file. Compiles to Express + SQLite + static HTML.
Themes with colors, spacing, radius, shadows, fonts. Dot-notation refs. 7 built-in presets.
82% fewer tokens than Next.js. Shorthand properties everywhere. Built for Claude, GPT, and Gemini.
One attribute โ responsive mobile nav. Pure HTML5 details/summary. No runtime, no JavaScript.
Import Tokens Studio or W3C DTCG JSON directly. Colors, spacing, shadows โ validated and security-audited.
Define once, use everywhere. Parameterized components with defaults. Style presets = reusable CSS classes.
JWT auth, bcrypt, rate limiting, SQL injection guards, TOCTOU-safe file loading. Audited 9.5/10 by Tyto ๐ฆ.
use "./file.nyx" imports for bigger projects. nyx flatten collapses back to one file.
No webpack, no Vite, no Babel. Compile with nyx build. Dev server with hot reload built in.
Database. Auth. JWT. 10 CRUD endpoints. Login, register, and a post feed. Really.
table posts { title text required, body text, created auto }
security { table users, login email password, token jwt, protect /api/posts write }
theme { colors { primary: #667eea, bg: #0a0a12, card: #1a1a2e } }
preset card { bg card, r 12px, p 2rem }
page / {
section style={ mw 800px, mx auto, p 2rem } {
h1 "My Blog"
form /api/posts auth { input title, submit "Post", success -> reload }
data posts = get /api/posts auth
each posts -> div preset=card { h3 .title, p .body }
}
}
page /register {
form /api/auth/register {
input email, input password, submit "Register", success -> redirect /
}
}
v0.31.5
Current release
370
Tests passing
9.5/10
Security score
0
Runtime deps
Install in one command. Deploy in one file. No framework bingo.
$ npm i -g @fabudde/nyxcode
$ nyx build app.nyx