Giter Club home page Giter Club logo

example's Introduction

Metarhia Example Server for Node.js

travis license

Concept

This is a logical continuation of Node.js Starter Kit from How Programming Works software development course moving all system code to dependencies, namely using Metarhia technology stack.

You can begin development from this starter kit but having in mind future production deployment and further moving application to Metaserverless cloud based on Metarhia technology stack and Node.js.

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 polution prevention
  • Better code isolation

Usage

  • You need node.js v12.5.0 or later (v14 prefered)
  • 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
  • Before running server initialize the DB:
    • First of all, make sure you have PostgreSQL installed (prefer 12.x).
    • Run database initialization script: application/db/setup.sh
  • Run project: node server.js and stop with Ctrl+C
  • Ask questions in https://t.me/nodeua and post issues on github

License

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

example's People

Contributors

tshemsedinov avatar imnetcat avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.