Awesome
FastFeathers
A collection of bash-shell scripts to install and run various Feathers examples very quickly.
Note: Please do not simply run these scripts without carefully reviewing this excellent Feathers tutorial.
All the Feathers examples utilize Tcl-Expect to automatically respond to the Feathers CLI questions. It is not required to have a separate VPS environment for a database connection, but it does make life more interesting. All database examples are using SSL connections. Testing has been done on Centos 7 / RHEL.
List Of Examples:
-
turorial examples: (No other setup required.)
-- in-memory-db-example.bsh - Worlds simplest and smallest example to see feathers in action.
-- simple-real-time-api.bsh - Real-time API referenced in the tutorial, with a couple of extras.
-
init-feathers-setup.bsh - Installs and Initializes the feathers enviroment. Required for every feathers example below.
-
chat-default.bsh - this will quickly install the feathers tutorial chat example.
-
chat-gmail.bsh - rework of the chat-default.bsh example, except this uses a Gmail address to log in.
-
chat-github.bsh - rework of the chat-default.bsh example, except this uses a Github address to log in.
-
gmail-login.bsh - simple example of using gmail to log in rather than the default authentication (Local Storage NeDB).
-
gmail-hook.bsh - simple example of using gmail-login.bsh, but includes a hook to capture gmail information such as first name, etc
-
gmail-service.bsh - example of using both gmail-login.bsh and gmail-hook.bsh, but also includes an NeDB service to save Gmail information such as first name. This one has a very crude user-interface using the browser-console.
-
gmail-sequelize.bsh - example of using both gmail-login.bsh and gmail-hook.bsh, but also includes an SQL service to save Gmail information such as first name. This one has a very crude user-interface using the browser-console.
-
github-login.bsh - example of using Github to log in rather than the default authentication (Local Storage NeDB).
-
github-hook.bsh - example of using Github-login.bsh, but includes a hook to capture Gmail information such as first name, etc
-
custom-service-find-get.bsh - a very simple example of a custom service using 'get' which reverses strings and using 'find' which either returns a directory (passing an object) or OS stuff (passing an id number).
-
jsgrid-sequelize.bsh - Uses Js-grid.com as the front end user-interface. Options include either MariaDB or CockroachDB. The default is CockroachDB.
-
sql-tiny.bsh - example of the tinyest sql example available
-
test-all-hooks.bsh - used to test each and every possible hook to help determine execution order. Creates 42 hooks.
Databases
-
init-mariadb-server.bsh - Install/initialize the MariaDB server for examples which require MariaDB.
-
init-mariadb-client.bsh - (Optional) Install a MariaDB client for testing with init-mariadb-server.bsh
-
init-cockroach-server.bsh - Install/initialize the CockroachDB server for examples which require CockroachDB or PostgreSQL.
-
init-cockroach-client.bsh - (Optional) install a CockroachDB client for testing with init-cockroach-server.bsh
-
init-timeline-server.txt - creates a timelineDB(postgresql) environment. this is not a bash-script (yet).
Tested Environments
- Digital Ocean droplets Centos 7
- Google Cloud VM instances Centos 7
- Amazon EC2 -- RHEL
- 123systems.net -- Centos 7
To Run:
-
Create a VPS, and optionally a second one for database usage.
-
(Gmail login examples only, suggested but not required for Github login) Obtain a Namecheap.com 99-cent domain name for testing Gmail login and point the "A" record of the IP of the VPS from the previous step.
-
Create either a Gmail or a Github login:
Gmail login: Visit the Google Oauth2 credentials page to create your credentials and get your Client ID and Client secret values. You will need to fill in Authorized Javascript origins (example: http;//fastfeathers.com:3030) and Authorized redirect URIs (example: http;//fastfeathers.com:3030/auth/google/callback) using your own domain name in the Oauth2 credentials page. More information is available on the Feathers website.
Github login: Visit the Oauth Apps page to create your credentials to get your Client ID and Client secret values. You will need to fill in your Authorized callback URL (example: http;//123.123.123.123:3030/auth/github/callback) using your own IP number (or domain name) in theOauth Apps page.
-
sudo yum --assumeyes install git;
git clone https://github.com/edwardsmarkf/fastfeathers ;
-
bash -vx ./fastfeathers/init-[[YOUR_DB_CHOICE]]-server.bsh;
Required database server installation for all examples requiring database access. Optionally install and run the ./feathers/init-[[YOUR_DB_CHOICE]]-client.bsh on the Feathers server to make sure connectivity is working properly. -
bash -vx ./fastfeathers/feathers-initial-setup.bsh;
Required for the feathers server. -
(Optional) Edit your choice of examples for the following (Or edit your ./config/default.json file after completion.)
- HOST -- Domain name required for Google Oath2 login or IP number (or domain name) required for Github Oath2 login.
- Client_ID & Secret_ID -- required for Google & Github Oath2 login.
- DB_USER, DB_PASS, DB_NAME, SERVER_IP -- required for all examples that use a database, values are displayed after DB installation.
-
bash -vx ./fastfeathers/YOUR_CHOICE.bsh ;
substitute YOUR_CHOICE.bsh for your choice of examples. -
Instructions to run the feathers example will display on your terminal window.