Tractus‐X SDK Challenge ‐ Build Dataspace Ready Apps FAST - eclipse-tractusx/eclipse-tractusx.github.io GitHub Wiki
Tractus-X SDK Challenge
The Tractus-X SDK challange consists of a Python programming hackathon for Junior Tractus-X Developers and for Senior Developers that have a long way developing apps in Tractus-X...
The objective of this challenge is to show how can the Tractus-X SDK help to speed up the development and reduce the complexity of the dataspace technology adoption. The main objective is to develop a simple application/script with the SDK and interact with the Tractus-X Connector and Tractus-X Digital Twin Registry.
Some development challenges with different difficulty levels will be provided.
Before you start, please read the requirements and understand how to install the library.
If you have the library installed, then you can jump to The Challenges section to start!
Requirements
-
Some basic knowledge in Python & Object Oriented Programming, please do some tutorials:
- https://www.w3schools.com/python/
- Python Documentation: https://docs.python.org/3/tutorial/index.html
-
A computer with following requirements installed:
Python 3.12
: https://www.python.org/downloads/release/python-31210/Visual Studio Code
: https://code.visualstudio.com/downloadGit Bash or Similar
: https://git-scm.com/downloads- Your Favorite API Collection App:
- Bruno (recommended): https://www.usebruno.com/downloads
- Insomnia: https://insomnia.rest/download
- Postman: https://www.postman.com/downloads/
-
(OPTIONAL) In case it is not provided for you at the workshop (at 22.05-23.05 will be provided):
Tractus-X Umbrella
(only minimal Data Exchange Components) deployed in a local DNS accessible Kubernetes Cluster (e.g. Minikube): https://github.com/eclipse-tractusx/tractus-x-umbrella/blob/main/charts/umbrella/values-adopter-data-exchange.yaml- Provider:
- 1x Tractus-X Connector
- 1x Digital Twin Registry
- 1x Simple Data Backend / Industry Core Hub
- Consumer
- 1x Tractus-X Connector
- Operator
- BPN DID Resolution Service
- Stub DIM Wallet
- Provider:
-
Access to internet to download the library with pip.
What is the Tractus-X SDK?
The Eclipse Tractus-X SDK is a modular use case agnostic library crafted by the dataspace building community for the community. It facilitates developers on their tasks of developing use case applications, speeding the development and reducing the complexity of using the several dataspace components which Eclipse Tractus-X offers.
It makes maintenance easy on a long run, and enables companies to produce their own dataspace ready applications faster and easier for certification. Allowing the developer to combine the "Building Blocks" in the way he desires in order to fulfill the requirements he has.
The Tractus-X SDK is builded replicating what the Industry Core KIT aims to provide: Interoperability for the use cases and reduction of development cost when adopting new use cases.
It was developed in Python to facilitate the understanding of the algorithms and the code. It is available in PyPi and can be used in multiple scenarios:
- Pipelines
- Jupiter Notebooks (AI, Data Analytics)
- Scripting
- Microservices (FastAPI, Flask)
- Cloud (Lambdas)
What does it offer?
The SDK Package is composed of three main modules:
- Dataspace Module
- Enable connection & usage to running multi version Tractus-X Connectors and any other operation needed for executing a "minimal" dataspace exchange.
- Industry Module
- Enable connection and handling of AAS compliant servers like the "Tractus-X Digital Twin Registry"
- Extension Module
- Allows the extension of the SDK if more use cases want to be built or other components want to be integrated in the future.
Installation & Download
The Tractus-X SDK is available at PyPi to download via pip: https://pypi.org/project/tractusx-sdk/
pip install tractusx-sdk
The latest version of the SDK shall be used >0.0.4
How to use it?
SDK Usage Tutorial: https://github.com/eclipse-tractusx/tractusx-sdk/tree/docs/sdk-usage/docs/user
The Challenge
Our aim is to empower you to use the Tractus-X SDK to create the foundation of a decentralized social network. In this challenge, you will focus on building a single Digital Twin that encapsulates your user profile, posts, and friend connections. To facilitate this, we will provide you with access to essential Tractus-X components: a Connector, a Digital Twin Registry (DTR), and a centralized Submodel Service.
This challenge offers a hands-on opportunity to explore the practical applications of decentralized identity and data management within the Tractus-X ecosystem.
What You'll Build
- A Digital Twin representing a social network user.
- This Twin will include:
- Your user profile information.
- A collection of your posts.
- A list of your friends.
- You will publish this Twin and make it discoverable using the provided Tractus-X infrastructure.
Resources Provided
- Access to a pre-configured Tractus-X Connector.
- Access to a Digital Twin Registry (DTR).
- Access to a centralized Submodel Service.
- Relevant documentation and guides for the Tractus-X SDK.
- Base definitions for the Profile, Post, and Friend submodels that you will need to modify.
Team Collaboration (Optional)
This challenge can be effectively completed by an individual or a team of two, allowing for a focused approach:
-
Backend Developer Focus:
- Dive deep into the Tractus-X SDK.
- Implement and manage the Digital Twin for the social profile.
- Modify and extend the provided Profile, Posts, and Friends submodels.
- Configure and utilize the Connector for data exposure.
- Interact with the DTR and Submodel Service.
- Essentially, build the data backbone and service layer of the social profile.
-
Frontend Developer Focus:
- Design and develop the user interface for the social network profile.
- Visualize the data (profile information, posts, friends) managed by the backend.
- Enable user interactions for creating/updating profile information and posts.
- Consider leveraging or adapting a base frontend application potentially available from an "Industry Core Hub" or similar shared resource environment if provided by the challenge organizers. This can provide a starting point for UI components and API integration.
- Collaborate closely with the backend developer to define and consume APIs for the social profile data.
What You Will Learn
By successfully completing this challenge, you will gain practical experience and understanding in:
- Core Tractus-X SDK Usage: Become proficient in using the fundamental aspects of the SDK to develop applications.
- Connector Operations: Learn how to utilize a Connector to manage and expose your Digital Twin, enabling data sharing in a controlled manner.
- Digital Twin Registry (DTR) Interaction: Understand the role of the DTR and gain hands-on experience in registering and discovering Digital Twins.
- Digital Twin Design: Develop skills in structuring data within a Digital Twin to represent real-world (or digital) entities like a social profile.
- Submodel Implementation: Learn how to define and use submodels to organize and manage specific datasets (e.g., profile information, posts) within your Twin.
- Decentralized Concepts: Get a foundational understanding of how Tractus-X enables decentralized identity and data sovereignty principles in a social network context.
Submodels
Profile
semanticId: urn:samm:io.tractusx.socialnetwork_profile:1.0.0#Profile
{
"profileId": "urn:uuid:aafcc3a3-9700-44eb-8981-08fa69f2b60f",
"profileName":"Carlos",
"businessName": "LKS Next",
"businessPartner": "BPNL50096894aNXY"
}
profileId = global_id
Posts
semanticId: urn:samm:io.tractusx.socialnetwork_posts:1.0.0#Posts
{
"postsId": "urn:uuid:580d3adf-1981-44a0-a214-13d6ceed9379",
"posts": [
{
"postId":"urn:uuid:055c1128-0375-47c8-98de-7cf802c3241d",
"content": "Eclipse Tractus-X Where we build dataspaces!",
"createdOn": "2022-02-03",
"lastModifiedOn": "2022-02-03T14:48:54.709Z"
}
]
}
postsId = global_id
Friends
semanticId: urn:samm:io.tractusx.socialnetwork_friends:1.0.0#Friend
{
"friendsId": "urn:uuid:78893046-2370-4c53-ae01-96777b137256",
"friends": [
{
"friendId":"urn:uuid:aafcc3a3-9700-44eb-8981-08fa69f2b60f",
"postsId": "urn:uuid:580d3adf-1981-44a0-a214-13d6ceed9379",
"profileName":"Carlos",
"businessName": "LKS Next",
"businessPartner": "BPNL50096894aNXY"
}
]
}
friendsId = global_id