diff --git a/QRBee/QRBee.Android/Resources/Resource.designer.cs b/QRBee/QRBee.Android/Resources/Resource.designer.cs
index 97c8062..b3b03d1 100644
--- a/QRBee/QRBee.Android/Resources/Resource.designer.cs
+++ b/QRBee/QRBee.Android/Resources/Resource.designer.cs
@@ -14,7 +14,7 @@ namespace QRBee.Droid
{
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "12.1.0.11")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "12.2.0.155")]
public partial class Resource
{
diff --git a/QRBeeApi/.config/dotnet-tools.json b/QRBeeApi/.config/dotnet-tools.json
new file mode 100644
index 0000000..23f4f07
--- /dev/null
+++ b/QRBeeApi/.config/dotnet-tools.json
@@ -0,0 +1,12 @@
+{
+ "version": 1,
+ "isRoot": true,
+ "tools": {
+ "dotnet-ef": {
+ "version": "6.0.3",
+ "commands": [
+ "dotnet-ef"
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/QRBeeApi/Program.cs b/QRBeeApi/Program.cs
index 61a6167..982096f 100644
--- a/QRBeeApi/Program.cs
+++ b/QRBeeApi/Program.cs
@@ -37,7 +37,7 @@ builder.Services
var app = builder.Build();
// Configure the HTTP request pipeline.
-if (app.Environment.IsDevelopment())
+//if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
diff --git a/QRBeeApi/Properties/ServiceDependencies/QRBee-API - FTP/profile.arm.json b/QRBeeApi/Properties/ServiceDependencies/QRBee-API - FTP/profile.arm.json
new file mode 100644
index 0000000..92ec77d
--- /dev/null
+++ b/QRBeeApi/Properties/ServiceDependencies/QRBee-API - FTP/profile.arm.json
@@ -0,0 +1,117 @@
+{
+ "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
+ "contentVersion": "1.0.0.0",
+ "metadata": {
+ "_dependencyType": "compute.appService.linux"
+ },
+ "parameters": {
+ "resourceGroupName": {
+ "type": "string",
+ "defaultValue": "QRBeeGroup",
+ "metadata": {
+ "description": "Name of the resource group for the resource. It is recommended to put resources under same resource group for better tracking."
+ }
+ },
+ "resourceGroupLocation": {
+ "type": "string",
+ "defaultValue": "uksouth",
+ "metadata": {
+ "description": "Location of the resource group. Resource groups could have different location than resources, however by default we use API versions from latest hybrid profile which support all locations for resource types we support."
+ }
+ },
+ "resourceName": {
+ "type": "string",
+ "defaultValue": "QRBee-API",
+ "metadata": {
+ "description": "Name of the main resource to be created by this template."
+ }
+ },
+ "resourceLocation": {
+ "type": "string",
+ "defaultValue": "[parameters('resourceGroupLocation')]",
+ "metadata": {
+ "description": "Location of the resource. By default use resource group's location, unless the resource provider is not supported there."
+ }
+ }
+ },
+ "variables": {
+ "appServicePlan_name": "[concat('Plan', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]",
+ "appServicePlan_ResourceId": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', parameters('resourceGroupName'), '/providers/Microsoft.Web/serverFarms/', variables('appServicePlan_name'))]"
+ },
+ "resources": [
+ {
+ "type": "Microsoft.Resources/resourceGroups",
+ "name": "[parameters('resourceGroupName')]",
+ "location": "[parameters('resourceGroupLocation')]",
+ "apiVersion": "2019-10-01"
+ },
+ {
+ "type": "Microsoft.Resources/deployments",
+ "name": "[concat(parameters('resourceGroupName'), 'Deployment', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]",
+ "resourceGroup": "[parameters('resourceGroupName')]",
+ "apiVersion": "2019-10-01",
+ "dependsOn": [
+ "[parameters('resourceGroupName')]"
+ ],
+ "properties": {
+ "mode": "Incremental",
+ "template": {
+ "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
+ "contentVersion": "1.0.0.0",
+ "resources": [
+ {
+ "location": "[parameters('resourceLocation')]",
+ "name": "[parameters('resourceName')]",
+ "type": "Microsoft.Web/sites",
+ "apiVersion": "2015-08-01",
+ "tags": {
+ "[concat('hidden-related:', variables('appServicePlan_ResourceId'))]": "empty"
+ },
+ "dependsOn": [
+ "[variables('appServicePlan_ResourceId')]"
+ ],
+ "kind": "app",
+ "properties": {
+ "name": "[parameters('resourceName')]",
+ "kind": "app",
+ "httpsOnly": true,
+ "reserved": false,
+ "serverFarmId": "[variables('appServicePlan_ResourceId')]",
+ "siteConfig": {
+ "linuxFxVersion": "DOTNETCORE|2.1"
+ }
+ },
+ "identity": {
+ "type": "SystemAssigned"
+ },
+ "resources": [
+ {
+ "name": "appsettings",
+ "type": "config",
+ "apiVersion": "2015-08-01",
+ "dependsOn": [
+ "[concat('Microsoft.Web/Sites/', parameters('resourceName'))]"
+ ],
+ "properties": {}
+ }
+ ]
+ },
+ {
+ "location": "[parameters('resourceLocation')]",
+ "name": "[variables('appServicePlan_name')]",
+ "type": "Microsoft.Web/serverFarms",
+ "apiVersion": "2015-02-01",
+ "kind": "linux",
+ "properties": {
+ "name": "[variables('appServicePlan_name')]",
+ "sku": "Standard",
+ "workerSizeId": "0",
+ "reserved": true
+ }
+ }
+ ]
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/QRBeeApi/QRBee.Api.csproj b/QRBeeApi/QRBee.Api.csproj
index bd7fa32..b5e6d95 100644
--- a/QRBeeApi/QRBee.Api.csproj
+++ b/QRBeeApi/QRBee.Api.csproj
@@ -18,7 +18,7 @@
-
+
@@ -27,4 +27,10 @@
+
+
+ PreserveNewest
+
+
+
diff --git a/QRBeeApi/README.md b/QRBeeApi/README.md
index a5055b7..07e855e 100644
--- a/QRBeeApi/README.md
+++ b/QRBeeApi/README.md
@@ -8,4 +8,8 @@
{MongoDB folder Path}\mongod.exe --dbpath={Path to existing empty folder}
4. Save text file as StartMongo.bat file
-5. Run StartMongo.bat
\ No newline at end of file
+5. Run StartMongo.bat
+
+Initialize the database using Databasae/MOngoDB-init.js using Robo3T or Mongo CLI tools.
+This step can be avoided and collections will be created automatically, but you still have to
+cerate the database named "QRBee" and later the indexes required.
\ No newline at end of file
diff --git a/QRBeeApi/Services/Database/MongoDb-init.js b/QRBeeApi/Services/Database/MongoDb-init.js
new file mode 100644
index 0000000..27dad27
--- /dev/null
+++ b/QRBeeApi/Services/Database/MongoDb-init.js
@@ -0,0 +1,43 @@
+//sh.createDatabase("QRBee");
+
+//db["Users"].drop();
+//db["Certificates"].drop();
+//db["Transactions"].drop();
+
+db.createCollection("Users");
+db.createCollection("Certificates");
+db.createCollection("Transactions");
+
+db["Users"].createIndex(
+ {
+ "_id": 1
+ }
+);
+db["Users"].createIndex(
+ {
+ "Email": 1
+ },
+ {
+ unique: false,
+ sparse: true
+ }
+);
+db["Certificates"].createIndex(
+ {
+ "_id": 1
+ }
+);
+db["Certificates"].createIndex(
+ {
+ "ClientId": 1
+ },
+ {
+ unique: true,
+ sparse: true
+ }
+);
+db["Transactions"].createIndex(
+ {
+ "_id": 1
+ }
+);
diff --git a/QRBeeApi/log4net.config b/QRBeeApi/log4net.config
index f7b0f88..9cdced5 100644
--- a/QRBeeApi/log4net.config
+++ b/QRBeeApi/log4net.config
@@ -26,7 +26,8 @@
-
+
+
+
-
+