@seip/bluebird-js 0.0.0-stage → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env_example +54 -0
- package/AGENTS.md +403 -0
- package/LICENSE +21 -0
- package/README.md +284 -2
- package/app/routes/api.js +50 -0
- package/app/routes/web.js +53 -0
- package/app/views/about.html +161 -0
- package/app/views/dashboard.html +140 -0
- package/app/views/index.html +150 -0
- package/app/views/login.html +144 -0
- package/core/app.d.ts +18 -0
- package/core/app.js +644 -0
- package/core/auth.d.ts +13 -0
- package/core/auth.js +326 -0
- package/core/cache.d.ts +17 -0
- package/core/cache.js +475 -0
- package/core/cli/doctor.js +287 -0
- package/core/cli/ecosystem.js +162 -0
- package/core/cli/init.js +779 -0
- package/core/cli/migrate.js +541 -0
- package/core/cli/model.js +66 -0
- package/core/cli/nginx.js +199 -0
- package/core/cli/route.js +121 -0
- package/core/cli/swagger.js +45 -0
- package/core/cli/view.js +77 -0
- package/core/config.d.ts +3 -0
- package/core/config.js +111 -0
- package/core/csrf.d.ts +3 -0
- package/core/csrf.js +114 -0
- package/core/database.d.ts +15 -0
- package/core/database.js +636 -0
- package/core/debug.d.ts +3 -0
- package/core/debug.js +250 -0
- package/core/hash.d.ts +3 -0
- package/core/hash.js +194 -0
- package/core/index.d.ts +1071 -0
- package/core/logger.d.ts +3 -0
- package/core/logger.js +124 -0
- package/core/middleware.d.ts +3 -0
- package/core/middleware.js +28 -0
- package/core/model.d.ts +19 -0
- package/core/model.js +600 -0
- package/core/queue.d.ts +13 -0
- package/core/queue.js +172 -0
- package/core/ratelimit.d.ts +3 -0
- package/core/ratelimit.js +145 -0
- package/core/redis.d.ts +21 -0
- package/core/redis.js +230 -0
- package/core/render.d.ts +3 -0
- package/core/render.js +676 -0
- package/core/router.d.ts +3 -0
- package/core/router.js +171 -0
- package/core/seo.d.ts +3 -0
- package/core/seo.js +106 -0
- package/core/swagger.d.ts +3 -0
- package/core/swagger.js +60 -0
- package/core/upload.d.ts +13 -0
- package/core/upload.js +102 -0
- package/core/util/colors.js +82 -0
- package/core/validate.d.ts +15 -0
- package/core/validate.js +364 -0
- package/core/vite.d.ts +3 -0
- package/core/vite.js +145 -0
- package/core/ws.d.ts +13 -0
- package/core/ws.js +245 -0
- package/index.js +18 -0
- package/jsconfig.json +15 -0
- package/package.json +84 -3
- package/production.md +273 -0
- package/public/css/bluebird.min.css +2 -0
- package/public/images/favicon.ico +0 -0
- package/public/js/bluebird-client.js +1663 -0
- package/public/js/bluebird.min.js +1073 -0
package/README.md
CHANGED
|
@@ -1,3 +1,285 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Bluebird.js Framework
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Performance-first Node.js API and web framework with native JavaScript ESM, built-in JWT auth, HTML rendering, BaseModel, schema validation, and multi-level caching.**
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@seip/bluebird-js)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://nodejs.org)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Introduction
|
|
12
|
+
|
|
13
|
+
Bluebird.js (`@seip/bluebird-js`) is a high-performance web and API framework built on Express (Node.js 22.18+). It provides native modern JavaScript ESM execution, HTML template rendering, multi-driver caching (in-memory by default with filesystem and Redis support), AES-256-GCM encrypted JWT authentication, BaseModel schema definitions, CSRF protection, background queues, and PM2 production clustering into a cohesive developer experience.
|
|
14
|
+
|
|
15
|
+
### Key Highlights
|
|
16
|
+
|
|
17
|
+
- **Pure Modern JavaScript (ESM):** Zero build steps, zero transpilation, pure Node.js 22.18+ ESM.
|
|
18
|
+
- **Root Entrypoint (`index.js`):** Clean and intuitive architecture with the entry file directly at the root.
|
|
19
|
+
- **Server Layouts, Partials & React Islands:** Fast SSR HTML with L0 in-memory template caching, shared layouts (`{{!< main}}`), reusable server partials with props (`{{> card title="Users"}}`), loops/conditionals, selective React Islands via Vite, View Transitions SPA navigation, and uninterrupted audio/video streaming (`data-persist="true"`).
|
|
20
|
+
- **Lightweight BaseModel:** Static facade providing readable schemas, CRUD shortcuts, smart relations, soft deletes, automatic query cache invalidation, and validation bridges.
|
|
21
|
+
- **Native SQLite & Desktop Mode (Electron/Tauri):** Uses Node's built-in `node:sqlite` driver with zero compilation overhead, plus first-class `desktop: true` mode (`app.runDesktop()`) for read-only `.asar` bundles.
|
|
22
|
+
- **Decoupled Caching:** High-speed in-memory LRU cache by default, persistent filesystem fallback, and modular Redis support via `core/redis.js`.
|
|
23
|
+
- **CSRF, Rate Limiting & Security:** Native HMAC-SHA256 signed CSRF protection, built-in Rate Limiter (`rateLimit` in `App` or `App.rateLimit()`), automatic `/sitemap.xml` & `/robots.txt` generation, and secure HTTP headers without external bloat.
|
|
24
|
+
- **Production Ready:** Built-in PM2 clustering CLI (`npx bluebird-js make:ecosystem`), optimized Nginx generator (`npx bluebird-js nginx:conf`), and native runner (`npm start`).
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
|
|
30
|
+
### 1. Requirements
|
|
31
|
+
|
|
32
|
+
- Node.js 22.18.0 or higher
|
|
33
|
+
- npm 10+
|
|
34
|
+
|
|
35
|
+
### 2. Installation and Initialization
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm install @seip/bluebird-js
|
|
39
|
+
npx bluebird-js
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
The interactive CLI configures:
|
|
43
|
+
- Project title and port settings
|
|
44
|
+
- Database engine: `sqlite` (default, native zero-configuration), `mysql`, `postgres`, or `none`
|
|
45
|
+
- Connection credentials and database paths
|
|
46
|
+
- Automatic generation of `index.js`, `.env`, `jsconfig.json`, `app/`, and `public/`
|
|
47
|
+
|
|
48
|
+
### 3. Development Server
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npm run dev
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
The server starts with Node's native file watcher (`--watch`) and loads `.env` automatically via `--env-file=.env`.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Project Structure
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
project/
|
|
62
|
+
├── index.js # Main application entrypoint
|
|
63
|
+
├── app/
|
|
64
|
+
│ ├── models/ # BaseModel definitions
|
|
65
|
+
│ │ ├── user.js # User model schema & methods
|
|
66
|
+
│ │ └── post.js # Post model schema & relations
|
|
67
|
+
│ ├── routes/ # Application routes
|
|
68
|
+
│ │ ├── api.js # REST API routes
|
|
69
|
+
│ │ └── web.js # HTML page routes
|
|
70
|
+
│ ├── views/ # HTML and EJS templates
|
|
71
|
+
│ │ ├── layouts/ # Shared page layouts (e.g. main.html)
|
|
72
|
+
│ │ ├── partials/ # Reusable server partials/components
|
|
73
|
+
│ │ ├── index.html # Public home view
|
|
74
|
+
│ │ └── about.html # About page view
|
|
75
|
+
│ └── jobs/ # Background worker job handlers
|
|
76
|
+
├── src/ # Frontend source (React Islands)
|
|
77
|
+
│ └── islands/ # Interactive React island components
|
|
78
|
+
├── public/ # Public static assets (CSS, JS, images, fonts)
|
|
79
|
+
│ ├── css/
|
|
80
|
+
│ ├── js/
|
|
81
|
+
│ │ └── bluebird-client.js # View Transitions, partial swaps & islands runtime
|
|
82
|
+
│ └── dist/ # Production Vite hashed bundles
|
|
83
|
+
├── core/ # Bluebird.js framework core
|
|
84
|
+
├── database/ # SQLite storage and SQL migrations
|
|
85
|
+
│ └── migrations/
|
|
86
|
+
├── ecosystem.config.cjs # PM2 cluster configuration (production)
|
|
87
|
+
├── production.md # Production deployment guide
|
|
88
|
+
├── .env # Environment variables
|
|
89
|
+
└── package.json
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Usage Examples
|
|
95
|
+
|
|
96
|
+
### 1. Application Entrypoint (`index.js`)
|
|
97
|
+
|
|
98
|
+
```javascript
|
|
99
|
+
import App from "@seip/bluebird-js/core/app.js";
|
|
100
|
+
import routerApi from "./app/routes/api.js";
|
|
101
|
+
import routerWeb from "./app/routes/web.js";
|
|
102
|
+
|
|
103
|
+
const app = new App({
|
|
104
|
+
routes: [routerWeb, routerApi],
|
|
105
|
+
port: process.env.PORT || 3000,
|
|
106
|
+
rateLimit: { max: 120, windowMs: 60000 },
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
app.run();
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
For **Electron / Desktop** applications:
|
|
113
|
+
|
|
114
|
+
```javascript
|
|
115
|
+
const app = new App({
|
|
116
|
+
desktop: true,
|
|
117
|
+
userDataPath: electronApp.getPath("userData"),
|
|
118
|
+
routes: [routerWeb, routerApi],
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
const { url } = await app.runDesktop();
|
|
122
|
+
mainWindow.loadURL(url);
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### 2. Defining a Model (`app/models/user.js`)
|
|
126
|
+
|
|
127
|
+
```javascript
|
|
128
|
+
import Model from "@seip/bluebird-js/core/model.js";
|
|
129
|
+
|
|
130
|
+
export default class User extends Model {
|
|
131
|
+
static table = "users";
|
|
132
|
+
static primaryKey = "id";
|
|
133
|
+
static timestamps = true;
|
|
134
|
+
static softDelete = true;
|
|
135
|
+
|
|
136
|
+
static schema = {
|
|
137
|
+
id: { type: "int", primary: true, auto: true },
|
|
138
|
+
name: { type: "string", length: 150, required: true },
|
|
139
|
+
email: { type: "string", length: 150, unique: true, required: true, email: true },
|
|
140
|
+
password: { type: "string", length: 255, required: true, min: 8, hidden: true, hash: true },
|
|
141
|
+
role: { type: "string", length: 20, default: "user", in: ["user", "admin"] },
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### 3. REST API Routes (`app/routes/api.js`)
|
|
147
|
+
|
|
148
|
+
```javascript
|
|
149
|
+
import App from "@seip/bluebird-js/core/app.js";
|
|
150
|
+
import Router from "@seip/bluebird-js/core/router.js";
|
|
151
|
+
import User from "../models/user.js";
|
|
152
|
+
|
|
153
|
+
const routerApi = new Router("/api");
|
|
154
|
+
|
|
155
|
+
routerApi.get("/users", async (req, res) => {
|
|
156
|
+
const users = await User.all({ limit: 50, order: "id DESC" });
|
|
157
|
+
res.ok({ users });
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
routerApi.post(
|
|
161
|
+
"/users",
|
|
162
|
+
App.rateLimit({ max: 10, windowMs: 60000 }),
|
|
163
|
+
User.validator("create").middleware(),
|
|
164
|
+
async (req, res) => {
|
|
165
|
+
const userId = await User.create(req.body);
|
|
166
|
+
res.created({ id: userId }, "User created successfully");
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
export default routerApi;
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### 4. HTML Views, Layouts & Server Partials (`app/routes/web.js`)
|
|
174
|
+
|
|
175
|
+
When `{ seo: true }` is enabled on a router, Bluebird automatically generates `/sitemap.xml` and `/robots.txt`:
|
|
176
|
+
|
|
177
|
+
```javascript
|
|
178
|
+
import Router from "@seip/bluebird-js/core/router.js";
|
|
179
|
+
import Render from "@seip/bluebird-js/core/render.js";
|
|
180
|
+
|
|
181
|
+
const routerWeb = new Router("/", { seo: true });
|
|
182
|
+
|
|
183
|
+
routerWeb.get("/", Render.view("index", { title: "Bluebird Application" }));
|
|
184
|
+
routerWeb.get("/stats-card", (req, res) => {
|
|
185
|
+
return Render.partial(res, "stat_card", { label: "Revenue", val: "$12,400", active: true });
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
export default routerWeb;
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Inside your views (`app/views/dashboard.html`), use layouts (`{{!< main}}`), partials with props (`{{> name ...}}`), loops (`{{#each}}`), and conditionals (`{{#if}}`):
|
|
192
|
+
|
|
193
|
+
```html
|
|
194
|
+
{{!< main }}
|
|
195
|
+
<section class="stats-grid">
|
|
196
|
+
{{> stat_card label="Revenue" val=stats.revenue active=true }}
|
|
197
|
+
<ul>
|
|
198
|
+
{{#each items as item}}
|
|
199
|
+
<li>{{ item_index }}: {{ item.name }}</li>
|
|
200
|
+
{{/each}}
|
|
201
|
+
</ul>
|
|
202
|
+
</section>
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### 5. Multi-Driver Caching (`core/cache.js`)
|
|
206
|
+
|
|
207
|
+
```javascript
|
|
208
|
+
import Cache from "@seip/bluebird-js/core/cache.js";
|
|
209
|
+
|
|
210
|
+
await Cache.set("metrics", { activeUsers: 450 }, 60, { driver: "memory" });
|
|
211
|
+
const metrics = await Cache.get("metrics", { driver: "memory" });
|
|
212
|
+
|
|
213
|
+
await Cache.set("report", htmlContent, 300, { driver: "file" });
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### 6. React Islands & Client Router (`src/islands/`)
|
|
217
|
+
|
|
218
|
+
Combine server-side rendered dynamic SEO with interactive React components and instant View Transitions SPA navigation:
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
# 1. Install React and Vite island tooling
|
|
222
|
+
npx bluebird-js add react-islands
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Inside your HTML template (`app/views/index.html`):
|
|
226
|
+
```html
|
|
227
|
+
<!DOCTYPE html>
|
|
228
|
+
<html lang="en">
|
|
229
|
+
<head>
|
|
230
|
+
<meta charset="UTF-8" />
|
|
231
|
+
<title>{{title}}</title>
|
|
232
|
+
<meta name="description" content="{{description}}" />
|
|
233
|
+
{{{bluebirdHead}}}
|
|
234
|
+
<script type="module" src="/js/bluebird-client.js"></script>
|
|
235
|
+
</head>
|
|
236
|
+
<body>
|
|
237
|
+
<!-- Persistent live media stream or state across page navigation -->
|
|
238
|
+
<div data-island="RadioPlayer" data-props='{"stream":"https://live.mp3"}' data-persist="true"></div>
|
|
239
|
+
|
|
240
|
+
<!-- Interactive component -->
|
|
241
|
+
<div data-island="LiveCounter" data-props='{"initial": 0}'></div>
|
|
242
|
+
|
|
243
|
+
<!-- Partial fragment swap without reloading full page -->
|
|
244
|
+
<a href="/stats-card" data-partial-target="#stats-panel">Refresh Stats</a>
|
|
245
|
+
<div id="stats-panel"></div>
|
|
246
|
+
</body>
|
|
247
|
+
</html>
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## Production Deployment
|
|
253
|
+
|
|
254
|
+
Bluebird.js supports direct Node.js execution and PM2 process clustering out of the box:
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
npm start # Starts via Node.js
|
|
258
|
+
npx bluebird-js make:ecosystem --start # Generates ecosystem config and launches via PM2
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
For complete instructions covering PM2, systemd services, Nginx reverse proxy setup, and optional standalone Docker configurations, read the [Production Guide](production.md).
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## Developer Tooling CLI
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
npx bluebird-js doctor # Diagnostic audit and HTTP smoke tests
|
|
269
|
+
npx bluebird-js make:model <Name> # Generates BaseModel class
|
|
270
|
+
npx bluebird-js make:route <name> [--auth] # Scaffolds REST route
|
|
271
|
+
npx bluebird-js make:view <name> [--ejs] # Scaffolds HTML/EJS template
|
|
272
|
+
npx bluebird-js make:migration <name> [--model <M>] # Generates database migration
|
|
273
|
+
npx bluebird-js migrate # Executes pending migrations
|
|
274
|
+
npx bluebird-js seed # Executes database seeds
|
|
275
|
+
npx bluebird-js nginx:conf [domain] [port] [root] # Generates Nginx reverse proxy configuration
|
|
276
|
+
npx bluebird-js make:ecosystem [--start] # Generates PM2 clustering config
|
|
277
|
+
npx bluebird-js add react-islands # Scaffolds React Islands, Vite & Client Router
|
|
278
|
+
npx bluebird-js add <module> # Installs optional on-demand package
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
## License
|
|
284
|
+
|
|
285
|
+
MIT License. Copyright (c) 2026 Seip25.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import Router from "@seip/bluebird-js/core/router.js";
|
|
2
|
+
import Validator from "@seip/bluebird-js/core/validate.js";
|
|
3
|
+
import Cache from "@seip/bluebird-js/core/cache.js";
|
|
4
|
+
import Auth from "@seip/bluebird-js/core/auth.js";
|
|
5
|
+
|
|
6
|
+
const routerApi = new Router("/api");
|
|
7
|
+
|
|
8
|
+
routerApi.get("/", (req, res) => {
|
|
9
|
+
res.json({ api: true, message: "Blue Bird API", time: Date.now() });
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
routerApi.get("/users", (req, res) => {
|
|
13
|
+
const users = [
|
|
14
|
+
{ name: "John Doe", email: "john.doe@example.com" },
|
|
15
|
+
{ name: "Jane Doe", email: "jane.doe@example.com" },
|
|
16
|
+
];
|
|
17
|
+
res.json(users);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const loginSchema = {
|
|
21
|
+
email: { required: true, email: true },
|
|
22
|
+
password: { required: true, min: 6 },
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const loginValidator = new Validator(loginSchema, "en");
|
|
26
|
+
|
|
27
|
+
routerApi.post("/login", loginValidator.middleware(), (req, res) => {
|
|
28
|
+
res.json({ message: "Login successful", body: req.body });
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
routerApi.get("/cache", Cache.middleware(60), async (req, res) => {
|
|
32
|
+
await new Promise((resolve) => setTimeout(resolve, 2000));
|
|
33
|
+
res.json({ message: "Cache successful" });
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
routerApi.get("/auth_generate", async (req, res) => {
|
|
37
|
+
const token = await Auth.login(res, { id: 1, name: "John Doe" }, "auth");
|
|
38
|
+
res.json({ message: "Auth successful", token });
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
routerApi.get("/auth_logout", async (req, res) => {
|
|
42
|
+
await Auth.logout(res, "auth", {}, req);
|
|
43
|
+
res.json({ message: "Logged out" });
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
routerApi.get("/auth_verify", Auth.protect(), (req, res) => {
|
|
47
|
+
res.json({ message: "Auth successful", user: req.user });
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export default routerApi;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import Router from "@seip/bluebird-js/core/router.js";
|
|
2
|
+
import Render from "@seip/bluebird-js/core/render.js";
|
|
3
|
+
import Auth from "@seip/bluebird-js/core/auth.js";
|
|
4
|
+
|
|
5
|
+
const routerWeb = new Router("/", { seo: true });
|
|
6
|
+
|
|
7
|
+
routerWeb.get("/", Render.cache(300), Render.view("index"));
|
|
8
|
+
|
|
9
|
+
routerWeb.get("/about", Render.cache(300), Render.view("about"));
|
|
10
|
+
|
|
11
|
+
routerWeb.get("/login", Render.view("login"));
|
|
12
|
+
|
|
13
|
+
routerWeb.post("/login", async (req, res) => {
|
|
14
|
+
const email = req.body?.email || "alex@example.com";
|
|
15
|
+
const rawPrefix = email.split("@")[0] || "alex";
|
|
16
|
+
const name = req.body?.name || (rawPrefix.charAt(0).toUpperCase() + rawPrefix.slice(1));
|
|
17
|
+
|
|
18
|
+
const user = {
|
|
19
|
+
id: 1,
|
|
20
|
+
name,
|
|
21
|
+
email,
|
|
22
|
+
role: "admin",
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
await Auth.login(res, user);
|
|
26
|
+
return res.redirect("/dashboard");
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
routerWeb.get("/logout", async (req, res) => {
|
|
30
|
+
if (
|
|
31
|
+
req.headers["x-bluebird-prefetch"] ||
|
|
32
|
+
req.headers.purpose === "prefetch" ||
|
|
33
|
+
req.headers["sec-purpose"] === "prefetch"
|
|
34
|
+
) {
|
|
35
|
+
return res.status(204).end();
|
|
36
|
+
}
|
|
37
|
+
await Auth.logout(res);
|
|
38
|
+
return res.redirect("/login");
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
routerWeb.post("/logout", async (req, res) => {
|
|
42
|
+
await Auth.logout(res);
|
|
43
|
+
return res.redirect("/login");
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
routerWeb.get("/dashboard", Auth.protect({ redirect: "/login" }), async (req, res) => {
|
|
47
|
+
await Render.send(res, "dashboard", {
|
|
48
|
+
title: "Dashboard — Blue Bird",
|
|
49
|
+
user: req.user,
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export default routerWeb;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en" data-theme="dark">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
+
<title>Blue Bird - About</title>
|
|
8
|
+
<link rel="canonical" href="https://seip25.github.io/Blue-bird/" />
|
|
9
|
+
<meta name="description"
|
|
10
|
+
content="Blue Bird is a fast, structured, and opinionated Express.js framework for developers who want visual elegance and performance with raw HTML and CSS.">
|
|
11
|
+
<meta name="keywords" content="Blue Bird, Express.js, About, Semantic CSS, Architecture">
|
|
12
|
+
<meta name="author" content="Seip25">
|
|
13
|
+
<link rel="icon" href="/images/favicon.ico" />
|
|
14
|
+
<link rel="stylesheet" href="/css/bluebird.min.css" />
|
|
15
|
+
|
|
16
|
+
<script src="/js/bluebird-client.js" defer></script>
|
|
17
|
+
</head>
|
|
18
|
+
|
|
19
|
+
<body>
|
|
20
|
+
<header>
|
|
21
|
+
<nav>
|
|
22
|
+
<a href="/" class="flex items-center gap-2">
|
|
23
|
+
<svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
|
|
24
|
+
stroke-linecap="round" stroke-linejoin="round" class="text-blue">
|
|
25
|
+
<path d="M12 19l9 2-9-18-9 18 9-2zm0 0v-8" />
|
|
26
|
+
</svg>
|
|
27
|
+
<strong class="text-xl text-gradient">Blue Bird</strong>
|
|
28
|
+
</a>
|
|
29
|
+
</nav>
|
|
30
|
+
</header>
|
|
31
|
+
|
|
32
|
+
<main>
|
|
33
|
+
<aside>
|
|
34
|
+
<h4>Menu</h4>
|
|
35
|
+
<a href="/">Home</a>
|
|
36
|
+
<a href="/about" class="active badge badge-glow px-3 py-3">About</a>
|
|
37
|
+
<a href="/login">Login</a>
|
|
38
|
+
<a href="/dashboard">Dashboard</a>
|
|
39
|
+
<a href="https://seip25.github.io/Blue-bird" target="_blank">Blue bird</a>
|
|
40
|
+
<a href="https://seip25.github.io/Blue-bird-css/" target="_blank">Blue Bird CSS</a>
|
|
41
|
+
<a href="https://github.com/seip25/Blue-bird" target="_blank" role="button"
|
|
42
|
+
class="btn-sm outline">GitHub</a>
|
|
43
|
+
</aside>
|
|
44
|
+
|
|
45
|
+
<div>
|
|
46
|
+
<section class="hero ">
|
|
47
|
+
<h1 class="mt-3 text-gradient font-bold">About Blue Bird</h1>
|
|
48
|
+
<p class="lead">Built for performance, simplicity, and raw speed.</p>
|
|
49
|
+
</section>
|
|
50
|
+
|
|
51
|
+
<article class="mt-6 ">
|
|
52
|
+
<header>
|
|
53
|
+
<h2 class="text-gradient-blue font-semibold">Our Philosophy</h2>
|
|
54
|
+
</header>
|
|
55
|
+
<p>
|
|
56
|
+
Blue Bird was born out of a desire for a clean, performance-first approach to web development. We
|
|
57
|
+
believe in harnessing the raw power of Express.js and Nginx, stripping away unnecessary bloat, and
|
|
58
|
+
providing developers with a robust foundation that just works.
|
|
59
|
+
</p>
|
|
60
|
+
<p>
|
|
61
|
+
By separating the static frontend delivery (handled blazingly fast by Nginx) from the dynamic API
|
|
62
|
+
layer (powered by Express and Redis), Blue Bird achieves unparalleled performance out of the box.
|
|
63
|
+
</p>
|
|
64
|
+
</article>
|
|
65
|
+
|
|
66
|
+
<div class="px-4 py-4 mb-4">
|
|
67
|
+
<h2 class="text-gradient-blue font-semibold">Why Blue Bird?</h2>
|
|
68
|
+
|
|
69
|
+
<div class="grid cols-2 gap-4">
|
|
70
|
+
<div>
|
|
71
|
+
<details open>
|
|
72
|
+
<summary>Production Ready</summary>
|
|
73
|
+
<p>Go from development to production seamlessly with PM2 clustering, systemd, and high performance multi-level caching for SQLite, MySQL, and PostgreSQL.</p>
|
|
74
|
+
</details>
|
|
75
|
+
<details open>
|
|
76
|
+
<summary>Military Grade Security</summary>
|
|
77
|
+
<p>Built-in AES-256-GCM JWT encryption, secure HttpOnly cookie
|
|
78
|
+
sessions, helmet headers, and
|
|
79
|
+
route rate limiting.</p>
|
|
80
|
+
</details>
|
|
81
|
+
</div>
|
|
82
|
+
<div>
|
|
83
|
+
<details open>
|
|
84
|
+
<summary>High Performance Layer</summary>
|
|
85
|
+
<p>Redis caching for the data layer and Nginx static delivery with
|
|
86
|
+
1-month browser asset
|
|
87
|
+
caching.</p>
|
|
88
|
+
</details>
|
|
89
|
+
<details open>
|
|
90
|
+
<summary>Pure Semantic HTML & CSS</summary>
|
|
91
|
+
<p>No bloated frontend frameworks or heavy node compile steps. Write
|
|
92
|
+
clean, accessible code
|
|
93
|
+
close to the metal.</p>
|
|
94
|
+
</details>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
|
|
98
|
+
<article class="">
|
|
99
|
+
<header>
|
|
100
|
+
<h2 class="text-gradient-blue font-semibold">Core Architecture Summary</h2>
|
|
101
|
+
</header>
|
|
102
|
+
<table class="table table-hover">
|
|
103
|
+
<thead>
|
|
104
|
+
<tr>
|
|
105
|
+
<th>Layer</th>
|
|
106
|
+
<th>Technology</th>
|
|
107
|
+
<th>Role</th>
|
|
108
|
+
</tr>
|
|
109
|
+
</thead>
|
|
110
|
+
<tbody>
|
|
111
|
+
<tr>
|
|
112
|
+
<td><strong>Frontend</strong></td>
|
|
113
|
+
<td>Pure Semantic HTML5 + <a href="https://seip25.github.io/Blue-bird-css/"
|
|
114
|
+
target="_blank">Blue Bird CSS</a></td>
|
|
115
|
+
<td>Static rendering served directly via Nginx</td>
|
|
116
|
+
</tr>
|
|
117
|
+
<tr>
|
|
118
|
+
<td><strong>Backend</strong></td>
|
|
119
|
+
<td>Node.js + Express + PM2</td>
|
|
120
|
+
<td>High-performance REST API services</td>
|
|
121
|
+
</tr>
|
|
122
|
+
<tr>
|
|
123
|
+
<td><strong>Cache</strong></td>
|
|
124
|
+
<td>Redis / In-Memory RAM</td>
|
|
125
|
+
<td>Sub-millisecond route & query caching</td>
|
|
126
|
+
</tr>
|
|
127
|
+
<tr>
|
|
128
|
+
<td><strong>Database</strong></td>
|
|
129
|
+
<td>SQLite (WAL) / PostgreSQL / MySQL</td>
|
|
130
|
+
<td>Unified driver with connection pooling</td>
|
|
131
|
+
</tr>
|
|
132
|
+
</tbody>
|
|
133
|
+
</table>
|
|
134
|
+
</article>
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
</main>
|
|
140
|
+
|
|
141
|
+
<footer>
|
|
142
|
+
<div class="footer-content">
|
|
143
|
+
<p>Powered by <strong class="text-gradient">Blue Bird Framework</strong> &
|
|
144
|
+
<strong class="text-gradient-blue">
|
|
145
|
+
<a href="https://seip25.github.io/Blue-bird-css/" target="_blank">Blue Bird
|
|
146
|
+
CSS</a>
|
|
147
|
+
</strong>.
|
|
148
|
+
</p>
|
|
149
|
+
<div class="lang-switcher">
|
|
150
|
+
<a href="/" class="lang-link">Home</a>
|
|
151
|
+
<a href="/about" class="lang-link">About</a>
|
|
152
|
+
<a href="/login" class="lang-link">Login</a>
|
|
153
|
+
<a href="/dashboard" class="lang-link">Dashboard</a>
|
|
154
|
+
<a href="https://github.com/seip25/Blue-bird" target="_blank" class="github-star mt-2">★
|
|
155
|
+
GitHub</a>
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
</footer>
|
|
159
|
+
</body>
|
|
160
|
+
|
|
161
|
+
</html>
|