• Stars
    star
    204
  • Rank 192,063 (Top 4 %)
  • Language
    JavaScript
  • License
    Other
  • Created about 8 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Electrode Over The Air Server for hot deployment of React Native and Cordova mobile apps

Electrode OTA Server

The Electrode OTA Server provides a way to hot deploy android and ios React Native™ and Cordova™ apps. The server is API compatible with code-push-cli, the Code Push React Native SDK and the Code Push Cordova SDK.

Documentation

Requirements

  • Node ^8.16.0

OTA: Overview

Installation

For configuration instructions visit the electrode.io

 npm i electrode-ota-server

Example

Check the example folder. See the Readme

Releases

Version 4.3.0

Various bug fixes.

Version 4.0.0

Rewrite of mariadb module; simplify needed configuration to use the mariadb module.

        "electrode-ota-server-dao-plugin" : {
            "module" : "electrode-ota-server-dao-mariadb",
            "options": {
                "clusterConfig" : {
                    "canRetry" : true,
                    "defaultSelector" : "ORDER",
                    "removeNodeErrorCount" : 5,
                    "restoreNodeTimeout" : 0,
                },
                "poolConfigs" : [{
                    "database": "electrode_ota",
                    "host": "localhost",
                    "password": "ota",
                    "port": 33060,
                    "user": "ota",
                }],
            }
        },

The underlying implementation uses the npm module mysql. The options are described in further detail in the module's readme.

The schema for mariadb is in the electrode-ota-mariadb-schema folder. The module does not use sequelize anymore, and the schema is created separately using liquibase.

Version 3.2.1

Version 3.2.1 is deprecated. Please use Version 3.3.0 instead.

Version 2

Version 2 adds partial update support. To do this it requires some alterations to the cassandra database. This will happen automatically, unless the configuration to the electrode-ota-dao-cassandra is configured as

 "electrode-ota-server-dao-cassandra": {
                "options": {
                    ...
                    "disableTTYConfirmation": false,
                    //this is alter by default.
                    "migration": "safe",
                }
            }
 }

Make sure to backup your data, while not known to cause data loss, it is possible.

Development

To run tests, make sure you have localhost.walmart.com mapped to 127.0.0.1 loopback. Make sure you have cassandra installed. Cassandra is required for testings.

> docker pull cassandra
> docker run -p 9042:9042 cassandra

To build..

> npm install -g lerna yarn
> lerna bootstrap
> lerna run build

To run all tests (will rebuilds all) ..

> yarn test

To run a package test...

> cd electrode-ota-model-app
> yarn test

To run a sample app, check the example app in the example folder.

Packages

