Azure Setup for DigiTrail
Guide how to setup Azure cloud services for DigiTrail -PictureHere-
Mobile App Service
The mobile application uses a Mobile App Service as the backend solution. The Mobile App Service is configured to use Easy Tables Node.js backend through the Easy Tables-section in Azure web portal1. The URL of the backend is set in the Constants class. The mobile application synchronises database data with the user device and uses Offline Tables2 after synchronisation when accessing database data. -PicHere-
External Resources
The application uses the HttpClient class to download files from the Internet, including trail files and images. The URL addresses of the external resources are stored in the database in “files” columns.
- Create a database connection and configure the client and server project, Section 3. https://docs.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-xamarin-android-get-started#create-a-database-connection-and-configure-the-client-and-server-project
- Work with Offline Tables. https://docs.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-dotnet-how-to-use-client-library#work-with-offline-tables
Database Structure
Tables in the database have been created using Easy Tables -section in the Azure web portal. This automatically generates all the fields required for the table to work with Easy Tables. The relations and custom data types have been assigned through SQL Server Manager3. Because Easy Tables does not apply relation rules on soft delete actions on rows, custom triggers have been created for all relations where CASCADE or NO ACTION rule applies. With the custom triggers, when a parent row is soft deleted, the relation rule is applied, either cascading when the parent row is soft deleted in the case of CASCADE rule, or reverting the soft delete in the case of NO ACTION rule. The script for creating the default database can be found in the ./database folder.
- SQL Server Management Studio (SSMS). https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-ver15 -DiagramHere-
DigiTrail project setup
Replace ./Helpers/Constants (Constants.BackendURL) with Azure backendURL