Skip to content

ioxio-dataspace/example-app

Repository files navigation

IOXIO Dataspace example app

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 data retrieval and a 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
  • Retrieve data from data sources that are using Dataspace verified API tokens

Repo structure

  • backend - Python FastAPI backend
    • main.py - All the backend routes, e.g. for data retrieval
    • access_control.py - Logic for getting API tokens for sources using Dataspace verified API tokens
    • settings.py - Backend configuration
  • frontend - React application
    • containers - Root containers for handling data products
    • components - Stateless components to simplify following the containers' logic
    • utils.js - Some helpers, e.g. for making network requests to the backend

Local installation

Configuration

No configuration is necessary to get started with testing the app locally. However, if you want to also test data retrieval from a data source that requires dataspace verified API tokens, you need to:

  1. Create a group in the Sandbox Developer Portal.
  2. Request that your group gets access to the data source or use your own data source.
  3. Create the backend/.env file based on backend/.env.example.
  4. Get your access control keys from the Sandbox 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.

Pre-requisites

  • 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.

Backend

cd backend
poetry install

poetry run dev

Frontend

cd frontend
pnpm install

pnpm dev

Then open http://localhost:3000 in your browser.

About

Example application for Dataspace usage using React + Python FastAPI

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors