Set up a WissKI development environment¶
Context¶
In case you want to contribute to the WissKI codebase or want to test out changes locally, you first need to set up a development environment. The WissKI repository already has a configuration for Visual Studio Development Containers, that makes setting up such an environment fairly easy. In the following we will guide you though the necessary steps to get your own development environment up and running on your local machine.
Goals¶
- Set up a development environment and open the codebase in an editor
- Observe and test changes in the development WissKI system
- Learn how to use development tools like linters and typecheckers
Prerequisites¶
- Installed software:
- Git
- Docker
- VS Code with the Dev Containers extension installed
- Additional Software for Windows:
- WSL or alternatively
- Docker Desktop, which should lead you through the WSL installation and automatically installs a Linux Distribution with Docker pre-installed
- Knowledge:
- Docker (compose) basics
- Account on drupal.org in case you want to submit your changes to the codebase.
Setting up a development environment¶
We recommend using a Linux machine for development, but you can also use WSL/Docker Desktop on Windows.
- Clone the Git repository:
git clone git@git.drupal.org:project/wisski.git
- Open the repository in VS Code:
code wisski
- Press ctrl + shift + P to open the command palette
- Type
reopen
and selectDev Containers: Reopen in Container
from the suggestions. Note that this may take some time.
Now you should have the WissKI codebase open in VS Code and the following services started:
drupal
: Contains the Drupal installation including the WissKI modules. Credentials for logging in: username:root
, password:root
mariadb
: SQL database needed for Drupaladminer
: UI for interacting with themariadb
databaserdf4j
: Triplestore where the WissKI data is stored
You can check the exact names of the services with docker ps -a | grep wisski
, in case you want to open a shell inside these containers.
The services drupal
, adminer
and rdf4j
are automatically port forwarded to your local machine.
To check the ports that VS Code has chosen, open the Ports
view by pressing ctrl + shift + P and typing open view
.
Then select View: open View
and then select Ports
from the suggestions.
This displays a table that displays the list of port forwards and allows you to access the services by holding ctrl and clicking the desired service.
Note
The RDF4J service does not expose any service at the site root /
, hence you will see a HTTP 404 error page when you want to open the service from the ports list.
The RDF4J workbench is available at /rdf4j-workbench
so you will have to append that to the address in your browser manually (e.g. http://localhost:8081/rdf4j-workbench)
At this point you have a fully working WissKI instance that you can change to your hearts content. There are some development tools that will help you adhere to the WissKI coding standards. For more details on these tools refer to the Linting, Formatting & CI Section of the README.
In case you want to contribute your changes to the WissKI codebase, create an Issue describing your changes by following the Issue Rules.