Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

turone/MyExample

Repository files navigation

Metarhia application example for Node.js

license

πŸš€ Metarhia documentation and starter's guide

Concept

This is a logical continuation of Node.js Starter Kit moving all system code to dependencies, namely using Metarhia technology stack.

The purpose of this starter kit is to show best practices for Metarhia and Metaserverless, to give structure and architecture example, to illustrate simplicity and efficiency of mentioned technologies.

All parts of this implementation are optimized for reliability, scalability, performance and security. So if you need readability and want to study code, let's start with Node.js Starter Kit.

Feature list

  • Serve API with auto routing, HTTP(S), WS(S)
  • Server code live reload with file system watch
  • Auto dependency loader and plugins
  • Graceful shutdown and application reload
  • Minimum code size and dependencies
  • Code sandboxing for security and context isolation
  • Multi-threading for CPU utilization and isolation
  • Serve multiple ports in threads
  • Serve static files with memory cache
  • Application configuration
  • Simple logger and redirection from console
  • Database access layer (Postgresql)
  • Client persistent sessions
  • Unit-tests and API tests example
  • Request queue timeout and size
  • API parallel execution concurrency
  • API method execution timeout
  • Load balancing for scaling
  • Prototype pollution prevention
  • Better code isolation

Usage

  • You need node.js 18.x or 20.x
  • Fork and clone this repository (optionally subscribe to repo changes)
  • Run npm i to install dependencies and generate RSA certificate
  • Remove unneeded dependencies if your project doesn't require them
  • Add your license to LICENSE file but don't remove starter kit license
  • Start your project modifying this starter kit
  • If you have Docker and Docker Compose installed to run the project, use the command: docker-compose up
  • Before running server initialize the DB:
    • First of all, make sure you have PostgreSQL installed (preferably 12.x to 16.x).
    • Run database initialization script: database/setup.sh
  • Run project: node server.js and stop with Ctrl+C
  • Ask questions in Telegram https://t.me/nodeua (node.js related) or https://t.me/metaserverless (metarhia related)

License

Copyright (c) 2020-2023 Metarhia contributors. This starter kit is MIT licensed.

About

Metarhia application example for Node.js 🟒

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

Languages

  • JavaScript 87.5%
  • HTML 7.0%
  • CSS 5.1%
  • Other 0.4%

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /