Release branch online: (https://parlamentttisampo.fi)
Master branch online: (https://dev.parlamentttisampo.fi)
Based on Sampo-UI – A framework for building semantic portal user interfaces
The Sampo-UI framework is being developed by the Semantic Computing Research Group (SeCo) at the Aalto University, Finland. See the research page for more information.
-
Node.js® – a JavaScript runtime built on Chrome's V8 JavaScript engine. (version 16.13.0)
-
Nodemon – monitor for any changes in your source and automatically restart your server
Note for Linux users: if your home directory is mounted from a network drive, using the Node Version Manager for installing Node.js highly recommended.
Install the dependencies specified in package.json
(this command needs to be run only once,
as long as you don't modify the dependencies):
npm install
Run client and server concurrently:
npm run dev
These example commands can be used to deploy the server at http://localhost:3006/ in production mode. Production mode means in this case that the server listens for API requests at URLs beginning with http://localhost:3006/api/v1/... and additionally serves the client (React app) at http://localhost:3006/. The API docs can be found at http://localhost:3006/api-docs/.
Note that in development mode Webpack is used for serving the client, and the server is used only for handling API requests.
The build argument API_URL must be provided.
docker build --build-arg API_URL=http://localhost:3006/api/v1 -t sampo-web-app-image .
docker run -d -p 3006:3001 --name sampo-web-app sampo-web-app-image
docker run -d -p 3006:3001 -e SPARQL_ENDPOINT_BASIC_AUTH=your_password --name sampo-web-app sampo-web-app-image
docker build --build-arg API_URL=http://localhost:3006/api/v1 -t sampo-web-app-image .
docker stop sampo-web-app
docker rm sampo-web-app
docker run -d -p 3006:3001 --name sampo-web-app sampo-web-app-image
The JavaScript style guide, linter, and formatter module (named "standard" in package.json) is installed by default as development dependency. Do not install or create any additional style definitions or configurations. Instead, install an appropriate plugin for your text editor. If there are no plugins available for your favorite editor, it is highly recommended to switch into a supported editor.
Sampo-UI's React components are documented here using Storybook.
Here is a list of the main JavaScript libraries on which the Sampo-UI client is built on:
- React – A JavaScript library for building user interfaces
- Material-UI – React components for faster and easier web development
- Redux – A Predictable State Container for JS Apps
- redux-observable – RxJS-based middleware for Redux
- Reselect – Selector library for Redux
- React Router – Declarative routing for React
- react-intl-universal – React internationalization package developed by Alibaba Group
- deck.gl – Large-scale WebGL-powered Data Visualization
- react-map-gl – React friendly API wrapper around MapboxGL JS
- Leaflet – a JavaScript library for interactive maps
- Cytoscape – an open source software platform for visualizing complex networks
- ApexCharts.js – Open Source JavaScript Charts for your website
- React Sortable Tree – A React component for representation of hierarchical data
- Moment.js – Parse, validate, manipulate, and display dates and times in JavaScript
The API provided by Sampo-UI's backend includes routes for the following search paradigms: faceted search, full text search, and federated full text or spatial search. The API is described using the OpenAPI Specification. The same specification is used for both documenting the API, and validating the API requests and responses.
An API documentation with example configuration can been seen here.
Sampo-UI's backend is based on the following JavaScript libraries: