Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
EkitJS - A web framework is built on the top of expressjs + mongodb native driver + socket.io, aims to reduce web development lifecycle, effective in collaboration, reusable code, dealing with business logic and support real time sync data from Database to Web Client.
A web framework is built on the top of expressjs + mongodb native driver + socket.io, aims to reduce web development lifecycle, effective in collaboration, reusable code and support real time sync data from Database to Web Client.
require('ekitjs').start(__dirname);
module.exports = {
'*': function(req, res, next){
res.render(path.join(__dirname, '..', 'static', 'view', 'index.html'), {
css: ekitjs.asset.renderTags('css'),
js: ekitjs.asset.renderTags('js')
});
},
'get://docs': function(req, res, next){
// init route for http://127.0.0.1/docs
res.render(path.join(__dirname, '..', 'static', 'view', 'docs.html'), {
css: ekitjs.asset.renderTags('css'),
js: ekitjs.asset.renderTags('js')
});
},
'post://login': function(req, res, next){
// listen post request from client at the url http://127.0.0.1/login
res.send('Login successful');
},
'put://update_something': function(req, res, next){
// update something...
res.send('Update successful');
},
'delete://delete_something': function(req, res, next){
// delete something...
res.send('Delete successful')
}
};
module.exports = {
_name: 'user'
};
ekitJS is a web framework is built on the top of orther basic NodeJS modules like: expressjs, mongo native driver, socket.io, ejs template system... So, it does not require any new coding syntax. What we are doing is re-organize the coding structure and propose the new way to help web development easier, faster and more collaborate. The most important different in ekitJS framework is the balance between the ease of use and the flexibility that the framework can support to help developer dealing with most of the application logic in an very effective way.
Business logic or application logic is the important part in most of application from online shop to product company or even large business. Some of examples are:
In most of other frameworks, the business logic often is solved in Controller. In some case, you may need to duplicate your code. So, the consistency is not 100%.
In NoSQL expecially in MongoDB, the concept is Free Style Schema. For us, free style schema does not mean that it does not need schema. For example: NoSQL allow you to define field name in many different ways:
Option 1:
{
first_name,
last_name
}
Option 2:
{
name: {
first,
last
}
}
The point is that after you chose option 1, option 2 or option x, this collection must have the same structure in all document. So, what do you think? Change your mind about what Free Style Schema mean deeply or not? You can post your comment about The Need Of Schema, even in MongoDB in Our Gooogle Group.
So, in ekitJS framework, we propose dealing with business logic in Model, rather than in Controller. All business logic can be solve in Model. 100% consistancy, effective and really simple as below:
Simple require field:
module.exports = {
_name: 'user',
_column: {
name: {
first: types.auto(),
last: types.auto(),
},
username: types.auto({
require: true
})
}
};
Simple password pre-validate:
module.exports = {
_name: 'user',
_column: {
name: {
first: types.auto(),
last: types.auto(),
},
username: types.auto({
require: true
}),
password: types.auto({
validate: function(data) {
if(data !== undefined) {
// do some password encryption here
return 'md5_' + data;
};
return data;
}
})
}
};
Simple function field:
module.exports = {
_name: 'user',
_column: {
name: {
first: types.auto(),
last: types.auto(),
full: types.func({
get: function(ids, data, callback) {
var res = {};
this.read({
_id: {
$in: ids
}
}, function(err, docs) {
_.each(docs, function(doc) {
res[doc._id] = [doc.name.first, doc.name.last].join(' ');
});
callback(res);
});
}
})
}
}
};
In the above example, the field name.full is always the combination between first name and last name. It will not be stored physically in database. It will be automatically calculated when you make a query.
Simple model trigger:
module.exports = {
_name: 'user',
_column: {
name: {
first: types.auto(),
last: types.auto()
}
},
createTrigger: function(ids){
// do some stuff here
// call parent method
this._super.apply(arguments);
},
updateTrigger: function(ids){
...
},
deleteTrigger: function(ids){
...
}
};
Checkout ekitJS API to get more example.
Checkout source code and demo at https://github.com/henrytao-me/ekitjs-sample
Website: http://ekitjs.com
Twitter: @ekitJS
Google Groups: http://groups.google.com/group/ekitjs
FAQs
EkitJS - A web framework is built on the top of expressjs + mongodb native driver + socket.io, aims to reduce web development lifecycle, effective in collaboration, reusable code, dealing with business logic and support real time sync data from Database to Web Client.
The npm package ekitjs receives a total of 1 weekly downloads. As such, ekitjs popularity was classified as not popular.
We found that ekitjs demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.