Using loopback with Cosmos DB - node.js

Is it possible to use Loopback 3.x with azure Cosmos DB (assuming I don't want to create my own connector)? I tried https://www.npmjs.com/package/loopback-connector-cosmosdb which isn't officially supported and I couldn't get it work. I have been looking for a quick way to set up an API on Azure (honestly I prefer SQL over CosmosDB but it seems like the simpler way to go) using NodeJS and haven't come across one yet. I started coding serverless functions for my API which work wonderfully except that adding authentication seems like a total drag and goes over my head completely. I indent to create both a web app and iOS App for what I'm developing any suggestions would be great!

Related

Best way to integrate OpenId connect / (Keycloak) with Django and Django Rest framework

I'm looking for advice on the best way to integrate Django / Django Rest Framework with OpenId connect (we're using Keycloak but I think using the protocol is probably more flexible).
There seems to be several option out there, but it would be good to have something that works as seamlessly as possible with Django and DRF – so session and API authentication working like the baked in Django version, and ideally access to external logon screens if using admin/DRF API endpoint. What is straightforward to set up and well supported?
What I will ultimately be doing is trying to change an existing Django/React application, but for the purposes of this discussion let's assume it's a basic application something like the ones set up in the Django tutorial and Django Rest framework quickstart (https://docs.djangoproject.com/en/3.1/intro/tutorial01/ to tutorial01 and https://www.django-rest-framework.org/tutorial/quickstart/).
I hope that's enough as I fairly new to this – I can create some sort of simple application in Github if this isn't a clear enough basis for a discussion.
Any help would be much appreciated. Even better if you have an example (!).

Nodejs send metrics of how many people are using my app

So i'm designing a new application with Nodejs and packaging into an executable then putting a release in github, I want to be able to monitor how many people are using my executable?
I was thinking about creating an api server and my application just make a call to that API service but I thought there might be something already out there any help?
The easiest way is to connect third party services that do that. The most famous one is Google Analytics
You just need to create your developer account and embed a few lines of tracking code. After that you can see full info about your visitors including their location.

How to start developing a web app to store data to CosmosDB in Azure

How do I get started the best way if I want to develop a quite simple web application that will store some user data into an Azure CosmosDB.
The web application should contain user authorization and everything should run in Azure. Furthermore I am pretty good in PHP and C#, which I prefer as development language.
My Question: Can any of you point me to a good tutorial or LinkedIn-Learning-Course?
I would prefer using Visual Studio Code as my primary environment.
Seems you are trying to develop a web application using cosmos db which can be run on azure portal.
Here is the nice official document you could learn step by step.
If you need code sample you can check here for code snippet
You can also find this sample for CRUD operation.
Note: I would suggest you to finish each of the document from beginning to end. So that later on you can easily grab others
tutorial.
If you still have any query feel free to share. Thanks and happy coding!

Set up Google Analytics to track a command line Node app

I'd like to use Google Analytics to track usage of a command line Node app. Tracking will be strictly opt-in. I'd like to track basic usage, plus which operating system and version of Node was used.
I've found the Measurement Protocol, but I'm wondering whats the best way to set up Google Analytics.
You can choose from Web or App - App seems the best fit, but then I'm sent to Firebase to set up an iOS, Android or Web app. None of these are correct. So is 'Web' the best way to track my app usage? Or is Google Analytics not the right approach?
Seems like the best approach is Google Measurement Protocol. There's a Node library for it.
Really Google Analytics is completely designed around web apps and more recently mobile apps, it has concepts like "page views" which don't make sense for CLIs, and Firebase Analytics is only for Android and iOS.
You might be able to shoehorn he CLI use case for some purposes. Alternatively, you could consider using a cloud database like Firebase real-time DB to capture your own events.
Google analytics really isnt designed for something like this. You have only two options web app where everything is page based. http://example.com/hello.php vs using a mobile app where everything is screen based. Home, about, help.
I have done this before with several console applications, a custom SSIS task (dll) and an arduino project. I chose mobile application mainly because i thought it was closer. I know of someone who did the same with an actions on google project.
In the end what you use will be up to you. Just consider what it is you want to track exactly and lay it out before you start.
If you choose mobile make sure you send Screen views and not page views. The Google analytics website is split you cant mix and match the hit type.
Workaround for createing moble account without firebase.
create a new web property on Google analytics type Web
create a new view under that web property type mobile.
We made Console Cat for this exact purpose! It's built from the ground up to track telemetry / analytics for CLIs including things like flags, command duration, version, etc.

Data layer for Azure Mobile App

We have ASP.NET MVC5 application. We have used entity framework DB first approach for the data layer. Now we are planning to build Xamarin mobile app.
I'm looking for the options for developing back-end of the app. In Azure Mobile app it seems you have to derive your entity from EntityData. Also I read somewhere that DB first approach is not supported.
Do I need to create each entities for my existing table manually (code first)? It would be great if someone can help in guiding to the right path.
Doing DB first is harder, but not impossible. I'd recommend reading my chapter on data https://adrianhall.github.io/develop-mobile-apps-with-csharp-and-azure/chapter3/dataconcepts/ - there is a section that deals with DB first explicitly.

Resources