@flypapertech/avian
Create Enterprise-class component driven applications that scale.
Last updated 3 months ago by flypaper-bot .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @flypapertech/avian -g
SYNC missed versions from official npm registry.

Avian

Create Enterprise-class component driven applications that scale.

CircleCI Docker Cloud Build Status Known Vulnerabilities npm (scoped) License Dependencies Docker Pulls

Synopsis

Avian is a platform for running highly available, horizontally scalable, stateless, component based applications. It is optimized for public cloud, private cloud, bare metal, virtual machines, and containers. Its design is the result of years of experience in developing and maintaining applications at scale, while easing development and maintainability for large software engineering teams.

Key Features

Avian is built on top of the popular Express web framework for NodeJS, uses Redis for managing application state afinity, sessions, and the caching of view templates, while Webpack manages the transpilation and bundling of your client and server-side component files.

  • Cluster mode for load balancing across available CPU cores.
  • Out of the box webpacking with sane defaults. Don't worry you can override and/or add to them whenever you want :)
  • Routes are generated based on how your component folders are structured.
  • Supports client side scripts and server side routes (APIs) written in JavaScript and TypeScript.
  • The serving of static files.
  • Views can be authored in EJS, Twig, Pug, and plain HTML.
  • Logging frameworks are Pino, Bunyan, and Fluentd.

Installation

Docker

Official Docker instructions coming soon. For now, check out the hello-world example in the examples directory.

NPM

The latest stable release of Avian is available on npmjs.com.

The most common scenario is to install Avian as a dependency of your project.

npm install @flypapertech/avian

or 

yarn add @flypapertech/avian

And can be accessed as...

node ./node_modules/.bin/avian

Alternatively, Avian can be installed globally, making it possible to serve multiple applications with a single installation of Avian.

npm install @flypapertech/avian -g

or

yarn global add @flypapertech/avian

And can be accessed globally, but will need to be told where your Avian application is located...

avian --home /path/to/avian/app/home

System Requirements

NodeJS

Avian requires NodeJS version 8.0 and above.

Redis Server

Avian uses Redis Server for storing session data, caching component config object requests and arbitrary caching requirements you may have.

Suggested Redis Installation Methods

macOS

brew install redis

Ubuntu Linux

apt install redis-server

Alpine Linux

apk add redis

Windows (experimental)

Getting Started

CLI Arguments

Options:
--help                      Show help                                [boolean]
--version                   Show version number                      [boolean]
--name, -n                  The name of your application[default: "localhost"]
--home, -h                  The directory of your application.
                                            [default: Current working directory]
--mode, -m                  Deployment mode to run Avian in.
                [choices: "development", "production"] [default: "development"]
--port, -p                  Which port to serve your application on.
                                                                [default: 8080]
--staticDir, --sd           Which directory you would like to serve static
                            files from. Will be accessible at the root of your
                            application (e.g. /).          [default: "static"]
--entrypoint, --ep          The point of entry to your application.
                                                            [default: "index"]
--spa                       Start Avian in a single-page-application (SPA)
                            configuration.          [boolean] [default: false]
--bundleSkip                                        [boolean] [default: false]
--bundleOnly                                        [boolean] [default: false]
--redisHost                                             [default: "127.0.0.1"]
--redisPort                                                    [default: 6379]
--redisPass
--redisSessionDB                                                  [default: 1]
--redisCacheDB                                                    [default: 2]
--redisCronSchedulerDB                                            [default: 3]
--webpackHome                                                    [default: ""]
--logger, -l                Which logging framework to use.
                                        [choices: "pino", "bunyan", "fluent"]
--loggerFluentLabel, --lfl                                  [default: "debug"]
--loggerFluentTag, --lft                                    [default: "debug"]
--loggerFluentHost, --lfh                               [default: "127.0.0.1"]
--loggerFluentPort, --lfp                                     [default: 24224]
--sslCert                                                             [string]
--sslKey                                                              [string]
--compression                                       [boolean] [default: false]
--cronJobScheduler, --cjs   Avian components are capable of scheduling
                            cron-like jobs that are executed on the server.
                                                    [boolean] [default: false]

Application Folder Structure

├── assets [optional, statically served at /assets]
├── static [optional, statically served at /static]
├── cache [auto-generated by Avian in production mode to hold cached files]
├── components
│   ├── server.routes.(ts/js) [optional, used to add server routes to / path]
│   ├── component_name.client.(ts/js) [optional, contains all JavaScript/TypeScript logic for a component. Will be bundled with Webpack]
│   ├── component_name.view.(pug/ejs/html) [optional, renders output to a screen, e.g. a /component_name get request]
│   ├── component_name.server.routes.*.(ts/js) [optional, used to add server routes to /component_name]
│   ├── component_name.config.json [optional, served at /component_name/config/objects.json and passed to view files at render time]
│   ├── component_name [components can be in a flat folder or scaffolded like this]
│   │   ├── component_name.client.(ts/js)
│   │   ├── component_name.view.(pug/ejs/html)
│   │   ├── component_name.server.routes.*.(ts/js)
│   │   ├── component_name.config.json
├── logs [auto-generated by Avian in production mode]
├── package.json
├── private [auto-generated by Avian to contain server side compiled files, e.g. component server files]
├── public [auto-generated, for compiled component bundles, statically served at /]

Session Management

