Git Product home page Git Product logo

linkedevents-ui's Introduction

Linkedevents-UI - form-style UI for Linked Events API

Build status codecov

Linkedevents-UI is a user interface for creating and changing events through Linked Events API. It exposes many capabilities of the API including:

  • Creation, changing and deletion of events
  • Managing multipart events
  • Showing available actions based on user permissions

Prerequisites

  • Yarn
  • Node v8 LTS
  • Python 2 (due to node-sass using node-gyp)

Development Installation

Configuration

Copy the contents of config_dev.json.example to config_dev.json.

config_dev.json contains partially working settings giving you read only access to our test API. If you have your own API and/or authentication credentials you can change the relevant settings therein.

The UI is now compatible with the courses extension for the Linked Events API. If you wish to include the extra fields specified in the courses extension, please change the ui_mode setting from events to courses.

Note that authentication server is not nicely configurable. If you wish to use your own authentication server, you will need code changes in server/auth.js.

Running development server

$ yarn
$ yarn start

Then point your browser to the webpack dev server at http://localhost:8080/.

Production installation

Configuration

For production builds, all configuration is done using environment variables. This way, no errant configuration files should cause mysterious build failures or, worse, dormant configuration errors. The environment variables are named exactly the same as the ones in config_dev.json. For example, if you'd like to change the base address for Linkedevents API, you would:

export api_base="https://api.hel.fi/linkedevents/v1"

Note that the configuration is used in the different phases. Some settings need to be defined during build and other settings for running the authentication server (see below)

Most if not all build automation tools provide for setting environment variables. Check the documentation for the one you are using. If you are testing locally you can source config_build_example.sh to get started.

Building

After setting the config you can build install dependencies and build the static files:

$ yarn
$ yarn build

You should now have the bundled javascript + some non-bundled assets in dist. You can serve these using your favorite web server at whatever address suits your fancy.

You will still need the source tree for the authentication server (below)

Setting up the runtime

In addition to serving the files built in previous step, you will need to run the built-in authentication server (or proxy really). Although linkedevents-ui runs completely in client, it currently uses authentication code based OAuth2 Authorization Code flow. This is a historical accident, that will be remedied one day.

We recommend running the authentication server with some sort of process manager, possibly one specialized in running Node applications. Your system process manager, like systemd, is another good candidate

The authentication server will need configuration passed in through environment variables (see Congiration). If you use a process manager to run the server, it should provide for setting them.

The server is run by executing npm run production. If your process manager wants to run node by itself, you can also run specify server as the script (that will actually run server/index.js). In this case you will also need to set environment variable NODE_ENV=production by yourself.

After you have the authentication server running, you will need to set up a web server to serve the files in dist and forward authentication requests to the authentication server. The table below shows what needs to served: | URL | what is served | | /auth | forward to authentication server | | filename | serve from dist-directory | | unknown files | serve index.html from dist-directory |

The last part is needed for deep linking into the application.

linkedevents-ui's People

Contributors

rikuoja avatar villetou avatar niglu1 avatar jussiarpalahti avatar kallemakynen avatar hkotkanen avatar tkivela avatar tuomas777 avatar juyrjola avatar jimppa avatar rasbin avatar dependabot[bot] avatar tituomin avatar rboost avatar dotanthanh avatar tomi-sjoblom avatar zenbum avatar vikoivun avatar santtusulander avatar aleksisalonen avatar kuijoe avatar userium avatar hukka avatar olujuwon avatar s-arika avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.