fullstx
v1.0.3
Published
A high-performance, custom backend framework with built-in hot-reload.
Readme
fullstx
A high-performance, custom backend framework with a static file frontend. Equipped with built-in browser-sync for automatic hot-reload during development.
Features
- 🚀 Radix Trie Router: O(1) routing performance for maximum speed.
- 🔄 Built-in Hot-Reloading: Seamless development with integrated
browser-sync. Proxies your app and reloads the browser when static files or server code changes. - 🛡️ Secure by Default: Helmet (security headers), CORS, XSS protection, and rate-limiting built-in.
- 🗜️ Auto-Compression: Gzip and Brotli compression out of the box.
- 🧩 Extensible: Built-in support for Sessions, SQLite, Knex, WebSockets, HTMX, and Sentry.
Quick Start
Scaffold a new Fullstx project instantly:
npm create fullstx@latest my-app
# or
npx create-fullstx@latest my-appThen run your app:
cd my-project
npm install
npm startInstallation
Or install manually in an existing project:
npm install fullstxConfiguration
Pass options when creating the Framework instance:
const Framework = require('fullstx');
const app = Framework({
// --- Development & Server ---
port: 3000, // Public port (default: 3000)
internalPort: undefined, // Override internal port manually
internalPortOffset: 1000, // Offset for internal server when liveReload is true
liveReload: true, // Enable/disable browser-sync hot-reload
staticDir: "public", // Directory for static files (default: "public")
// --- Core Middlewares ---
logger: true, // Enable HTTP request logging
cors: true, // Enable Cross-Origin Resource Sharing
helmet: true, // Enable Security Headers (Helmet)
xss: true, // Enable XSS Protection / Sanitization
compression: true, // Enable Gzip/Brotli Compression
healthCheck: true, // Enable /api/health endpoint
// --- Features ---
session: false, // Enable Sessions (requires Redis/Memory config)
htmx: true, // Enable HTMX helpers (req.htmx, res.hxRedirect, etc)
jwtSecret: process.env.JWT_SECRET || "supersecret", // Secret for JWT signing
// --- Integrations ---
db: null, // Database configuration (Knex)
ws: null, // WebSocket / Redis PubSub config
sqlite: null, // SQLite specific config
sentry: null // Sentry error tracking config
});
app.listen(3000);Example: server directly on port 3000 (without browser-sync proxy):
const app = Framework({ liveReload: false });
app.listen(3000);Troubleshooting
Port already in use — another process is using port 3000 or 4000. Stop that process, or reset the port:
const app = Framework({ internalPort: 4100 }); // force internal port app.listen(3000);File changes but browser doesn't reload — ensure the file is in the
watchlist in the Framework options.
Notes
- The framework automatically handles browser-sync internally — no need to install/configure browser-sync separately.
- Production mode: set
liveReload: falseso there is no browser-sync overhead. - Static files are served by the
serveStaticFilemiddleware inapp.js.
Testing
Internal Framework Testing
The framework's internal engine is tested using Jest to maintain stability and performance.
npm run test