Version 0.0.5 - Beta

The JS Framework for
Modern Developers.

A powerful structure based on Express and React, designed to build fast applications with hydrated components (Islands or Full views) and everything you need pre-configured.

View Documentation
npm install @seip/blue-bird

The Blue Bird Philosophy

Tired of configuring CORS, Body Parsers, Cookies, and Routing every time you start a project? Blue Bird provides a solid, pre-configured base so you can go straight to the business logic, without losing the pure extensibility of Express.

⚡ All-In-One

Express, React (with Islands or Full views), Validations, JWT Auth, and Uploads ready to use.

💎 Flexible

Use the `.use()` method to configure Express middleware just like you always do.

Core Features

Designed to scale with elegance.

Integrated JWT Auth

Token generation and validation with middleware ready to protect your API or Web routes.

Data Validation

Multi-language validation engine with predefined rules and automatic messages.

Upload Helpers

File uploads to disk powered by Multer, configured for your public folder.

React

React, React Router pre-configured and ready to use in SPA or Islands mode o full view pages.

Vite

Vite ready to use , for dev and production.

Ex

Express

Express pre-configured and ready to use in API mode and Web mode.

Technical Reference

Everything about the Blue Bird Core API.

Init Initialize App

Initialize your Blue Bird application.

npx blue-bird

React React Setup

Setup React for your Blue Bird application.

npm run react

Dev Dev Setup (Express + Vite)

Setup Dev for your Blue Bird application.

npm run dev

Setup Vite for your Blue Bird application.

npm run vite:dev

App Main App Class

Central configuration for your Express server.

import App from "@seip/blue-bird/core/app.js";
import routerUsers from "./routes/users.js";

const app = new App({
    port: 3000,
    routes: [routerUsers],
    cors: { origin: '*' }
});

// Extend Express with .use()
app.use(myCustomMiddleware);
//Or app.set(key,value) example: app.set('view engine', 'ejs');


app.run();
Option Type Default
port Number 3001
routes Array []
logger Boolean true
cookieParser Boolean true
cors Object {}
middlewares Array []
port Number 3000
host String "http://localhost"
notFound Boolean true
json Boolean true
urlencoded Boolean true
static Object {path: null, options: {}} (public folder default)
cookieParser Boolean true

T Template & React

Render full views or hydrated react components (Islands or Full views) with a single method.

import Template from "@seip/blue-bird/core/template.js";
import router from "@seip/blue-bird/core/router.js";

const routerUsers = new Router("/")

router.get("/", (req, res) => {
    // Render the 'Home' component with initial props
    return Template.renderReact(res, "Home", { title: "My App" });
});

V Validation

import Validator from "@seip/blue-bird/core/validate.js";
import router from "@seip/blue-bird/core/router.js";

const routerUsers = new Router("/api")

const schema = {
    email: { required: true, email: true },
    password: { required: true, min: 6 }
};

const validate = new Validator(schema, 'en');

router.post("/register", validate.middleware(), (req, res) => {
    res.json({ message: "OK" });
});

Auth (JWT)

import Auth from "...";
Auth.generateToken(payload);
Auth.protect(); // Middleware

Uploads

import Upload from "...";
Upload.disk({ folder: 'img' });
// Based on Multer