metarhia/impress
حول
⚡ خادم تطبيقات مؤسسي لـ Node.js وسحابة Metarhia الخاصة
الأنظمة والبنية التحتيةما يمكنك فعله
- API auto-routing calls to endpoint for rapid API development (no need to add routes manually)
- API concurrency: request execution timeout and execution queue with both timeout and size limitations
- Schemas for API contract, data structures validation, and domain models
- Application server supports different API styles: RPC over AJAX and over Websocket, REST, and web hooks
النمو المقاس للنجوم
- خلال 24 ساعة
- ٠
- خلال 7 أيام
- ٠
- خلال 15 يومًا
- ٠
- خلال شهر
- جارٍ جمع السجل
تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.
README.md
الأصلEnterprise application server for Node.js: secure, lightweight, interactive, and scalable.
Description
First Node.js server scaled with multithreading and extra thin workload isolation. Optimized for high-intensive data exchange, rapid development, and clean architecture. Provides everything you need out of the box for reliable and efficient backend, network communication with web and mobile clients, protocol-agnostic API, run-time type validation, real-time and in-memory data processing, and reliable stateful services.
Weak sides: not a good choice for content publishing including blogs and online stores, server-side rendering, serving static content and stateless services.
Strong sides: security and architecture for enterprise-level applications, long-lived connections over websocket to minimize overhead for cryptographic handshake, no third-party dependencies.
Quick start
- See project template: metarhia/Example
- Start server with
node server.js - See documentation and specifications
API endpoint example: application/api/example.1/citiesByCountry.js
async ({ countryId }) => {
const fields = ['cityId', 'name'];
const where = { countryId };
const data = await db.select('City', fields, where);
return { result: 'success', data };
};
You can call it from client-side:
const res = await metacom.api.example.citiesByCountry({ countryId: 3 });
Metarhia and impress application server way
- Applied code needs to be simple and secure, so we use sandboxing with v8 isolated contexts, worker threads and javascript closures;
- Domain code should be separated from system code; so we use DDD, layered (onion) architecture, DI, SOLID and GRASP principles, contract-based approach;
- Impress supports stateful applications with RPC and client-session sticky to servers; microservices, centralized or distributed architecture;
- No I/O is faster even than async I/O, so we hold state in memory, share it among multiple threads and use lazy I/O for persistent storage;
- We use just internal trusted dependencies, no third-party npm packages; total Metarhia technology stack size is less than 2mb.
Features
- API auto-routing calls to
endpointfor rapid API development (no need to add routes manually) - API concurrency: request execution timeout and execution queue with both timeout and size limitations
- Schemas for API contract, data structures validation, and domain models
- Application server supports different API styles: RPC over AJAX and over Websocket, REST, and web hooks
- Multiple protocols support: HTTP, HTTPS, WS, WSS
- Auto loader with
starthooks, namespace generation for code and dependencies - Live reload of code through filesystem watch
- Graceful shutdown with
stophooks - Minimal dependencies and reduced code size
- Layered architecture: api, domain logic, data access layer, and system code layer (hidden)
- Code sandboxing for enhanced security and execution context isolation
- Code protection: reference pollution prevention, prototype pollution prevention
- Multi-threading for CPU utilization and execution isolation
- Load balancing for simple scaling with redirection to multiple ports
- Caching: in-memory caching for APIs and static files
- Configuration: environment-specific application settings
- Database access layer compatible with PostgreSQL with SQL-injection protection
- Persistent sessions with authentication, groups, and anonymous sessions
- Buffered logging (lazy write) with log rotation (keep logs N days) and console interface
- Testing: integrated node.js native test runner and table-test support
- Inter-process communication and shared memory used for state management
- File utilities: upload, download, support for partial content and streaming
- Task Management: scheduled task execution at specific intervals or certain times
Configuration
Application settings are files in application/config: network.js,
lifecycle.js, scheduler.js, workers.js, and server.js.
server.js holds server groups. Each ports entry is one thread, and an
entry may be an array of ports. protocols are ALPN ids. http/1.1 and h2
come from metacom. Other protocols come from a dependency metarhia.protocols
field. balance and redirect are group fields.
Threads
Every thread talks to the main thread over its own metacom link: a
MetacomPeer on a MessagePort, where packets travel as objects. The main
thread serves thread (start and test exit), planner (scheduler tasks),
and pool (application.invoke, routed to a pool worker and released when
the call settles); threads serve thread/stop and, with application code,
pool/run. A thread/ready event tells threads that all of them started.
TODO list
Those features will be implemented in nearest future (3-6 months):
- Server health monitoring
- Database migrations
- State synchronization mechanism with transactions and subscription
- Multi-tenancy support
Requirements
- Node.js v18.15 (up to v24.x)
- Linux (tested on Fedora v36-42, Ubuntu v20-25, CentOS v8-9, RHEL v8-10)
- PostgreSQL v12-17 (recommended v15+)
- OpenSSL v3.0+ (optional, for https & wss)
- certbot (recommended but optional)
License & Contributors
Copyright (c) 2012-2025 Metarhia contributors. See github for full contributors list. Impress Application Server is MIT licensed. Project coordinator: <[email protected]>
استكشف مشاريع مشابهة ومرتبطة
جارٍ التحميل…
