Giter VIP home page Giter VIP logo

example-app's Introduction

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

Repo structure

  • backend - Python FastAPI backend
    • main.py - All the backend routes, e.g. for authentication or data retrieval
    • 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

Local installation

Configuration

Before running the app locally, you have to:

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

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

  3. Create the backend/.env file based on backend/.env.example and set OIDC_CLIENT_ID and OIDC_CLIENT_SECRET variables with the values from the previous step.

  4. Additionally, if you host your own party configuration, then set the corresponding key as PRIVATE_KEY, set PRIVATE_KEY_ID and update PARTY_CONFIGURATION_DOMAIN.

Pre-requisites

  • Python 3.9+ - For running the backend
  • Poetry - Python dependency management tool
  • Node - For running the frontend
  • pnpm - 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.

example-app's People

Contributors

fbjorn avatar lietu avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.