post.js Documentation

Learn how to build real-time applications with post.js. This framework combines blazing-fast performance with zero-config server-side rendering and first-class TypeScript support.

Quick Example


// app/page.tsx
import { Post } from 'post.js'

export default function Home() {
  return (
    
      

Hello, world!

) }

Framework Overview

Zero-Config Framework

Just install via npm create post and start building. No webpack, no Babel, just works.

📡

Real-Time Ready

Built-in WebSocket support for real-time updates with zero boilerplate code.

🧱

Modern Stack

Ships with WebAssembly optimizations, native TypeScript support, and modern tooling.

Core Principles

Optimized for Lighthouse performance scores (95+)
Built-in Edge Caching via Vercel integration
Auto-generated API endpoints for CRUD operations
Server-Side Rendering with automatic pre-rendering
Optimistic UI updates with automatic conflict resolution
Privacy-first design - no data collected by default
150k lines of code with 3.5x fewer dependencies than React
Intelligent client-side rendering for progressive Web Apps
Production-ready deployment with zero config

Getting Started

Install

npm create post@latest

Follow the interactive setup wizard to create your first post.js project.

Project Structure

├── app/
│   ├── layouts/
│   ├── routes/
│   └── components/
├── post.config.js
└── package.json

post.js uses a convention-over-configuration approach.

Run Locally

npm run dev

The dev server starts instantly with hot module reloading.

Development Mode

Fast rebuild times with incremental bundling

Running...

Press Ctrl+C to stop

Production Build

Optimized for edge deployments

npm run build

Deploy

Zero-config Vercel deployment

npm run deploy

API Reference

post.js Core API

Post.Hero()

Creates a responsive hero component with gradient background

Post.Router()

Automatic client-side routing with HTML5 history API

Post.Store()

Reactive state management with built-in persistence

Post.WS()

WebSocket handler with automatic reconnection

Post.Ssr()

Server-side rendering with streaming responses

Usage Example


import { Post } from 'post.js'

export default function Counter() {
  const { count, increment } = Post.Store({ count: 0 })

  return (
    <div className="text-center">
      <h2>Count: {count}</h2>
      <button 
        onClick={() => increment('count', 1)}
        className="bg-blue-500 hover:bg-blue-600 px-4 py-2 rounded"
      >
        Increment
      </button>
    </div>
  )
}

The Store API provides reactive variable management that automatically updates connected components.

Command Line Interface

post

npm install -g post

create

Create new post.js project

add

Add feature to existing project

doctor

Run project integrity check

format

Format codebase with Prettier

Interactive Wizard

$ npx post create ? Project name: my-project ? Select framework: post ? Add typescript? Yes ? Add WebSocket support? Yes ? Add analytics? No ✅ Created project at: /my-project ✅ Installed dependencies ✅ Created git repository To start: $ cd my-project $ npm run dev

The CLI wizard handles most common configuration tasks automatically.

The post.js Ecosystem

All the tools you need for building modern applications are included or integrated directly with post.js

Authentication

Built-in authentication system with OAuth2, session management, and rate-limited login attempts

Analytics

Built-in analytics dashboard with real-time session tracking and user activity monitoring

CLI

Full featured command line interface with interactive wizard and code generation

Frequently Asked Questions

Get answers to common questions about the framework

Is post.js a