Image manipulation using Node.js on Azure website - node.js

I'm developing a web project using Node.js where users can set their profile image by uploading it to the server.
I need to perform basic manipulation on those images (resize and crop), and then store them into a blob.
I usually use GraphicsMagic or ImageMagick to achieve this kind of tasks, but I want to publish this project on Microsoft Azure website.
Is there a known and safe way to manipulate images serverside into an Azure website using Node.js?

You can use node modules with Azure Websites. However you cannot install any third party apps on the Web Sites (thus no ImageMagick or Graphics Magic).
Looking out in the wild, you may find some native node modules that does not require external components to manipulate images like the lwip and probably some more. Just find your module that is not dependent on external third party libraries and is fully self contained.

I made imagemagick work on azure websites by using site extension.
You can check the repository for more info:
https://github.com/fatihturgut/azure-imagemagick-nodejs

Related

How to create shareable libraries for Desktop, Web and Mobile Apps (Electron.JS, Angular, NativeScript)

Can anyone guide me for how to create separate libraries for models (Reusable Libraries)?
For example,
If I want to create web, desktop and mobile app, so I required models and services files in all projects to communicate with my API.
I required to models in all projects (Server, Web, Mobile and Desktop App) and Services which can communicate with node.js API (web, Mobile and Desktop App). I don'n want to create files in all project, instead of this I want to create one shareable libraries for models and functions.
Can you guide me how to achieve this type of project structure OR best suitable architecture.
I am a Microsoft Stack developer. So, I can follow this structure in .net but how can I achieve this using node.js or TypeScript?
You can develop a node module which will be reusable by any project using node run-time.
For a basic understanding, go through a medium article
How to Easily Share Reusable Modules in Node.js - at Scale
Note: I'm not an author/promoter of this medium article.

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 can I convert a HTML template into a Node.JS web app

I'm starting out on my Node.JS journey and I discovered a fantastic boilerplate over at https://github.com/azouaoui-med/pro-sidebar-template. I'm unsure though how to turn the static html into a web app. Just wondering how someone with more experience would do this?
Do I take the html and translate it into a PUG template file? I'm guessing to then make the onclick / links actually run some code, i'd need to point them at the routes setup in the web app?
Sorry to ask such inexperienced questions, web apps seem to take a vastly different approach to the desktop apps i'm familiar with programming
I'm wanting to create a web app that runs on a server, which I will later put on the desktop via electron.
thanks
The project you have is using browser-sync which indirectly uses NodeJS to run a local server and host the web application files.
Do I take the HTML and translate it into a PUG template file?
I am not sure about this question unless you specifically want to use server-side rendering I am not sure I would recommend this to start with especially if you plan to later convert this to a desktop application.
[Note* - Assuming you are referencing this library PUGJS in statements above ]
Now For this requirement I'm wanting to create a web app that runs on a server, which I will later put on the desktop via electron.
This will require you to make your data serving layer which is most commonly called backend separate from that of the data viewing layer which is most commonly referred to as front-end. Thus a case for using the same data layer across different types of clients viz. A web application and/or A desktop application ( electron if you choose so )
Step 1 - Define what sort of web application architecture you want to follow or use. This will be based on your project and business requirements. From what information I have so far I would suggest a simple client-server architecture where your frontend or web-application is the client which makes REST API calls to the backend (API Server) and thus produces a meaningful result.
Step 2 - Start with the creation of 2 projects a frontend where your HTML, CSS JS, etc will be and a simple NodeJS script to serve this static web app when deployed on the server. I am going with NodeJS since the context of this question is suggesting the same.
Step 3 - The other project which will only be an API Server or Backend. This server will provide only REST API to the frontend. This server will talk to the database and provide other services like authentication and logging etc. You can use expressJS for this also in the frontend project.
Here is a simplistic representation of the client-server model which you can reference.
Some additional links for you to digest.
What is the difference between a web application and a client/server application?
https://medium.com/codiumclub/web-application-architecture-part-1-guide-to-become-full-stack-developer-cc9526a3519b

How to create and display a custom base map with ESRI Leaflet?

The educational web app I'm working on makes use of ESRI base maps displayed with Leaflet. (See CODAP and click the Map tool.) One of our partners would like to be able to use a base map that displays biomes as, for example, displayed here.
ESRI supplies a bunch of useful base maps. But how do I create my own? And can I start with an image like the one linked to above?
typically people use either ArcMap or ArcGIS Pro to publish their own content as services hosted either on ArcGIS Online or their own installation of ArcGIS Server, but its also possible to upload shapefiles, csvs and other files into ArcGIS Online directly using the website.
https://doc.arcgis.com/en/arcgis-online/share-maps/publish-features.htm
http://doc.arcgis.com/en/arcgis-online/share-maps/use-hosted-layers.htm
anyone can get a perpetual free account for R&D and non-commercial service hosting by signing up on our Developers website.
https://developers.arcgis.com

Metro Ui Security Architecture

Does anyone know of any article/publication on the security architecture of Metro app?
For example, can the metro app call an external service. If it can,
under what condition. Will it prompt the user first? And if so will
they be able to change their restriction later and how?
Cross domain scripting in a website is usually considered a big
no-no. But if I were to turn the same code into a metro app (since
presumably they're both written in Html 5 + js), does it mean I can
make ajax calls to any server irrespective of their domain? Is it
even possible to port a website into an app? If so how easy is that?
What about accessing local file system? Or does it have to go
through the contracts to do so?
And this is kind of related but if I were to write a website (not an
app). And the site was opened using Metro IE10, can it subscribe
into the metro specific js events? I guess I'm trying to figure out
how to save cost by doing as little development as possible. I
prefer a website that can target multiple platforms and only target
specific platform for the features that absolutely require it - also
not to thrilled with the idea of having to go through microsoft in
order to publish my app.
Any help appreciated.
Metro applications can call into web services located on other machines, but their ability to interact with the local machine is severely limited.
Similarly, accessing arbitrary parts of the local filesystem is not permitted. If your application has the documents (or music or photos) library permission, it can access the files in those libraries.

Resources