项目作者: campudus

项目描述 :
A web interface for tableaux. A restful service for storing data in tables.
高级语言: JavaScript
项目地址: git://github.com/campudus/tableaux-frontend.git
创建时间: 2015-03-19T04:54:08Z
项目社区:https://github.com/campudus/tableaux-frontend

开源协议:Apache License 2.0

下载


Tableaux Frontend Codacy Badge

Tableaux (pronounced /ta.blo/) is a restful service for storing data in tables. This project contains a generic React-based HTML5 client for the tableaux backend.

Project setup

Go to project directory and execute:

  1. npm install

Run project locally in dev mode

Go to project directory and execute:

  1. npm run dev

The redux store can hold a lot of data, which can slow down redux devtools severely. So when you have redux devtools installed and run into trouble while developing in large tables, you can try running
with

  1. REDUX_DEVTOOLS=false npm run dev

Build project with clean before

Go to project directory and execute:

  1. npm run clean && npm run build

Overview of npm tasks

  1. npm run
  2. start # create production bundle and serve at serverPort
  3. build # create production bundle
  4. dev # create dev bundle and serve it at serverPort
  5. lint # lint all project source files
  6. lint:changes # lint all differences to master
  7. lint:fix # apply automated lint fixes to all project source files
  8. lint:fix:changes # fix all changes to master
  9. storybook # start storybook
  10. test # run tests with jest
  11. clean # clean build cache and out directory
  12. clean:project # clean build cache and out directory, reinstall all dependencies

Project configuration

Default project configuration can be overwritten via a config.json in the base directory or via environment variables.

Example for config.json

  1. {
  2. "outDir": "out", // build artefacts go here
  3. "host": "localhost", // host of the http frontend
  4. "port": 3000, // port for the http frontend
  5. "apiHost": "localhost", //
  6. "apiPort": 8080, // port of the backend service
  7. "webhookUrl": "..", // url for Slack webhook to receive user feedback
  8. "authServerUrl": "http://localhost:8081/auth", // Keycloak
  9. "authRealm": "GRUD", // Keycloak realm
  10. "authClientId": "grud-frontend", // Keycloak clientId
  11. "disableAuth": true // disable authentication for frontends behind old proxy (default: false)
  12. }

Example for environment variables

Environment variables can be used to start multiple instances, listening on multiple ports.

Following variable names can be used:

  • HOST
  • PORT
  • APIHOST
  • APIPORT
  • OUTDIR
  • WEBHOOKURL
  • REDUX_DEVTOOLS=[true,false] # “false” disable dev tools integration for dev performance. Default: true
  • ENABLE_HISTORY=[true,false] # Show or hide cell history button in context menu. Default: true
  • SHOW_TABLE_DROPDOWN=[true,false] # Show confusing table settings dropdown. Default: true
  • AUTH_SERVER_URL
  • AUTH_REALM
  1. PORT=3001 npm run start

Troubleshooting

NPM install fails with node-gyp error

Something like this:

  1. npm ERR! Traceback (most recent call last):
  2. npm ERR! File "/Users/xxx/.nvm/versions/node/v20.5.1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 42, in <module>
  3. npm ERR! import gyp # noqa: E402
  4. npm ERR! ^^^^^^^^^^

This is because distutils has been removed in Python v3.12. You can fix this by downgrade/installing Python v3.11.
The simplest and flexible way to manage Python versions is to use pyenv. Install it and use a .python-version file in the project root to specify the version.

License

  1. Copyright 2016-present Campudus GmbH.
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.