This demo application is designed to show a practical example on how to create an application that connects to a Dataspace built with the IOXIO Dataspace technology.
It consists of a simple Python FastAPI backend that is responsible for authentication and data retrieval and React-based frontend application.
You can try the online demo or check the configuration section for instructions on how to run this code locally.
Main idea is to demonstrate how to:
- Retrieve data products from Product Gateway
- Perform authentication in a dataspace
- Use the authentication tokens for data products
- Request data products that require consent
- backend - Python FastAPI backend
- main.py - All the backend routes, e.g. for authentication or data retrieval
- access_control.py - Logic for getting API tokens for sources using Dataspace managed API tokens
- consents.py - Code related to requesting data products that require a consent
- well_known.py - Party configuration related endpoints
- settings.py - Backend configuration
- frontend - React application
- containers - Root containers for handling data products
- components - Stateless components to simplify following the containers' logic
- utils - Some helpers, e.g. for making network requests to the backend
Before running the app locally, you have to:
-
Create a group in Developer Portal. and set party configuration domain to
example-app.demos.ioxio.dev
. Or follow the guide to create and host your own. -
Register new application in the Developer Portal. Use the following values in the form:
- Redirect URI:
http://localhost:3000/api/auth
- Logout redirect URI:
http://localhost:3000
Note: In the next step you will need the Client ID and Client secret that get generated when you complete the registration of the application.
- Redirect URI:
-
Create the backend/.env file based on backend/.env.example and set
OIDC_CLIENT_ID
andOIDC_CLIENT_SECRET
variables with the values from the previous step. -
Additionally, if you host your own party configuration, then set the corresponding key as
PRIVATE_KEY
, setPRIVATE_KEY_ID
and updatePARTY_CONFIGURATION_DOMAIN
. -
If you want to test access control keys, get your access control keys from the Developer Portal and configure
ACCESS_CONTROL_KEYS
like:ACCESS_CONTROL_KEYS={"dpp://.../": "ABC123..."}
Multiple keys can be set for separate DSIs by separating the pairs with commas. You will also have to set
ACCESS_CONTROL_SUB
to the group your application uses to access the source.
- Python 3.11 - 3.13 - For running the backend
- Poetry 1.8.2+ - Python dependency management tool
- Node 18+ - For running the frontend
- pnpm 8.15+ - Node package manager
- pre-commit - Runs hooks before you commit to e.g. format
your code. Make sure you run
pre-commit install
after checking out the repo.
cd backend
poetry install
poetry run dev
cd frontend
pnpm install
pnpm dev
Then open http://localhost:3000 in your browser.