{"id":21343689,"url":"https://github.com/catalystcode/trusted-document-api","last_synced_at":"2025-08-27T19:16:44.723Z","repository":{"id":73517201,"uuid":"110592915","full_name":"CatalystCode/trusted-document-api","owner":"CatalystCode","description":null,"archived":false,"fork":false,"pushed_at":"2019-01-08T19:05:12.000Z","size":501,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-01-22T15:48:00.172Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CatalystCode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2017-11-13T19:36:47.000Z","updated_at":"2019-01-08T19:05:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"2d00b7f6-370a-4af7-ae7c-243568c3d960","html_url":"https://github.com/CatalystCode/trusted-document-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CatalystCode%2Ftrusted-document-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CatalystCode%2Ftrusted-document-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CatalystCode%2Ftrusted-document-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CatalystCode%2Ftrusted-document-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CatalystCode","download_url":"https://codeload.github.com/CatalystCode/trusted-document-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243818199,"owners_count":20352629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-22T01:14:50.223Z","updated_at":"2025-03-16T03:14:21.541Z","avatar_url":"https://github.com/CatalystCode.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Trusted Document API\n\n**This is a proof of concept and is not suitable for production use without additional security and reliability considerations.**\n\nThe purpose of Trusted Document API is to provide a simple way to manage sensitive documents (e.g wills) with the ability to provide an unmodifiable transaction history.\n\n![alt text](https://raw.githubusercontent.com/CatalystCode/trusted-document-api/master/readme/schema.png)\n\n### Blockchain\nIn order to have an unmodifiable history of the document we record all transactions to Ethereum blockchain. The document will be stored off-chain (on Azure Blob Storage), but we will keep the document's hash in the blockchain using module [ethproof](https://www.npmjs.com/package/ethproof). This creates a permanent record of a document hash at a specific date and time, allowing us to prove when it was originally written and when modifications happaned.\nWe require either private or public blockchain to be setup before using our applicaion and environment variables ETHEREUM_PRIVATE_KEY, WALLET_DESTINATION_ADDRESS and BLOCKCHAIN_RPC_HOST to be set. For test purposes you can use free public blockchain [rinkeby](https://rinkeby.infura.io/).\n\n### Authentication\nWe use Azure Active Directory B2C for identity. Follow [these steps](https://azure.microsoft.com/en-us/trial/get-started-active-directory-b2c/) to create and configure your Azure AD B2C Directory and set environment variable AAD_TENANT_ID, AAD_B2C_CLIENT_APPLICATION_ID, AAD_B2C_POLICY_NAME.\n\n### Storage\nFor storing revisions of the documents we use Azure Blob Storage. To create Azure Storage account, follow [this tutorial](https://docs.microsoft.com/en-us/azure/storage/common/storage-quickstart-create-storage-account-powershell?toc=%2fazure%2fstorage%2fblobs%2ftoc.json), then set environment variable AZURE_STORAGE_CONNECTION_STRING. You can enable encryption for data at rest, following [this tutorial](https://docs.microsoft.com/en-us/azure/storage/common/storage-service-encryption). Revisions of the document are stored in one container per user. \n\n### Database\nWe use mongo to store permissions and transaction hash in blockchain. We require envioronment variable MONGODB_URI to be specified (except local deployment). You can use any database service, including [Azure Cosmos DB](https://docs.microsoft.com/en-us/azure/cosmos-db/). \n\n### Asynchronous jobs\nIn order to let user manage documents using our API without much waiting, we do Blockchain operations in cron jobs. Every minute (use can change interval by setting cronJobInterval in config/default.js) we find revisions of the documents in database that don't have transation hash and publish these transactions to the Blockchain. After transaction is recorded to Blockchain, we update database with block number and transation hash. \n\n\n## Deployment\n\nDevelopment and deployment of this application is completely dockerized. Just run [`docker-compose up`](https://docs.docker.com/compose/install/) (usually installed with docker) for local deployment. API and sample web app will be running on port 3000 (unless env variable PORT is set)\n\nRequired environment variables (described above): AZURE_STORAGE_CONNECTION_STRING, AAD_TENANT_ID, AAD_B2C_CLIENT_APPLICATION_ID, ETHEREUM_PRIVATE_KEY, WALLET_DESTINATION_ADDRESS\n\n\n## Sample web app that uses API\n\nSource code for sample web app that uses API can be found in /public folder.\nIt provides a simple UI to demostrate besic features of Trusted Document API: upload/update document and get transaction history for document. To be able to use these featues user has to be authenticated with AAD.\n\n![alt text](https://raw.githubusercontent.com/CatalystCode/trusted-document-api/master/readme/sample-web-app.png)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatalystcode%2Ftrusted-document-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcatalystcode%2Ftrusted-document-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatalystcode%2Ftrusted-document-api/lists"}