{"id":23740205,"url":"https://github.com/mustaddon/grpcfilestorage","last_synced_at":"2026-01-29T03:02:35.990Z","repository":{"id":115863864,"uuid":"413110288","full_name":"mustaddon/GrpcFileStorage","owner":"mustaddon","description":".NET gRPC file storage service","archived":false,"fork":false,"pushed_at":"2024-11-22T06:19:20.000Z","size":269,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-22T09:35:02.662Z","etag":null,"topics":["blob-storage","csharp","dotnet","dotnet-core","dotnetcore","file-storage","filestorage","grpc","microservice","netcore"],"latest_commit_sha":null,"homepage":"","language":"C#","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/mustaddon.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}},"created_at":"2021-10-03T15:02:56.000Z","updated_at":"2024-11-22T06:23:01.000Z","dependencies_parsed_at":"2023-06-08T11:00:21.711Z","dependency_job_id":null,"html_url":"https://github.com/mustaddon/GrpcFileStorage","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/mustaddon%2FGrpcFileStorage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mustaddon%2FGrpcFileStorage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mustaddon%2FGrpcFileStorage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mustaddon%2FGrpcFileStorage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mustaddon","download_url":"https://codeload.github.com/mustaddon/GrpcFileStorage/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231970943,"owners_count":18453930,"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":["blob-storage","csharp","dotnet","dotnet-core","dotnetcore","file-storage","filestorage","grpc","microservice","netcore"],"created_at":"2024-12-31T09:47:27.282Z","updated_at":"2026-01-29T03:02:35.601Z","avatar_url":"https://github.com/mustaddon.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GrpcFileStorage [![NuGet version](https://badge.fury.io/nu/GrpcFileStorage.svg)](http://badge.fury.io/nu/GrpcFileStorage)\ngRPC file storage\n\n\n## Features\n* Storing metadata in the database (SQL/NoSQL)\n* Storing files in the file system\n* Deduplication of files by content\n* Distributed storage (multiple disks)\n\n\n![](https://raw.githubusercontent.com/mustaddon/GrpcFileStorage/main/Examples/diagram.png)\n\n\n## Example #1: Simple gRPC microservice\n```\ndotnet new web --name \"GrpcService\"\ncd GrpcService\ndotnet add package GrpcFileStorage\ndotnet add package DistributedFileStorage.EntityFrameworkCore\ndotnet add package Microsoft.EntityFrameworkCore.SqlServer\n```\n\nprogram.cs:\n```C#\nusing Microsoft.EntityFrameworkCore;\n\nvar builder = WebApplication.CreateBuilder(args);\n\n// add services to the container\nbuilder.Services.AddGrpc();\nbuilder.Services.AddDfsEfc(options =\u003e\n{\n    // add database provider \n    options.Database.ContextConfigurator = (db) =\u003e db.UseSqlServer(\"Data Source=(localdb)\\\\MSSQLLocalDB;Initial Catalog=DfsDatabase;Integrated Security=True;Persist Security Info=False;Pooling=False;MultipleActiveResultSets=False;Connect Timeout=60;Encrypt=False;TrustServerCertificate=False\");\n\n    // add path construction algorithm \n    var rnd = new Random();\n    options.FileStorage.PathBuilder = (fileId) =\u003e Path.GetFullPath($@\"_dfs\\fake_disk_{rnd.Next(1, 3)}\\{DateTime.Now:yyyy\\\\MM\\\\dd}\\{fileId}\");\n});\n\nvar app = builder.Build();\n\n// map gRPC service to the endpoint\napp.MapGrpcFileStorage();\n\napp.Run();\n```\n\n\n\n## Example #2: Simple console client\n```\ndotnet new console --name \"ConsoleClient\"\ncd ConsoleClient\ndotnet add package GrpcFileStorage.Client\n```\n\nprogram.cs:\n```C#\nusing GrpcFileStorage.Client;\n\n\n// create client\nusing var client = new FileStorageClient\u003cstring\u003e(\"https://localhost:7272\");\n\n// upload\nusing var uploadFile = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(\"test text\"));\nvar fileId = await client.Add(uploadFile, $\"example.txt\", \"my metadata\");\n\n// get info\nvar fileInfo = await client.GetInfo(fileId);\nConsole.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(fileInfo));\n\n// download \nusing var downloadFile = File.Create(\"example.txt\");\nawait foreach (var chunk in client.GetContent(fileId))\n    await downloadFile.WriteAsync(chunk);\n```\n\n\n[More examples...](https://github.com/mustaddon/GrpcFileStorage/tree/main/Examples/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmustaddon%2Fgrpcfilestorage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmustaddon%2Fgrpcfilestorage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmustaddon%2Fgrpcfilestorage/lists"}