@kimia-framework/core
v0.10.89
Published
Kimia framework core
Downloads
19
Readme
Kimia Framework Core
Version 0.10.84 - BETA
A powerful Node.js/TypeScript framework for building scalable web servers with built-in database management, caching, plugin system, and multi-processing support.
Features
- Database Integration: Built-in support for Sequelize ORM with SQLite
- Caching System: Memory-based caching with Memcached support
- Web Server: Express.js based HTTP server with HTTPS support
- Plugin System: Extensible plugin architecture for custom functionality
- Multi-Processing: Cluster management for high-performance applications
- Storage Management: File storage with configurable drivers
- Event Handling: Comprehensive event system for application lifecycle
- Error Handling: Centralized error management with customizable handlers
- Template Engine: Twig template engine integration
- Authentication: JWT-based authentication system
- Rate Limiting: Built-in rate limiting for API protection
- Background Jobs: Scheduled task management
- License Management: Built-in licensing system
Requirements
- Node.js: 16 - 18
- Platform: Linux
- Package Manager: npm or pnpm
Quick Start
import { startMainApplication } from '@core';
startMainApplication('./settings.json', {
Sequelize: require('sequelize'), // Optional custom Sequelize instance
requireFn: require, // Optional custom require function
disableAutoInitApps: false, // Disable automatic app initialization
overrideSettings: {} // Override default settings
});Configuration
Create a settings.json file in your project root:
{
"database": {
"dialect": "sqlite",
"storage": "./database.sqlite"
},
"server": {
"port": 3000,
"host": "localhost"
},
"cache": {
"enabled": true,
"type": "memory"
}
}API Reference
startMainApplication(settingsJsonPath?, options?)
Starts the Kimia Cloud web server application.
Parameters
settingsJsonPath(optional): Path to JSON settings fileoptions(optional): Configuration objectSequelize: Custom Sequelize instancerequireFn: Custom require functiondisableAutoInitApps: Disable automatic app initializationoverrideSettings: Override default settings
Example
import { startMainApplication } from 'core';
startMainApplication('./config/settings.json', {
overrideSettings: {
DEBUG_MODE: true
}
});Global Components
The framework provides several global components accessible via the Global namespace:
Global.Database: Sequelize database instanceGlobal.Cache: Cache manager instanceGlobal.WebServer: HTTP web server instanceGlobal.StorageManager: File storage managerGlobal.EventHandler: Event handling systemGlobal.ErrorHandler: Error handling systemGlobal.ClusterManager: Multi-processing cluster manager
Plugin System
Extend functionality with plugins:
// In your settings
{
"USED_PLUGINS": ["my-plugin"]
}Development
Build
npm run buildDevelopment Mode
npm run devTesting
npm testLicense
ISC License
Author
madkne
Contributing
Contributions are welcome! Please feel free to submit pull requests or open issues.
Changelog
0.10.84 BETA
- Initial public release
- Core framework features
- Plugin system
- Multi-processing support
- Database and caching integration
