
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socketโs new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
create-xianfires
Advanced tools
Engineered by Christian I. Cabrera โ Instructor I, College of Computer Studies
Lightweight JS Framework for Events-Driven & Integrative Programming 2
XianFire is a minimal, Lightweight JS Framework for rapidly scaffolding full-stack web applications with built-in authentication, database integration (MySQL or MongoDB), Electron desktop app support, and dynamic code generation.
Designed for fast prototyping, student projects, desktop applications, and small-to-medium applications โ especially for Events-Driven Programming and Integrative Programming 2 at Mindoro State University.
โ
Express.js server with session-based auth
โ
MySQL (Sequelize) or MongoDB (Mongoose) support
โ
Electron desktop app integration
โ
Auto-generated CRUD templates
โ
CLI generator for models & controllers (create:model
, create:controller
)
โ
Built-in migration system
โ
.xian
custom template engine
โ
Tailwind CSS ready
โ
Zero-config setup
โ
Cross-platform desktop builds
npm create xianfires@latest myApp
You'll be prompted to choose:
Default Template
or With CRUD Functions
MongoDB
or MySQL
๐ก If you don't specify a name, it defaults to
xianfire-app
.
cd myApp
npm install
npm run migrate
โ Creates database (MySQL) or collections (MongoDB) + syncs models.
npm run xian
๐ Web app runs at โ http://localhost:3000
# Development mode (server + Electron)
npm run xian-dev
# Production build
npm run xianca
myApp/
โโ controllers/
โ โโ authController.js # Login/Register/Dashboard logic (if CRUD)
โ โโ homeController.js # Home page handler
โ โโ *.js # Your generated controllers
โโ models/
โ โโ db.js # Sequelize connection (MySQL only)
โ โโ userModel.js # Default User model
โ โโ *.js # Your generated models
โโ routes/
โ โโ index.js # Main route definitions
โโ views/
โ โโ home.xian
โ โโ login.xian # If CRUD template chosen
โ โโ register.xian
โ โโ dashboard.xian
โ โโ *.xian # Your custom views
โโ public/
โ โโ tailwind.css # Pre-configured Tailwind
โโ electron/ ๐ Electron desktop app files
โ โโ main.js # Electron main process
โโ create.js # CLI generator for models & controllers
โโ migrate.js # Database initializer
โโ index.js # Server entry point
โโ package.json
โโ node_modules/
.xian
Template EngineRender views with res.render("filename")
โ no complex templating needed.
Example: views/home.xian
<!DOCTYPE html>
<html>
<head>
<title>Home</title>
<link href="/tailwind.css" rel="stylesheet">
</head>
<body class="bg-gray-50">
<h1 class="text-3xl font-bold text-center mt-10">Welcome to XianFire ๐ฅ</h1>
<p class="text-center mt-4">Home Page</p>
</body>
</html>
Route | Method | Description |
---|---|---|
/ | GET | Home page |
/login | GET | Render login form |
/login | POST | Authenticate user |
/register | GET | Render registration form |
/register | POST | Create new user |
/dashboard | GET | Protected dashboard (session) |
/logout | GET | Destroy session & redirect |
/forgot-password | GET | Forgot password page (stub) |
models/db.js
sequelize.define()
migrate.js
mongoose.Schema
XianFire includes seamless Electron integration:
Electron Features:
After project setup, generate models and controllers dynamically:
npm run create:model Product
โ Creates models/Product.js
:
import { DataTypes } from "sequelize";
import { sequelize } from "./db.js";
export const Product = sequelize.define("Product", {
name: { type: DataTypes.STRING, allowNull: false },
email: { type: DataTypes.STRING, allowNull: false },
password: { type: DataTypes.STRING, allowNull: false }
});
export { sequelize };
โ Fields are customizable โ edit after generation.
npm run create:controller productController
โ Creates controllers/productController.js
with full CRUD:
import { Product } from "../models/Product.js";
export const getAllProducts = async (req, res) => { ... };
export const createProduct = async (req, res) => { ... };
export const getProductById = async (req, res) => { ... };
export const updateProduct = async (req, res) => { ... };
export const deleteProduct = async (req, res) => { ... };
โ Auto-imports matching model. Uses PascalCase โ camelCase conversion.
import { User } from './models/userModel.js';
import bcrypt from 'bcrypt';
const hashed = await bcrypt.hash('mypassword', 10);
await User.create({
name: "Jane Doe",
email: "jane@example.com",
password: hashed
});
import bcrypt from "bcrypt";
import { User } from "./models/userModel.js";
const user = await User.findOne({ where: { email: "jane@example.com" } });
if (user && await bcrypt.compare("mypassword", user.password)) {
console.log("โ
Login successful!");
} else {
console.log("โ Invalid credentials");
}
In routes/index.js
:
import { getAllProducts } from "../controllers/productController.js";
// Add after existing routes
router.get("/api/products", getAllProducts);
Then visit โ http://localhost:3000/api/products
If you chose Electron during setup:
# Development mode (auto-reload)
npm run xian-dev
# Production mode
npm run xianca
# Build distributable packages
npm run dist
โ Creates executable files in dist/
folder for all platforms
Run anytime to ensure DB structure is synced:
npm run migrate
sync({ force: true })
)โ ๏ธ Warning: MySQL migration wipes existing data. Use
sync()
withoutforce
in production.
models/db.js
)import { Sequelize } from "sequelize";
export const sequelize = new Sequelize("myApp", "root", "your_password_here", {
host: "localhost",
dialect: "mysql",
});
๐ Update username/password as needed.
migrate.js
)const DB_URI = `mongodb://127.0.0.1:27017/myApp`;
๐ Change host/port if MongoDB runs elsewhere.
package.json
)The Electron build is pre-configured with:
com.xianfire.app
dist/
Command | Description |
---|---|
npm run xian | Start server with auto-reload (nodemon) |
npm start | Start server (production) |
npm run migrate | Initialize/sync database |
npm run create:model <Name> | Generate Sequelize model |
npm run create:controller <nameController> | Generate Express controller |
npm run xian-dev | ๐ Run Electron app in development |
npm run xianca | ๐ Run Electron app (production) |
npm run dist | ๐ Build distributable packages |
You can easily extend the framework:
models/YourModel.js
controllers/yourController.js
routes/index.js
views/yourpage.xian
public/
folderelectron/main.js
for native featuresnpm run migrate
.secret
in index.js
for production.npm run dist
to create installers for Windows, macOS, and Linuxnpm create xianfires@latest myProject
npm run migrate
โ npm run xian
http://localhost:3000
โ Register a usernpm run create:model Book
โ npm run create:controller bookController
npm run xian-dev
npm run dist
โ You're now ready to build blazing-fast web AND desktop apps with XianFire!
To enable HTML syntax highlighting for .xian
template files in Visual Studio Code, add this configuration to your VS Code settings.json
:
Ctrl + ,
(Windows/Linux) or Cmd + ,
(Mac) to open Settings{}
)settings.json
:{
"files.associations": {
"*.xian": "html"
}
}
โ
Now all .xian
files will be highlighted as HTML โ including autocomplete, formatting, and error detection!
Before (No association) | After (HTML highlighting) |
---|---|
Plain text, no colors | โ Syntax-highlighted HTML |
No tag autocomplete | โ
<div> , class= , etc. work |
Hard to read | โ Easy to develop templates |
"Simplicity is the ultimate sophistication." โ Designed for Mindoro State University students to learn, build, and ship without boilerplate headaches.
Now with desktop app superpowers! ๐
Happy coding!
FAQs
Simple JS Framework for Events Driven Programming
The npm package create-xianfires receives a total of 1,449 weekly downloads. As such, create-xianfires popularity was classified as popular.
We found that create-xianfires demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.ย It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socketโs new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.