{"id":42228707,"url":"https://github.com/interfacerproject/interfacer-dpp","last_synced_at":"2026-01-27T02:39:26.205Z","repository":{"id":324712081,"uuid":"1071421578","full_name":"interfacerproject/interfacer-dpp","owner":"interfacerproject","description":"A microservice for managing Digital Product Passports (DPP)","archived":false,"fork":false,"pushed_at":"2025-12-05T12:12:53.000Z","size":133,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-06T14:40:43.199Z","etag":null,"topics":["digital-product-passport","dpp"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/interfacerproject.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-07T10:26:10.000Z","updated_at":"2025-12-05T12:12:56.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/interfacerproject/interfacer-dpp","commit_stats":null,"previous_names":["interfacerproject/interfacer-dpp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/interfacerproject/interfacer-dpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interfacerproject%2Finterfacer-dpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interfacerproject%2Finterfacer-dpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interfacerproject%2Finterfacer-dpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interfacerproject%2Finterfacer-dpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/interfacerproject","download_url":"https://codeload.github.com/interfacerproject/interfacer-dpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interfacerproject%2Finterfacer-dpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28796985,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T01:07:07.743Z","status":"online","status_checked_at":"2026-01-27T02:00:07.755Z","response_time":168,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["digital-product-passport","dpp"],"created_at":"2026-01-27T02:39:26.147Z","updated_at":"2026-01-27T02:39:26.196Z","avatar_url":"https://github.com/interfacerproject.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Interfacer Digital Product Passport API\n\n![Go Version](https://img.shields.io/badge/Go-1.24.0-blue.svg)\n![MongoDB](https://img.shields.io/badge/MongoDB-5.0+-green.svg)\n![License](https://img.shields.io/badge/License-MIT-yellow.svg)\n\n\u003cbr\u003e\n\u003ca href=\"https://www.interfacerproject.eu/\"\u003e\n  \u003cimg alt=\"Interfacer project\" src=\"https://dyne.org/images/projects/Interfacer_logo_color.png\" width=\"350\" /\u003e\n\u003c/a\u003e\n\u003cbr\u003e\n\nA specialized microservice for managing Digital Product Passports (DPP) within the Interfacer Project ecosystem. Built with Go, Gin framework, and MongoDB, this service is designed to serve the interfacer-gui through interfacer-proxy and provides DPP EECC (Extended Environmental and Circularity Certificate) type functionality.\n\n\u003e ⚠️ **Early Development Stage**: This microservice is currently in early stage development and is being actively developed as part of the broader Interfacer Project infrastructure.\n\n## 📋 Table of Contents\n\n- [Overview](#overview)\n- [Features](#features)\n- [Architecture](#architecture)\n- [Prerequisites](#prerequisites)\n- [Installation](#installation)\n- [Configuration](#configuration)\n- [API Documentation](#api-documentation)\n- [Data Model](#data-model)\n- [Usage Examples](#usage-examples)\n- [Docker Deployment](#docker-deployment)\n- [Development](#development)\n- [Contributing](#contributing)\n- [License](#license)\n\n## 🌟 Overview\n\nThe Interfacer Digital Product Passport microservice is a core component of the [Interfacer Project](https://www.interfacerproject.eu/) ecosystem, specifically designed to handle DPP EECC (Extended Environmental and Circularity Certificate) type data. This microservice operates within a distributed architecture where:\n\n- **interfacer-gui** (frontend) communicates with this service\n- **interfacer-proxy** acts as the API gateway and routing layer\n- **interfacer-dpp** (this service) manages DPP data and business logic\n\nThe service supports circular economy initiatives by providing specialized DPP EECC functionality, enabling comprehensive tracking and management of product environmental and circularity information throughout the product lifecycle.\n\n### What is a Digital Product Passport (DPP) EECC Type?\n\nA Digital Product Passport EECC (Extended Environmental and Circularity Certificate) type is a specialized digital record focused on environmental and circularity aspects of products throughout their lifecycle. The EECC type specifically emphasizes:\n\n- **Environmental Impact Assessment**: Detailed carbon footprint, water consumption, and chemical usage metrics\n- **Circularity Metrics**: Reparability scores, recyclability information, and material flow data\n- **Extended Producer Responsibility**: Comprehensive tracking for compliance with circular economy regulations\n- **Lifecycle Management**: Repair, refurbishment, and end-of-life processing information\n- **Supply Chain Transparency**: Economic operator information and material sourcing details\n- **Compliance Certifications**: CE marking, RoHS compliance, and environmental standards\n\n## ✨ Features\n\n- **Complete CRUD Operations**: Create, read, update, and delete Digital Product Passports\n- **Comprehensive Data Model**: Supports all major DPP data categories\n- **RESTful API**: Clean and intuitive REST endpoints\n- **MongoDB Integration**: Scalable NoSQL database storage\n- **Docker Support**: Containerized deployment ready\n- **JSON API**: Standardized JSON request/response format\n- **Error Handling**: Proper HTTP status codes and error messages\n- **Performance**: Optimized database operations with timeouts\n\n## 🏗️ Architecture\n\n```\ninterfacer-dpp/\n├── cmd/\n│   └── main/\n│       └── main.go           # Application entry point\n├── internal/\n│   ├── database/\n│   │   └── database.go       # MongoDB connection and configuration\n│   ├── handler/\n│   │   └── handler.go        # HTTP request handlers\n│   └── model/\n│       └── model.go          # Data models and structures\n├── Dockerfile                # Docker configuration\n├── go.mod                    # Go module dependencies\n├── go.sum                    # Go module checksums\n└── README.md                 # This file\n```\n\n### Technology Stack\n\n- **Language**: Go 1.24.0\n- **Web Framework**: Gin HTTP web framework\n- **Database**: MongoDB with official Go driver\n- **Containerization**: Docker\n- **Architecture Pattern**: Clean Architecture with separation of concerns\n\n## 📋 Prerequisites\n\nBefore running this application, ensure you have the following installed:\n\n- **Go**: Version 1.24.0 or higher\n- **MongoDB**: Version 5.0 or higher\n- **Docker** (optional): For containerized deployment\n\n## 🚀 Installation\n\n### Local Development Setup\n\n1. **Clone the repository**:\n   ```bash\n   git clone https://github.com/interfacerproject/interfacer-dpp.git\n   cd interfacer-dpp\n   ```\n\n2. **Install dependencies**:\n   ```bash\n   go mod download\n   ```\n\n3. **Start MongoDB**:\n   ```bash\n   # Using MongoDB service\n   brew services start mongodb/brew/mongodb-community\n   \n   # Or using Docker\n   docker run -d -p 27017:27017 --name mongodb mongo:latest\n   ```\n\n4. **Run the application**:\n   ```bash\n   go run cmd/main/main.go\n   ```\n\nThe API will be available at `http://localhost:8080`\n\n## ⚙️ Configuration\n\n### Environment Variables\n\nThe application uses the following default configuration:\n\n- **MongoDB URI**: `mongodb://localhost:27017`\n- **Database Name**: `dpp_db`\n- **Collection Name**: `passports`\n- **Server Port**: `8080`\n\nTo customize these settings, modify the constants in `internal/database/database.go` or use environment variables (implementation can be extended).\n\n### Database Setup\n\nThe application automatically creates the necessary database and collection on first run. No manual database setup is required.\n\n## 📚 API Documentation\n\n### Base URL\n```\nhttp://localhost:8080\n```\n\n### Endpoints\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| `POST` | `/dpp` | Create a new Digital Product Passport |\n| `GET` | `/dpp/{id}` | Retrieve a specific DPP by ID |\n| `PUT` | `/dpp/{id}` | Update an existing DPP |\n| `DELETE` | `/dpp/{id}` | Delete a DPP |\n| `GET` | `/dpps` | Retrieve all DPPs |\n\n### HTTP Status Codes\n\n- `200 OK`: Successful GET, PUT operations\n- `201 Created`: Successful POST operation\n- `400 Bad Request`: Invalid request format or parameters\n- `404 Not Found`: Resource not found\n- `500 Internal Server Error`: Server-side error\n\n### Request/Response Format\n\nAll requests and responses use JSON format with `Content-Type: application/json`.\n\n## 📊 Data Model\n\nThe Digital Product Passport model includes the following main sections:\n\n### Core Structure (Provisional)\n\n\u003e ⚠️ **Note**: The data structure is currently provisional and subject to change during development.\n\n| Category | Description | Example Fields |\n|----------|-------------|----------------|\n| **Product Overview** | Basic product identification and specifications | Brand name, model, GTIN, dimensions, warranty |\n| **Environmental Impact** | Environmental footprint metrics | CO2 emissions, water consumption, energy usage |\n| **Reparability** | Repair and maintenance information | Service instructions, spare parts availability |\n| **Recyclability** | End-of-life and material information | Material composition, recycling instructions |\n| **Energy \u0026 Efficiency** | Power and energy-related specifications | Battery type, charging time, power ratings |\n| **Compliance \u0026 Standards** | Regulatory compliance information | CE marking, RoHS compliance, certifications |\n| **Components** | Sub-component and part information | Component descriptions, GTINs, linked DPPs |\n| **Economic Operator** | Manufacturer and supplier details | Company information, contact details, addresses |\n| **Repair Information** | Historical repair records | Repair actions, materials used, dates |\n| **Refurbishment Information** | Refurbishment history and details | Refurbishment actions, materials, dates |\n| **Recycling Information** | End-of-life processing records | Recycling actions, processing dates |\n\n### Key Data Categories\n\n1. **Product Overview**: Basic product information, specifications, and identification\n2. **Environmental Impact**: Carbon footprint, water consumption, chemical usage\n3. **Reparability**: Service instructions and spare parts availability\n4. **Recyclability**: Material composition and recycling instructions\n5. **Energy \u0026 Efficiency**: Battery information, power ratings, charging specifications\n6. **Compliance**: CE marking, RoHS compliance, and certifications\n7. **Economic Operator**: Manufacturer and supplier information\n8. **Lifecycle Information**: Repair, refurbishment, and recycling records\n\n## 💡 Usage Examples\n\n### Create a Digital Product Passport\n\n```bash\ncurl -X POST http://localhost:8080/dpp \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"productOverview\": {\n      \"brandName\": \"EcoTech\",\n      \"productName\": \"Sustainable Drill Pro\",\n      \"modelName\": \"SDP-2024\",\n      \"gtin\": \"1234567890123\",\n      \"color\": \"Green\",\n      \"warrantyDuration\": \"2 years\"\n    },\n    \"environmentalImpact\": {\n      \"co2eEmissionsPerUnit\": \"5.2 kg CO2e\",\n      \"energyConsumptionPerUnit\": \"150 kWh\"\n    },\n    \"reparability\": {\n      \"serviceAndRepairInstructions\": \"Available online and via QR code\",\n      \"availabilityOfSpareParts\": \"10 years from purchase date\"\n    }\n  }'\n```\n\n### Retrieve a Specific DPP\n\n```bash\ncurl -X GET http://localhost:8080/dpp/60f7b3b4e4b0c8a5f8e4b0c8\n```\n\n### Update a DPP\n\n```bash\ncurl -X PUT http://localhost:8080/dpp/60f7b3b4e4b0c8a5f8e4b0c8 \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"productOverview\": {\n      \"brandName\": \"EcoTech Updated\",\n      \"warrantyDuration\": \"3 years\"\n    }\n  }'\n```\n\n### Get All DPPs\n\n```bash\ncurl -X GET http://localhost:8080/dpps\n```\n\n### Delete a DPP\n\n```bash\ncurl -X DELETE http://localhost:8080/dpp/60f7b3b4e4b0c8a5f8e4b0c8\n```\n\n## 🐳 Docker Deployment\n\n### Build and Run with Docker\n\n1. **Build the Docker image**:\n   ```bash\n   docker build -t interfacer-dpp .\n   ```\n\n2. **Run MongoDB container**:\n   ```bash\n   docker run -d --name mongodb -p 27017:27017 mongo:latest\n   ```\n\n3. **Run the application container**:\n   ```bash\n   docker run -d --name interfacer-dpp-api \\\n     --link mongodb:mongodb \\\n     -p 8080:8080 \\\n     interfacer-dpp\n   ```\n\n### Docker Compose (Recommended)\n\nCreate a `docker-compose.yml` file:\n\n```yaml\nversion: '3.8'\n\nservices:\n  mongodb:\n    image: mongo:latest\n    container_name: dpp-mongodb\n    ports:\n      - \"27017:27017\"\n    volumes:\n      - mongodb_data:/data/db\n\n  api:\n    build: .\n    container_name: dpp-api\n    ports:\n      - \"8080:8080\"\n    depends_on:\n      - mongodb\n    environment:\n      - MONGODB_URI=mongodb://mongodb:27017\n\nvolumes:\n  mongodb_data:\n```\n\nRun with:\n```bash\ndocker-compose up -d\n```\n\n## 🛠️ Development\n\n### Project Structure\n\nThe project follows Go best practices with a clean architecture:\n\n- **`cmd/`**: Application entry points\n- **`internal/`**: Private application code\n  - **`database/`**: Database connection and configuration\n  - **`handler/`**: HTTP request handlers (controllers)\n  - **`model/`**: Data models and business logic\n\n### Adding New Features\n\n1. **Models**: Add new data structures in `internal/model/model.go`\n2. **Handlers**: Implement business logic in `internal/handler/handler.go`\n3. **Routes**: Register new endpoints in `cmd/main/main.go`\n4. **Database**: Extend database operations in `internal/database/database.go`\n\n### Code Style\n\n- Follow standard Go formatting (`go fmt`)\n- Use meaningful variable and function names\n- Add comments for exported functions and types\n- Handle errors appropriately\n- Use context for database operations with timeouts\n\n### Testing\n\n```bash\n# Run tests\ngo test ./...\n\n# Run tests with coverage\ngo test -cover ./...\n\n# Run tests with verbose output\ngo test -v ./...\n```\n\n## 🤝 Contributing\n\nWe welcome contributions to the Interfacer Digital Product Passport API! Please follow these guidelines:\n\n1. **Fork the repository**\n2. **Create a feature branch**: `git checkout -b feature/amazing-feature`\n3. **Commit your changes**: `git commit -m 'Add amazing feature'`\n4. **Push to the branch**: `git push origin feature/amazing-feature`\n5. **Open a Pull Request**\n\n### Contribution Guidelines\n\n- Follow Go best practices and coding standards\n- Add tests for new functionality\n- Update documentation as needed\n- Ensure all tests pass before submitting\n- Use clear, descriptive commit messages\n\n---\n\n## 😍 Acknowledgements\n\n\u003ca href=\"https://dyne.org\"\u003e\n  \u003cimg src=\"https://files.dyne.org/software_by_dyne.png\" width=\"222\"\u003e\n\u003c/a\u003e\n\nCopyleft (ɔ) 2022 by [Dyne.org](https://www.dyne.org) foundation, Amsterdam\n\nDesigned, written and maintained by Ennio Donato, Micol Salomone, Giovanni Abbatepaolo and Puria Nafisi Azizi.\n\n**[🔝 back to top](#toc)**\n\n---\n\n## 🌐 Links\n\nhttps://www.interfacer.eu/\n\nhttps://dyne.org/\n\n**[🔝 back to top](#toc)**\n\n---\n\n## 💼 License\n\n    Interfacer Digital Product Passport API\n    Copyleft (ɔ) 2022 Dyne.org foundation\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Affero General Public License as\n    published by the Free Software Foundation, either version 3 of the\n    License, or (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Affero General Public License for more details.\n\n    You should have received a copy of the GNU Affero General Public License\n    along with this program.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterfacerproject%2Finterfacer-dpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finterfacerproject%2Finterfacer-dpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterfacerproject%2Finterfacer-dpp/lists"}