Package Description
electrode-ota-mariadb-schema Schema for MariaDB
electrode-ota-server Main server module
electrode-ota-server-auth Contains all the authentication strategies.
electrode-ota-server-auth-basic Provides basic authentication
electrode-ota-server-auth-github Provides Github-based authentication
electrode-ota-server-auth-validate Provides session support
electrode-ota-server-boot Server startup module
electrode-ota-server-dao-cassandra Implementation of electrode-ota-server-dao-plugin that supports Cassandra
electrode-ota-server-dao-mariadb Implementation of electrode-ota-server-dao-plugin that supports MariaDB / MySQL
electrode-ota-server-dao-plugin Defines the interface for the backend datastore(s)
electrode-ota-server-default-config Default config
electrode-ota-server-diregister Utility for registering various modules
electrode-ota-server-errors Common errors (@hapi/boom wrapper)
electrode-ota-server-fileservice-download Handles download of packages
electrode-ota-server-fileservice-upload Handles upload of packages
electrode-ota-server-logger Logger
electrode-ota-server-manager Route handlers for /manager/* endpoints
electrode-ota-server-model-account Account model
electrode-ota-server-model-acquisition Acquisition model
electrode-ota-server-model-app App model
electrode-ota-server-model-manifest Manifest model
electrode-ota-server-model-weighted Weighting utility
electrode-ota-server-public Route handler for static endpoints
electrode-ota-server-routes-accesskeys Route handler for access keys endpoints
electrode-ota-server-routes-acquisition Route handler for (client) acquisition endpoints
electrode-ota-server-routes-apps Route handler for app endpoints
electrode-ota-server-routes-auth Route handelr for authentication/session endpoints
electrode-ota-server-service-errors Handles endpoint errors
electrode-ota-server-service-fileservice Deprecated
electrode-ota-server-service-management Deprecated
electrode-ota-server-test-support Test utilities
electrode-ota-server-util Utilities
electrode-ota-server-util-dev Developer utilities
electrode-ota-server-view Deprecated
electrode-ota-ui OTA UI shared with desktop/web UIs

Custom Data store

electrode-ota-server-dao-plugin defines the interface for the database, along with the expected Data Access Objects.

To create your own data store, create a module with the same factory methods as electrode-ota-server-dao-plugin. See electrode-ota-server-dao-cassandra and electrode-ota-server-dao-mariadb for examples.

In your config file, specify the new module. Pass any required options.

    "electrode-ota-server-dao-plugin" : {
        "module" : "electrode-ota-server-dao-mariadb",
        "options": {
            ...
        }
    },

Package content is saved to the specified datastore (MariaDB or Cassandra). If you want to save to disk, override electrode-ota-server-fileservice-download and electrode-ota-server-fileservice-upload with your custom module.

    "electrode-ota-server-fileservice-upload": {
        "module": "my-object-store",
        "options": { "upload": true }
    },
    "electrode-ota-server-fileservice-download": {
        "module": "my-object-store",
        "options": { "upload": false }
    }

HowTos

Upload Size and Timeout

To increase the max upload size, add this to your configuration: Likewise, you can set the timeout if upload is timing out.

"electrode-ota-server-routes-apps" : {
    "options" : {
        "payload" : {
            "maxBytes" : 94371840,
            "timeout": 119999
        }
    }
}

Change log level

Update the log level in the options of electrode-ota-server-logger

{
    "plugins": {
        "electrode-ota-server-logger": {
            "options": {
                "level": "info"
            }
        }
    }
}

Add a new package

Use Lerna to create the package

% lerna create <package-name>

This creates a base project. Update package.json to match other projects.

Apache-2.0 © WalmartLabs
Built with ❤️ by Team Electrode @WalmartLabs.

More Repositories

1

electrode

Web applications with node.js and React
HTML
2,101
star
2

electrode-native

A platform to ease integration&delivery of React Native apps in existing mobile applications
TypeScript
725
star
3

electrode-io.github.io

The public website of the Electrode platform
HTML
336
star
4

electrode-react-ssr-caching

Optimize React SSR with profiling and component caching
JavaScript
316
star
5

electrode-explorer

An Electrode application that showcases all of your components in a live demo
JavaScript
254
star
6

electrode-electrify

Electrify is an webpack visualizer for analyzing webpack bundles.
JavaScript
230
star
7

electrode-server

Electrode's configurable web server using Hapi.js atop Node.js
JavaScript
224
star
8

electrode-csrf-jwt

Stateless Cross-Site Request Forgery (CSRF) protection with JWT
JavaScript
126
star
9

above-the-fold-only-server-render

An Electrode component for optionally skipping server side render of components outside of Above the fold
JavaScript
117
star
10

electrode-confippet

node.js environment aware application configuration
TypeScript
108
star
11

isomorphic-loader

Webpack isomorphic loader tools to make Node require handle files like images for Server Side Rendering (SSR)
JavaScript
68
star
12

electrode-archetype-njs-module-dev

A WalmartLabs flavored NodeJS Module archetype
JavaScript
67
star
13

electrode-bundle-analyzer

Analyze your webpack deduped and minified bundle JS file.
JavaScript
66
star
14

electrode-webpack-reporter

A HTML based reporter for webpack dev server
JavaScript
59
star
15

electrode-gulp-helper

Helper functions for using gulp
JavaScript
59
star
16

electrode-check-dependencies

An Electrode module to verify component dependencies against a list
JavaScript
58
star
17

electrode-docgen

A custom metadata extractor and documentation generator for the Electrode framework
JavaScript
57
star
18

fynpo

🛠️📦 a node.js monorepo manager
JavaScript
55
star
19

electrode-static-paths

Electrode server decor to serve static files
JavaScript
55
star
20

react-native-electrode-bridge

Electrode Native - Bridge
Java
44
star
21

xarc-run

npm run scripts concurrently and serially, and more.
JavaScript
42
star
22

memcache

Node.js memcached client with the most efficient ASCII protocol parser
TypeScript
37
star
23

electrode-ota-desktop

Electrode OTA Desktop Client
JavaScript
22
star
24

electrode-ota-ui

[Deprecated for electrode-ota-server/electrode-ota-ui] Electrode OTA Web/Client UI
JavaScript
17
star
25

ern-navigation

Electrode Native solution for React Native navigation
JavaScript
12
star
26

movies-reloaded-miniapp

Our new movie miniapp built on the Electrode Native Navigation.
JavaScript
10
star
27

car-buying-instructions

JavaScript
9
star
28

movielist-miniapp

Electrode Native - Movie List MiniApp (Getting Started)
Objective-C
8
star
29

fastify-server

Electrode using Fastify
TypeScript
6
star
30

moviedetails-miniapp

Electrode Native - Movie Details MiniApp (Getting Started)
JavaScript
6
star
31

electrode-keepalive

node.js HTTP agent with customized keep alive
JavaScript
6
star
32

kax

TypeScript
5
star
33

react-native-livebundle

LiveBundle Native Module
Java
3
star
34

livebundle

LiveBundle CLI
TypeScript
3
star
35

electrode-native-starter-manifest

Electrode Native - Starter Manifest
3
star
36

react-native-ernnavigation-api

Electrode Native - Navigation API (Getting Started)
Swift
3
star
37

electrode-native-manifest

Electrode Native - Master Manifest
Java
3
star
38

electrode-native-showcaseapp-android

Native application that showcases electrode native MiniApps and APIs.
Java
2
star
39

electrode-native-sample-cauldron

Sample Electrode Native Cauldron
2
star
40

fynpo-old

Supplement tools for using fyn with lerna
JavaScript
2
star
41

car-buying-service

mock service for car buying app
JavaScript
2
star
42

car-buying

A sample car buying app
JavaScript
2
star
43

ern-bundle-store

Electrode Native Bundle Store Server
TypeScript
2
star
44

electrode-native-website

The site and docs for Electrode Native
JavaScript
2
star
45

react-native-ernmovie-api

Electrode Native - Movie API (Getting Started)
Swift
2
star
46

ernnavigation-api-impl-native

Native implementation of ernnavigation-api
Objective-C
2
star
47

electrode-demo-app

Demo application generated by Electrode platform unmodified
JavaScript
1
star
48

react-native-ernmovie-api-impl

Objective-C
1
star
49

ern-sourcemap-store

Electrode Native sourcemap store server
TypeScript
1
star
50

electrode-native-binarystore

Electrode Native - Binary Store
JavaScript
1
star
51

ern-container-transformer-xcframework

Electrode Native XCFramework Container Transformer
Shell
1
star
52

ern-container-publisher-maven

Electrode Native Maven Container Publisher
TypeScript
1
star
53

resolve-alias

set virtual module aliases for resolve and require
JavaScript
1
star
54

ern-base-composite-starter

Electrode Native Base Composite Starter
JavaScript
1
star
55

electrode-native-showcaseapp-ios

Swift
1
star
56

react-native-ernmovie-api-impl-js

JavaScript
1
star