Avian uses express-session to manage client sessions. All sessions are stored in a Redis store.

  • Browser Based Clients

    • Avian uses secure HttpOnly Cookies for managing browser based client sessions.
  • Mobile Device and API Clients

    • Avian augments express-session to allow API and mobile device sessions management. Since those clients may not use cookies they simply need to send their session ID in the authorization header of all requests made to Avian. See below for an example header.
headers: {
    Authorization: "Bearer Session_ID"
}

Global Variables Added by Avian

Properties Added to All Request Objects

req.argv contains a copy of all arguments passed to Avian at start time.

req.cache is a RedisClient instance hooked to Avian's config object cache. Feel free to use it for your own needs as well.

req.params paramaters passed to your component. Typically this is used to determine the component name being rendered, e.g. req.params.component.

req.query contains all query parameters passed to the componenent being requested.

Developing w/ TypeScript

To make TypeScript aware of the globals Avian adds to your application simply place the below import into any .d.ts file that is within your application.

import * as Avian from "@flypapertech/avian"

Examples

Examples are located in the examples directory.

Contributors

Dan Stephenson
Nick Fredricks

License

MIT

Copyright

2018 - 2020 FlyPaper Technologies, LLC
2016 - 2018 Thoughtpivot, LLC

Current Tags

  • 0.6.38                                ...           latest (3 months ago)

89 Versions

  • 0.6.38                                ...           3 months ago
  • 0.6.37                                ...           4 months ago
  • 0.6.36                                ...           4 months ago
  • 0.6.35                                ...           4 months ago
  • 0.6.34                                ...           5 months ago
  • 0.6.33                                ...           5 months ago
  • 0.6.32                                ...           5 months ago
  • 0.6.31                                ...           5 months ago
  • 0.6.30                                ...           5 months ago
  • 0.3.10                                ...           5 months ago
  • 0.6.29                                ...           5 months ago
  • 0.6.28                                ...           5 months ago
  • 0.6.27                                ...           5 months ago
  • 0.6.26                                ...           5 months ago
  • 0.6.25                                ...           5 months ago
  • 0.6.24                                ...           5 months ago
  • 0.6.23                                ...           5 months ago
  • 0.6.22                                ...           5 months ago
  • 0.6.21                                ...           5 months ago
  • 0.6.20                                ...           5 months ago
  • 0.6.19                                ...           6 months ago
  • 0.6.18                                ...           6 months ago
  • 0.6.17                                ...           7 months ago
  • 0.6.16                                ...           7 months ago
  • 0.6.15                                ...           7 months ago
  • 0.6.14                                ...           7 months ago
  • 0.6.13                                ...           7 months ago
  • 0.6.12                                ...           7 months ago
  • 0.6.11                                ...           7 months ago
  • 0.6.10                                ...           8 months ago
  • 0.6.9                                ...           a year ago
  • 0.6.8                                ...           a year ago
  • 0.6.7                                ...           a year ago
  • 0.6.6                                ...           a year ago
  • 0.6.5                                ...           a year ago
  • 0.6.4                                ...           a year ago
  • 0.6.3                                ...           a year ago
  • 0.6.2                                ...           a year ago
  • 0.6.1                                ...           a year ago
  • 0.6.0                                ...           a year ago
  • 0.5.2                                ...           a year ago
  • 0.5.1                                ...           a year ago
  • 0.5.0                                ...           a year ago
  • 0.4.5                                ...           a year ago
  • 0.4.4                                ...           a year ago
  • 0.4.3                                ...           a year ago
  • 0.4.2                                ...           a year ago
  • 0.4.1                                ...           a year ago
  • 0.4.0                                ...           a year ago
  • 0.3.14                                ...           a year ago
  • 0.3.12                                ...           a year ago
  • 0.3.11                                ...           a year ago
  • 0.3.9                                ...           a year ago
  • 0.3.8                                ...           a year ago
  • 0.3.7                                ...           a year ago
  • 0.3.5                                ...           a year ago
  • 0.3.4                                ...           a year ago
  • 0.3.3                                ...           a year ago
  • 0.3.2                                ...           a year ago
  • 0.3.1                                ...           a year ago
  • 0.3.0                                ...           a year ago
  • 0.2.8                                ...           a year ago
  • 0.2.7                                ...           a year ago
  • 0.2.6                                ...           a year ago
  • 0.2.5                                ...           a year ago
  • 0.2.4                                ...           a year ago
  • 0.2.3                                ...           a year ago
  • 0.2.2                                ...           a year ago
  • 0.2.1                                ...           a year ago
  • 0.2.0                                ...           a year ago
  • 0.1.10                                ...           a year ago
  • 0.1.9                                ...           a year ago
  • 0.1.8                                ...           a year ago
  • 0.1.7                                ...           a year ago
  • 0.1.6                                ...           a year ago
  • 0.1.4                                ...           a year ago
  • 0.1.3                                ...           a year ago
  • 0.1.1                                ...           a year ago
  • 0.1.2                                ...           a year ago
  • 0.1.0                                ...           a year ago
  • 0.0.33                                ...           2 years ago
  • 0.0.32                                ...           2 years ago
  • 0.0.31                                ...           2 years ago
  • 0.0.30                                ...           2 years ago
  • 0.0.29                                ...           2 years ago
  • 0.0.28                                ...           2 years ago
  • 0.0.27                                ...           2 years ago
  • 0.0.26                                ...           2 years ago
  • 0.0.25                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 90
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |