rebar

Multi-tenant SaaS boilerplate + examples for universal web application with React, Material-UI, Relay, GraphQL, JWT, Node.js, C* DB - Cassandra/Elassandra/Scylla.

Github星跟蹤圖

Rebar

Multi-tenant SaaS boilerplate + examples for universal web application with React, Material-UI, Relay, GraphQL, JWT, Node.js, C* DB - Cassandra/Elassandra/Scylla.

Live demo.

Technology stack

Prerequisites

The setup is for OS X only:

  • watchman: install using brew install watchman.
  • Node.js: minimum version as specified in package.json.
  • yarn: install using npm install -g yarn.
  • cqlsh: optionally installed locally.

Setting up Scylla in docker

Setup

docker pull scylladb/scylla:3.2.1
docker run --name scylly -d -p 9042:9042 scylladb/scylla:3.2.1

Start/Stop

docker start scylly
docker stop scylly

Troubleshooting

docker exec -it scylly scylla --version
docker exec -it scylly nodetool status
docker exec -it scylly cqlsh
docker logs scylly, tail

Cleanup

docker rm scylly

Setup on local development machine

In order to set up the project locally, perform the following steps:, Action, Notes, -------------------------, -----------------------------------, git clone https://github.com/MachineAcuity/rebar.git, Clone from github. Alternatively, you can download the source and update in some different way., yarn, Install node packages., yarn setup-local, Set up default configuration for running the boilerplate., Edit .env, Set database server / name, secrets, API keys. etc., yarn setup-database, Creates Cassandra schema., In addition to the above, you might want to specify JWT_SECRET by modifying the .env file. This step can be skipped if you do not care about the actual security and simply want to get the project running.

Development

Running in Development Mode

In order to develop, three servers need to be started:

  • Web server.
  • Webpack server.
  • Relay compiler (watching).
  • Local tunnel.

This can be done with one command: yarn dev.
To open the web app: navigate to http://localhost:28605, or whatever IP was assigned when running yarn update-ip.

Configuring Local Tunnel

In some cases it is necessary to make your development environment publicly available under HTTPS. The service Local Tunnel allows you to easily share a Rebar project on your local development machine without messing with DNS and firewall settings. In order to use LocalTunnel, edit units/_configuration/rb-base-tools/tunnels.json. Replace the value of

"subdomain": "replace-with-your-own-domain"

with your preferred value. Please notice that LocalTunnel allocates subdomain names on a first come first serve basis, for the duration of using the service. Navigate to https://replace-with-your-own-domain.localtunnel.me.

Server Debugging

  • Run yarn deb.
  • Open a Chromium based browser and navigate to about:inspect.
  • Click Open dedicated DevTools for Node.

Unfortunately source maps are not available at this moment.

Documentation

Documentation can be added to code in JSDoc format and is produced by documentation. This is done because of the superior flow support. It is generated in doc/code.

Testing

Unit Testing

Examples of Jest unit tests are available in units/rb-base-test.

End to End Testing

Example of end-to-end tests suing Jest and Puppeteer are available on github in repository MachineAcuity/rebar-test-e2e.

Production Setup

In order to run rebar in production-like mode you can:

$ yarn build-deployment
...
$ export NODE_ENV=production
$ node ./deployment/units/rb-base-server/server

A production setup would include the deployment directory, with appropriate .env file, and running units/rb-base-server/server in some sort of fashion.

主要指標

概覽
名稱與所有者MachineAcuity/rebar
主編程語言JavaScript
編程語言JavaScript (語言數: 4)
平台
許可證MIT License
所有者活动
創建於2016-04-20 07:33:28
推送於2021-05-07 20:29:32
最后一次提交2020-10-06 04:41:57
發布數11
最新版本名稱tag-revision-4.4.301 (發布於 2020-07-31 13:31:11)
第一版名稱4.0.5 (發布於 2018-10-22 02:13:51)
用户参与
星數713
關注者數29
派生數98
提交數1.1k
已啟用問題?
問題數451
打開的問題數5
拉請求數20
打開的拉請求數6
關閉的拉請求數11
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?