About • Tech Stack • Getting Started • Development • Deployment • Contributing • Licensing
This repository hosts the source code for the reference implementation of the iGrant.io Dataspace Backend. The backend provides REST APIs for managing agreements, credentials, organisations, services, and B2B connections within the iGrant.io ecosystem.
| Technology | Version | Purpose |
|---|---|---|
| Python | 3.8+ | Programming language |
| Django | 3.0.x | Web framework |
| Django REST Framework | 3.13.x | REST API toolkit |
| SimpleJWT | 4.3.x | JWT authentication |
| Poetry | 1.x | Dependency management |
| Gunicorn | 20.x | WSGI HTTP server |
| PostgreSQL | - | Production database |
| SQLite | - | Development database |
| Ruff | 0.11.x | Linter and formatter |
- Python 3.8 or higher
- Docker (recommended for development)
- Poetry (for local development without Docker)
-
Clone the repository:
git clone https://github.com/decentralised-dataexchange/data-space-backend.git cd data-space-backend -
Build the Docker image:
make build
-
Run the development server:
make run
-
Open http://localhost:8000 in your browser.
Django admin dashboard is accessible at http://localhost:8000/admin/ with default credentials:
| Field | Value |
|---|---|
| admin@example.com | |
| Password | admin |
| Command | Description |
|---|---|
make |
Show all available commands |
make build |
Build the Docker image |
make run |
Run backend locally for development |
make build/docker/deployable |
Build deployable Docker image for staging/production |
make publish |
Publish Docker image to registry |
make deploy/staging |
Deploy to staging K8s cluster |
make docs/run |
Run OpenAPI documentation |
make docs/bundle |
Bundle OpenAPI documentation |
data-space-backend/
├── authorization/ # Authorization and permissions
├── b2b_connection/ # B2B connection management
├── config/ # Application configuration
├── connection/ # Connection handling
├── customadminsite/ # Custom Django admin site
├── data_disclosure_agreement/ # Data Disclosure Agreement templates
├── data_disclosure_agreement_record/ # DDA records
├── dataspace_backend/ # Main Django project settings
├── discovery/ # Discovery services
├── notification/ # Notification system
├── oAuth2Clients/ # OAuth2 client management
├── onboard/ # User onboarding and authentication
├── openapi/ # OpenAPI documentation
├── organisation/ # Organisation management
├── resources/ # Docker and deployment resources
├── service/ # Service management
├── software_statement/ # Software statement handling
├── webhook/ # Webhook integrations
├── Makefile # Build and development commands
├── manage.py # Django management script
└── pyproject.toml # Python dependencies and tools config
For production deployment, configure the following environment variables:
| Variable | Description |
|---|---|
ENV |
Set to prod for production mode |
POSTGRES_NAME |
PostgreSQL database name |
POSTGRES_USER |
PostgreSQL username |
POSTGRES_PASSWORD |
PostgreSQL password |
POSTGRES_HOST |
PostgreSQL host address |
DATA_MARKETPLACE_DW_URL |
Data marketplace DW URL |
DATA_MARKETPLACE_APIKEY |
Data marketplace API key |
-
Install Poetry:
pip install poetry
-
Install dependencies:
poetry install
-
Run migrations:
poetry run python manage.py migrate
-
Create a superuser:
poetry run python manage.py createsuperuser
-
Start the development server:
poetry run python manage.py runserver
-
Build the deployable image:
make build/docker/deployable
-
Publish to registry:
make publish
-
Deploy to staging:
make deploy/staging
We welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
If you find any problems, please create an issue in this repository.
Copyright (c) 2023-25 LCubed AB (iGrant.io), Sweden
Licensed under the Apache 2.0 License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the LICENSE for the specific language governing permissions and limitations under the License.