Skip to content

Commit 2fefcb1

Browse files
authored
brahma-firelight added (#10232)
1 parent 8218168 commit 2fefcb1

File tree

9 files changed

+227
-0
lines changed

9 files changed

+227
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# dependencies (bun install)
2+
node_modules
3+
4+
# output
5+
out
6+
dist
7+
*.tgz
8+
9+
# code coverage
10+
coverage
11+
*.lcov
12+
13+
# logs
14+
logs
15+
_.log
16+
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
17+
18+
# dotenv environment variable files
19+
.env
20+
.env.development.local
21+
.env.test.local
22+
.env.production.local
23+
.env.local
24+
25+
# caches
26+
.eslintcache
27+
.cache
28+
*.tsbuildinfo
29+
30+
# IntelliJ based IDEs
31+
.idea
32+
33+
# Finder (MacOS) folder config
34+
.DS_Store
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
# 🗿 Brahma-JS (brahma-firelight)
3+
4+
Express-style framework ⚡ powered by Rust (Tokio + Hyper).
5+
Plug-n-play for **Node.js**, **Deno**, and **Bun** — no setup, just install and harness the true power of RUST.
6+
7+
---
8+
9+
### 🔗 Links
10+
- Repo: [github.com/Shyam20001/rsjs](https://github.com/Shyam20001/rsjs)
11+
- Site: [shyam20001.github.io/rsjs](https://shyam20001.github.io/rsjs)
12+
13+
---
14+
15+
### ⚙️ Commands
16+
```bash
17+
bun install
18+
bun run build
19+
bun start
20+
# Dev mode:
21+
bun run dev
22+
````
23+
24+
Runs on **0.0.0.0:8080** exposing `/plaintext` and `/json` endpoints.
25+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"framework": "brahma-firelight",
3+
"tests": [{
4+
"default": {
5+
"json_url": "/json",
6+
"plaintext_url": "/plaintext",
7+
"port": 8080,
8+
"approach": "Realistic",
9+
"classification": "Micro",
10+
"framework": "brahma-firelight",
11+
"language": "TypeScript",
12+
"flavor": "bun",
13+
"platform": "bun",
14+
"webserver": "None",
15+
"os": "Linux",
16+
"database_os": "Linux",
17+
"display_name": "brahma-firelight",
18+
"versus": "nodejs"
19+
}
20+
}]
21+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM oven/bun:1.3
2+
3+
WORKDIR /app
4+
5+
COPY . .
6+
7+
RUN bun install
8+
9+
RUN bun run build
10+
11+
EXPOSE 8080
12+
13+
CMD ["bun", "dist/main.js"]
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"lockfileVersion": 1,
3+
"workspaces": {
4+
"": {
5+
"name": "brahma-firelight",
6+
"dependencies": {
7+
"brahma-firelight": "1.5.16",
8+
},
9+
"devDependencies": {
10+
"@types/bun": "latest",
11+
},
12+
"peerDependencies": {
13+
"typescript": "^5",
14+
},
15+
},
16+
},
17+
"packages": {
18+
"@types/bun": ["@types/[email protected]", "", { "dependencies": { "bun-types": "1.3.1" } }, "sha512-4jNMk2/K9YJtfqwoAa28c8wK+T7nvJFOjxI4h/7sORWcypRNxBpr+TPNaCfVWq70tLCJsqoFwcf0oI0JU/fvMQ=="],
19+
20+
"@types/node": ["@types/[email protected]", "", { "dependencies": { "undici-types": "~7.16.0" } }, "sha512-uWN8YqxXxqFMX2RqGOrumsKeti4LlmIMIyV0lgut4jx7KQBcBiW6vkDtIBvHnHIquwNfJhk8v2OtmO8zXWHfPA=="],
21+
22+
"@types/react": ["@types/[email protected]", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-6mDvHUFSjyT2B2yeNx2nUgMxh9LtOWvkhIU3uePn2I2oyNymUAX1NIsdgviM4CH+JSrp2D2hsMvJOkxY+0wNRA=="],
23+
24+
"brahma-firelight": ["[email protected]", "", {}, "sha512-KwqrG3EHBcEYiOjjx7UvZ4TDxnKTP+DPjnQQqblKuHQcS/mw35NzIYf01YnBZLRM/9VZrb5+UrDaNmrAPZGYlw=="],
25+
26+
"bun-types": ["[email protected]", "", { "dependencies": { "@types/node": "*" }, "peerDependencies": { "@types/react": "^19" } }, "sha512-NMrcy7smratanWJ2mMXdpatalovtxVggkj11bScuWuiOoXTiKIu2eVS1/7qbyI/4yHedtsn175n4Sm4JcdHLXw=="],
27+
28+
"csstype": ["[email protected]", "", {}, "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="],
29+
30+
"typescript": ["[email protected]", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],
31+
32+
"undici-types": ["[email protected]", "", {}, "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw=="],
33+
}
34+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[framework]
2+
name = "brahma-firelight"
3+
4+
[main]
5+
urls.plaintext = "/plaintext"
6+
urls.json = "/json"
7+
approach = "Realistic"
8+
classification = "Micro"
9+
database_os = "Linux"
10+
database = "None"
11+
os = "Linux"
12+
orm = "Raw"
13+
platform = "bun"
14+
webserver = "None"
15+
versus = "nodejs"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "brahma-firelight",
3+
"type": "module",
4+
"main": "src/index.ts",
5+
"scripts": {
6+
"dev": "bun --hot src/main.ts",
7+
"build": "bun build src/main.ts --packages external --sourcemap --outdir dist --minify",
8+
"start": "bun dist/main.js"
9+
},
10+
"devDependencies": {
11+
"@types/bun": "latest"
12+
},
13+
"peerDependencies": {
14+
"typescript": "^5"
15+
},
16+
"dependencies": {
17+
"brahma-firelight": "1.5.16"
18+
}
19+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { createApp, type Response, type Request, type App, type NextFunction, type Handler } from "brahma-firelight";
2+
3+
const app: App = createApp();
4+
5+
// Server Config Middleware
6+
const serverInfo: Handler = (_req: Request, res: Response, next?: NextFunction) => {
7+
res.setHeader("Server", "brahma-firelight");
8+
next?.();
9+
};
10+
11+
// JSON compute
12+
app.get("/json", serverInfo, (_req: Request, res: Response) => {
13+
res.json({ message: "Hello, World!" });
14+
});
15+
16+
// PLAIN-TEXT
17+
app.get("/plaintext", serverInfo, (_req: Request, res: Response) => {
18+
res.text("Hello, World!");
19+
});
20+
21+
// Port & Host
22+
23+
app.listen("0.0.0.0", 8080);
24+
25+
// Enable built in Graceful Shutdown (optional for production use)
26+
27+
process.on('SIGINT', async () => {
28+
console.log('SIGINT → shutting down...');
29+
await app.close(2000); // wait up to 2s for requests
30+
process.exit(0);
31+
});
32+
33+
process.on('SIGTERM', async () => {
34+
console.log('SIGTERM → shutting down...');
35+
await app.close(2000);
36+
process.exit(0);
37+
});
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"compilerOptions": {
3+
// Environment setup & latest features
4+
"lib": [
5+
"ESNext"
6+
],
7+
"forceConsistentCasingInFileNames": true,
8+
"target": "ESNext",
9+
"module": "es6",
10+
"moduleDetection": "force",
11+
"jsx": "react-jsx",
12+
"allowJs": true,
13+
// Bundler mode
14+
"moduleResolution": "bundler",
15+
"allowImportingTsExtensions": true,
16+
"verbatimModuleSyntax": true,
17+
"noEmit": true,
18+
// Best practices
19+
"strict": true,
20+
"skipLibCheck": true,
21+
"noFallthroughCasesInSwitch": true,
22+
"noUncheckedIndexedAccess": true,
23+
"noImplicitOverride": true,
24+
// Some stricter flags (disabled by default)
25+
"noUnusedLocals": false,
26+
"noUnusedParameters": false,
27+
"noPropertyAccessFromIndexSignature": false
28+
}
29+
}

0 commit comments

Comments
 (0)