{"id":26748294,"url":"https://github.com/nwestfall/caas","last_synced_at":"2025-10-27T21:05:24.889Z","repository":{"id":71019226,"uuid":"121590772","full_name":"nwestfall/Caas","owner":"nwestfall","description":"We all need another \"as-a-service\" product.  Why not configurations?  Introducing a simple to use Configurations-as-a-Service system.","archived":false,"fork":false,"pushed_at":"2018-05-30T01:48:33.000Z","size":17523,"stargazers_count":0,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-05T23:22:12.146Z","etag":null,"topics":["configurations","docker","dotnet","entity-framework","netcore-webapi","netcore2","netstandard","nuget","service"],"latest_commit_sha":null,"homepage":null,"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/nwestfall.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2018-02-15T04:23:24.000Z","updated_at":"2018-05-30T01:33:43.000Z","dependencies_parsed_at":"2023-03-13T20:22:20.322Z","dependency_job_id":null,"html_url":"https://github.com/nwestfall/Caas","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nwestfall/Caas","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwestfall%2FCaas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwestfall%2FCaas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwestfall%2FCaas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwestfall%2FCaas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nwestfall","download_url":"https://codeload.github.com/nwestfall/Caas/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwestfall%2FCaas/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278909865,"owners_count":26066929,"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","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"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":["configurations","docker","dotnet","entity-framework","netcore-webapi","netcore2","netstandard","nuget","service"],"created_at":"2025-03-28T10:17:18.858Z","updated_at":"2025-10-08T08:15:42.036Z","avatar_url":"https://github.com/nwestfall.png","language":"C#","readme":"# CaaS\nWe all need another \"as-a-service\" product.  Why not configurations?  Introducing a simple to use Configurations-as-a-Service system.\n\nWe all have applications whether the web, a desktop app, or a mobile app that need to get a config anonymously.  CaaS is designed to be quick, easy, and configurable to fit all these needs.  It's not designed to be a fancy system, it designed to pass configs.\n\nBuild Status: [![Build status](https://ci.appveyor.com/api/projects/status/9duu14is56ffo0dk?svg=true)](https://ci.appveyor.com/project/nwestfall/caas)\n\nCodeFactor: [![CodeFactor](https://www.codefactor.io/repository/github/nwestfall/caas/badge/master)](https://www.codefactor.io/repository/github/nwestfall/caas/overview/master)\n\nClient Nuget: [![NuGet version](https://badge.fury.io/nu/Caas.Client.svg)](https://badge.fury.io/nu/Caas.Client)\n\n## Quickstart\n[![Deploy to Azure](http://azuredeploy.net/deploybutton.png)](https://azuredeploy.net/)\n\n## Platform Support\n**Caas.Web**\n\nCaas.Web is build on ASP.NET Core with Entity Framework and can run on Windows or Linux.  It also includes a \"Dockerfile\" for docker support (instructions below).\n\n**Caas.Client**\n\nNo need to build a service to connect to CaaS.  We got you covered everywhere .NET Standard is.\n\n|Platform|Version|\n| ------------------- | :------------------: |\n|Xamarin.iOS|10.0+|\n|Xamarin.Mac|3.0+|\n|Xamarin.Android|7.0+|\n|Windows 10 UWP|10.0+|\n|Windows|8.1+|\n|.NET Core|1.0+|\n|ASP.NET Core|1.0+|\n|.NET|4.6+|\n|Mono|4.6+|\n\n## Quick Understanding\n\nHere is a quick intro on the project and how the data is setup.\n\n**Project**\n\nThere are two parts to this project.  Caas.Web and Caas.Client.  \n\nCaas.Web is a ASP.NET Core application meant to run on Windows or Linux either standalone or in Docker.\n\nCaas.Client is added to your application where you wish to read the configs from Caas.Web.  Requires 1 line to initialize and then you can easily start making calls.\n\n**Data**\n\nThere are 5 data classes we use.\n\n * CheckIn\n * Client\n * ClientType\n * Config\n * ConfigAssociation\n\nYou can setup your data two ways.  One with just configs that are key-value based or with configs association with a client that are then key-value based.\n\nExample #1: key-value (no client)\n\nI will create 2 configs.\n```c#\nvar config1 = new Config\n{\n    Key = \"Key1\",\n    Value = \"Value1\"\n};\n\nvar config2 = new Config\n{\n    Key = \"Key2\"\n    Value = \"Value2\"\n};\n```\nNow to read them from Caas.Client, I just need to call the following.\n```c#\nCaasManager.Init(\"http://localhost:5000\");\n\nvar config1 = CaasManager.GetConfigAsync(\"Key1\");\nvar config2 = CaasManager.GetConfigAsync(\"Key2\");\n```\n\nExample #2: key-value (with client)\n\nI will create 2 clients with configs.  One for a web app and one for a mobile app.\n```c#\nvar webClient = new Client\n{\n    Identifier = \"MyWebApp\",\n    ClientType = new ClientType\n    {\n        Name = \"Web\"\n    }\n};\nvar mobileClient = new Client\n{\n    Identifier = \"012510329714913\" //Android IMEI\n    ClientType = new ClientType\n    {\n        Name = \"Android\"\n    }\n};\n\nvar config1 = new Config\n{\n    Key = \"Key1\",\n    Value = \"Value1\"\n};\nvar config2 = new Config\n{\n    Key = \"Key1\", //Notice how it has the same key\n    Value = \"Value2\"\n}\n\nvar configAssociation1 = new ConfigAsssociation\n{\n    Config = config1,\n    Client = webClient\n};\nvar configAssociation2 = new ConfigAssociation\n{\n    Config = config2,\n    Client = mobileClient\n};\n```\nNow to read them from Caas.Client, I just need to call the following.\n```c#\nCaasManager.Init(\"http://localhost:5000\");\n\n//To call on my web client\nvar config1 = CaasManager.GetConfigForClientAsync(\"MyWebApp\", \"Web\", \"Key1\");\n//To call on my android app\nvar config2 = CaasManager.GetConfigForClientAsync(\"012510329714913\", \"Android\", \"Key1\");\n```\n\nBoth ways are acceptable use cases and you can uses one or both in your implementation.\n\n**Check-Ins**\n\nYou have your clients manually check in the to the server so you know the last time they communicated.  This can be helpful for a few things\n\n * Verify the last time the device checked in or got a config\n * Automatically create new clients so you can set new configs after there first check in (see ```CAAS_CREATECLIENTS``` enviroment variable)\n\nA client check in occurs with the following 3 requests\n\n```c#\nTask\u003cConfig\u003e GetConfigForClientAsync(string identifier, string type, string key);\n\nTask\u003cIEnumerable\u003cConfig\u003e\u003e GetAllConfigsForClientAsync(string identifier, string type);\n\nTask CheckInClient(string identifier, string type);\n```\n\nCheck-ins are stored with the client id and the datetime in UTC.\n\n## Caas.Web\n\n**Enviroment Variables**\n\nSince it is designed to run in Docker, there are a few enviroment variables you can use to setup the service.\n\n * ```SQLSERVER_HOST``` (Default: ```localhost\\\\SQLEXPRESS```)\n * ```SQLSERVER_USER``` (Default: sa)\n * ```SQLSERVER_PASSWORD``` (Default: password)\n * ```INMEMORYCACHE_USE``` (Default: \"true\")\n * ```INMEMORYCACHE_TIMEOUT``` (Default: 60) [In Minutes]\n * ```CAAS_CREATECLIENTS``` (Default: true)\n\n**Running from command line**\n\nFrom inside the ```Caas.Web``` folder, run the following\n\n```dotnet restore \u0026\u0026 dotnet run```\n\nIt be default runs on port 5000 (http) and 5001 (https)\n\n**Running from Docker**\n\nFrom inside the ```Caas.Web``` folder, run the following\n\n```cmd\n-\u003e dotnet publish -c Release -o out\n-\u003e docker build -t caas-web .\n-\u003e docker run -p 5000:5000 caas.web\nor run with enviroment variables\n-\u003e docker run -p 5000:5000 -e INMEMORYCACHE_TIMEOUT=10 -e SQLSERVER_PASSWORD=Password123 caas-web\n```\n\n## Caas.Client\nThis library is meant for you to pull into any app that you want to read configs from CaaS from.  It is very simple to use.\n\n**Setup**\n\nBefore you make any calls, just call the following line.\n\n```c#\nCaasManager.Init(\"http://localhost:5000\");\n```\n\nor if you are using Xamarin and are using something like [ModernHttpClient](https://github.com/paulcbetts/ModernHttpClient)\n\n```c#\nCaasManager.Init(\"http://localhost:5000\", new NativeMessageHandler());\n```\n\nAnd that's it!  You can now start making calls to get your configs.\n\n**Available Calls**\n\nHere is a quick reference of the calls you can make.  They currently match all the endpoints available in Caas.Web\n\n```c#\nTask\u003cConfig\u003e GetConfigForClientAsync(string identifier, string type, string key);\n\nTask\u003cConfig\u003e GetConfigAsync(string key);\n\nTask\u003cIEnumerable\u003cConfig\u003e\u003e GetAllConfigsAsync();\n\nTask\u003cIEnumerable\u003cConfig\u003e\u003e GetAllConfigsForClientAsync(string identifier, string type);\n\nTask CheckInClient(string identifier, string type);\n\nTask CheckInClient\u003cT\u003e(string identifier, string type, T extraData);\n```\n\n## FAQ\n\nHave a question?  Open up an issue.  Otherwise, here are a few.\n\n**If I connect this to an existing SQL Database, will it work?**\n\nYes.  We only use 4 tables so as long as you don't have the same names it will be fine.  They are as follows\n * Client\n * ClientType\n * Config\n * ConfigAssociation\n\nIf you wish to rename any of the tables to avoid conflict, just open the ```Caas.Models``` project and add the following attribute to the class\n\n```c#\n[System.ComponentModel.DataAnnotations.Schema.Table(\"MyClientTable\")]\npublic class Client\n```\n\n**How do I add new configs and clients?**\n\nCurrently, you will have to build a way to do this or use SQL.  We plan on coming out with a manager soon to help you do this.\n\n**NEW**: You can also have your devices \"Check In\" and if the client doesn't exist, it will create them automatically.\n\n## License\nUnder MIT (see license file)\n\n## Issues\nWe'd love to hear!  Please submit an issue through github.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnwestfall%2Fcaas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnwestfall%2Fcaas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnwestfall%2Fcaas/lists"}