Sampo-UI
A framework for building user interfaces for semantic portals. The following portals use this repository as a base:
- NameSampo
- Mapping Manuscript Migrations
- WarVictimSampo 1914–1922
- LawSampo
- AcademySampo
- FindSampo
- HistorySampo
- [ParliamentSampo?]
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.
Documentation
Sampo-UI's React components are documented here
Requirements
-
Node.js® – a JavaScript runtime built on Chrome's V8 JavaScript engine. (tested with 10.15.3 LTS)
-
Nodemon – monitor for any changes in your source and automatically restart your server
If your home directory is mounted from a network drive, Node.js should be installed using Node Version Manager https://github.com/nvm-sh/nvm
Key JavaScript libraries in use
Client
- 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
- React Router
- deck.gl – Large-scale WebGL-powered Data Visualization
- 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
Server
Local development
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
Deploy with Docker
Build
docker build -t sampo-web-app-image .
Run
docker run -d -p 3006:3001 --name sampo-web-app sampo-web-app-image
Run with password protected endpoint
docker run -d -p 3006:3001 -e SPARQL_ENDPOINT_BASIC_AUTH=your_password --name sampo-web-app sampo-web-app-image
Upgrade
docker build -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
Set up a new project using this repository as a base, with the possibility of merging the new commits added to this repository
-
Clone this repository:
git clone git@github.com:SemanticComputing/sampo-ui.git
-
Set up a new GitHub repository. Do not initialize it with anything. It needs to be an empty repository. You can name it how you like and you can rename your local folder to match that.
-
Copy the url of your new repository.
-
With terminal go to the folder with the clone of this repository (sampo-web-app).
-
Change remote origin from sampo-web-app to your new repository:
git remote set-url origin [your new github repo here]
-
Check that the origin changed to your new repository:
git remote -v
-
Push your local clone of sampo-web-app to your new repository:
git push
-
Set the original repository (sampo-web-app) as the upstream of your new repository:
git remote add upstream git@github.com:SemanticComputing/sampo-ui.git
-
When new commits appear on the original repository (sampo-web-app) you can fetch them to your new repository. The example fetches only master branch:
git fetch upstream master
-
Go to the branch of your new repository where you want to merge the changes in upstream. Merge, solve conflicts and enjoy:
git merge upstream/master