A Node.js Framework for Powerful Backend Services
Documentation • AI Setup (MCP) • Quick Start • Features • Full Docs
Tejas (meaning "radiance" in Hindi) is a modern, lightweight Node.js framework designed for building robust backend services. It offers an intuitive API with aviation-inspired naming conventions, making your code both expressive and enjoyable to write.
import Tejas, { Target } from 'te.js';
const app = new Tejas();
const api = new Target('/api');
api.register('/hello/:name', (ammo) => {
ammo.fire({ message: `Hello, ${ammo.payload.name}!` });
});
app.takeoff();- AI-Native (MCP) — Ship with an MCP server so AI assistants can scaffold projects, generate routes, and write correct code with full framework knowledge
- Simple Routing — Clean, method-agnostic URL structures with parameterized routes
- Express Compatible — Use existing Express middleware alongside Tejas middleware
- Zero-Config Error Handling — No try-catch needed! Tejas catches all errors automatically. Opt in to have an LLM determine error code and message when you don't specify them (see Error Handling)
- Built-in Rate Limiting — Three algorithms (Token Bucket, Sliding Window, Fixed Window) with memory or Redis storage
- Method Safety & CORS — Opt-in method restriction per route (
register(path, { methods }, handler)orammo.only('GET')), global allowed-methods filter, andapp.withCORS()for cross-origin requests - File Uploads — Easy file handling with size limits and type validation
- Auto-Documentation — Generate OpenAPI specs from your code with LLM-powered analysis (
tejas generate:docs) - Interactive API Docs — Serve a Scalar API reference UI with
app.serveDocs() - Auto-Discovery — Automatic route registration from
.target.jsfiles - Request Logging — Built-in HTTP request and exception logging
Recommended — The best way to get started with Tejas in the age of AI.
The Tejas MCP server gives your IDE's AI assistant full knowledge of the framework — documentation, code examples, and purpose-built tools to scaffold projects and generate correct code. No more hallucinated APIs.
Cursor — add this to .cursor/mcp.json:
{
"mcpServers": {
"tejas": {
"command": "npx",
"args": ["-y", "tejas-mcp"]
}
}
}Other MCP-compatible IDEs — run npx tejas-mcp as the server command (stdio transport, no config needed).
Once connected, prompt your AI with things like "Scaffold a new te.js project called my-api" or "Create a REST API with user CRUD routes" — the assistant will generate framework-correct code using real te.js patterns.
npm install te.js// index.js
import Tejas from 'te.js';
const app = new Tejas({ port: 3000 });
app.takeoff();// targets/user.target.js
import { Target } from 'te.js';
const users = new Target('/users');
users.register('/', (ammo) => {
if (ammo.GET) {
ammo.fire([{ id: 1, name: 'John' }]);
} else if (ammo.POST) {
const { name, email } = ammo.payload;
ammo.fire(201, { id: 2, name, email });
} else {
ammo.notAllowed();
}
});
users.register('/:id', (ammo) => {
const { id } = ammo.payload;
ammo.fire({ id, name: 'John Doe' });
});node index.js
# Server running at http://localhost:3000| Tejas Term | Purpose | Express Equivalent |
|---|---|---|
Tejas |
Application instance | express() |
Target |
Route group/router | Router() |
Ammo |
Request/response context | req + res |
fire() |
Send response | res.send() |
midair() |
Register middleware | use() |
takeoff() |
Start server | listen() |
tejas fly [file] # Start the server
tejas generate:docs [--ci] # Generate OpenAPI docs (interactive or CI mode)
tejas docs:on-push # Auto-generate docs when pushing to production branchGenerate and serve interactive API docs:
npx tejas generate:docsapp.serveDocs({ specPath: './openapi.json' });
app.takeoff();
// Visit http://localhost:1403/docsDocs are disabled in production by default. Set DOCS_PASSWORD to enable protected access:
DOCS_PASSWORD=my-secretFor comprehensive documentation, see the docs folder or visit tejas-documentation.vercel.app.
- Getting Started — Installation and quick start
- Configuration — All configuration options
- Routing — Target-based routing system
- Ammo — Request/response handling
- Middleware — Global, target, and route middleware
- Error Handling — Zero-config error handling
- Rate Limiting — API protection
- File Uploads — File handling
- CLI Reference — Command-line interface
- Auto-Documentation — OpenAPI generation
- API Reference — Complete API docs
Contributions are welcome! Please feel free to submit a Pull Request.
ISC © Hirak Chhatbar