lilypad
v0.6.2
Published
the front end framework for Madadata's BI platform
Downloads
3
Readme
lilypad
Project Structure
- folder structure: inspired by lancejpollard
- routes settings: inspired by Zihua Li
Lilypad Apps and Ecosystem
因为我们要做闭环,要做生态
- https://github.com/Madadata/lilypad-interactive-card-builder
- https://github.com/Madadata/lilypad-map-card
- https://github.com/Madadata/lilypad-chart-card-builder
- https://github.com/Madadata/lilypad-app-store
- https://github.com/Madadata/lilypad-app-dashboard
- https://github.com/Madadata/lilypad-app-blade-card
- https://github.com/Madadata/lilypad-csv-uploader
- https://github.com/Madadata/lilypad-modeling
- https://github.com/Madadata/lilypad-metric-card
- https://github.com/Madadata/lilypad-chart-card
- https://github.com/Madadata/lilypad-data-center
- https://github.com/Madadata/lilypad-util
- https://github.com/Madadata/lilypad-client
- https://github.com/Madadata/lilypad-sample-data
Deployment
The build is on DockerHub
docker pull mada/lilypad
and also on DaoCloud:
docker pull daocloud.io/madadata/lilypad
Concepts
.
└── Group
└── Board
└── Card
├── ChartCard
├── MetricCard
└── SortingTableCard
- Group: a collections of Board -> sections in Domo, page in Domo.
- Board: a placeholder for collections of Card -> sub-page in Domo.
- Card: a displaying unit. -> card in Domo.
Naming Conventions
- Card:
Name${CardName}
How to Start
development
- Webpack first
- start all the docker services
- export aws env variables
export AWS_SECRET_ACCESS_KEY='any_value_is_ok'
export AWS_ACCESS_KEY_ID='any_value_is_ok'
- export douban env variables
export CALLBACK_URL_PREFIX='http://127.0.0.1:3000/third-party/callback'
export DOUBAN_CLIENT_ID='douban client id'
export DOUBAN_CLIENT_SECRET='douban client secret'
- login docker first (your docker user id should in mada), ask for permission if not so
- run
lilypad_start.sh
./lilypad_start.sh
# in case the final cmd in lilypad_start.sh failed, just run it again a few seconds later.
yarn
npm run build
- start lilypad
npm start
app development
make sure you have followed the instructions in development section. Then just do
./lilypad_app_start.sh
production
In production, fake-leancloud-auth are replaced by real leancloud service. Therefore, you have to provide leancloud appId and appKey through environment variables -
npm run build
LEANCLOUD_APP_ID=your_app_id LEANCLOUD_APP_KEY=your_app_key npm run start:prod
docker build
Environment Variables
| name | description | example | |-------------------------|---------------------------|-----------------------------------| | LEANCLOUD_APP_KEY | app key of LeanCloud app | wm03Mel0UCyNr2rkjd2OVmjW | | LEANCLOUD_APP_ID | app id of LeanCloud app | khFeY6fqCpsEvb4kI4RAJ7HU-gzGzoHsz | | LEANCLOUD_URL | LeanCloud url | https://api.leancloud.cn | | TURBINE_URL | turbine url | http://turbine:8080 | | BEETLE_URL | beetle url | http://beetle:8080 | | REDIS_URL | redis url | redis://redis:6379 |
docker build -t lilypad .
docker run -d -p 3000:3000 \
-e LEANCLOUD_APP_KEY=YOUR_LEANCLOUD_APP_KEY \
-e LEANCLOUD_APP_ID=YOUR_LEANCLOUD_APP_ID \
lilypad
API
Mount Point
All api services provided will be mounted on /api. Only request with valid basic authorization field is allowed.
/card
- GET: query list of cards
- POST: create single card
- body: graphQL
/card/:id
- GET: query single card
- POST: update single card // not implemented yet
/board
- GET: query list of boards
- POST: create single board
- body: graphQL
/board/:id
- GET: query single board
- POST: create single board
- body: graphQL
/data-set
- GET: query list of datasets
- POST: create single dataset
- body: graphQL
/data-set/:id
- GET: query single dataset
/account
- GET: query list of accounts
- POST: create single account
- body: graphQL
/account/:id
- GET: query single account
- POST: update single account // not implemented yet
/data
- POST: upload csv data
- query: dataSetIds[, type]
- form: multiparty-formdata
- GET: query data by data accessor or sql
- query: type, (dataAccessor | query)
- POST: upload csv data
/etl/sync
- GET: sync dataset
/connectors
- GET: query list of connectors
/:connector/tables
- GET: query list of tables
/version
- GET: query versions of backend services