nodester is a Node.js framework designed to solve the problem of a complex data querying over HTTP.
The main reason of nodester's existence is the nodester Query Language (NQL) →, an extension of standard REST API syntax, it lets you craft complex queries with hierarchical associations.
Building an application which allows users to build their own REST queries raises huge security concerns. That's why nodester was not developed as a middleware. It's a framework equipped with a set of technologies enabling you to fully customize the request-response flow down to the specific user and a database column.
With NQL, a single endpoint can handle complex queries:
GET /api/v1/countries?includes=cities(limit=5&order_by=population&order=desc).areas&name=like(Bel)&fn=count(cities)This query:
- Filters countries by name containing "Bel"
- Includes cities (limited to 5, ordered by population)
- Includes areas for each city
- Counts total cities per country
All with proper security through Filters → that control what users can query.
Check out core concepts documentation → for more info.
Install with NPM
npm install -S nodesternpx degit https://github.com/MarkKhramko/nodester/examples/boilerplate my-app
cd my-app
npm i
npm run bootstrap- 🔍 Powerful Query Language (NQL): Extend REST with SQL-like querying capabilities
- 🔒 Security First: Fine-grained control over what users can query through Filters
- 🌳 Hierarchical Associations: Query nested relationships with ease
- ⚡ Built on Sequelize: Leverage the power of Sequelize ORM
- 🎯 Flexible Architecture: Controller → Facade → Model pattern for clean separation
- 🛡️ Request Validation: Automatic validation and bounds checking
- 📊 Aggregate Functions: Built-in support for count, avg, and more
- 🔧 Extensible: Easy to extend and customize for your needs
const nodester = require('nodester');
const db = require('#db');
const app = new nodester();
app.set.database(db);
// Do any synchronous initializations
// before app.listen here
// ...
// Optional beforeStart hook:
app.beforeStart(async () => {
// Do any asynchronous initializations
// before app.listen here
// ...
});
// Start the http server:
app.listen(8080, function() {
console.log('listening on port', app.port);
});
// Gracefully shut down:
process.once('SIGTERM', () => {
app.stop(() => {
const pid = process.pid;
console.info('Process', pid, 'terminated\n');
process.exit(0);
});
});The true strength of nodester lies in its query language. Serving as an extension of standard REST API syntax, it brings many aspects of SQL into REST requests, providing developers with a simple yet powerful tool for expressive and efficient data querying.
NQL Documentation:
- Introduction → - Get started with NQL
- Syntax → - Understand query syntax and parsing
- Parameters → - Complete parameter reference
- Subqueries → - Advanced nested queries
- Operators → - Filtering operators (like, in, gt, etc.)
- Functions → - Aggregate functions (count, avg)
Nodester is built upon a powerful Sequelize.
Supported drivers:
- MySQL
- PostgreSQL
We (contributors) use JSDoc to describe the actual code.
The Philosophy of nodester is to provide a developer with a tool that can build an app (or feature) in hours and scale it with ease for years.
The goal of nodester is to be a robust and flexible framework that makes development in iterations easy, while laying the foundation for seamless scalability in the future.
Copyright 2021-present Mark Khramko