Gmail-like notification Service in ASP.NET/C# - c#

I have a web-based application developed in ASP.NET. It is a business application and people do regular deals & transactions from this portal.
The application has two types of user:
1) Front-office User - who makes the deal
2) Back-office User - who look at all accounting & voucher generation work for the deal
The current problem is, to check a new deal created by a front-office user, the back-office user needs to refresh the web page every few minutes, which is very time-consuming.
I want to develop a small windows-based notification service through which I can show them notifications without going to the browser. It will be in the same manner as the Gtalk desktop tool, which notifies us of newly-received mail.
So to achieve the above thing what should I use and how to use & implement the solution ?
I need to develop the solution using .Net framework

I would look into SignalR and use that to keep a persistent connection open to your server and notify the client when new data is available. If you use SignalR, you don't even need a windows application, you can use their javascript client and show the notifications directly in the browser (you can of course still go the Windows Application route as well).
If you are in a cloud hosting environment, your cloud provider should have a service of use for you as well.

Related

Integrate Azure Dashboard in custom web applications

All my applications are using Application Insights to log their activities. I have created some queries to monitor what each application is doing or the status of them.
For personal use, I created some dashboard where I display graphs and data.
Now, I want to share this dashboard with some users. The idea is to integrate this dashboard in the company portal; so users can see the dashboard without leaving our environment or open a new tab in the browser. All my applications are build in C#. I don't want to use PowerBi.
How can I implement a dashboard in my application? What kind of configuration is it possible to have? Is there any documentation for that?
1) You'd have to use the Application Insights REST API to read data directly and write your tool to display the data (or use other existing dashboarding things that already know how to use the REST API)
or
2) add your users as "reader" users to your subscription and share your dashboards with them in the azure portal

Trying to use a xamarin app to create a user login for a website

I have a cross platform app currently designed using xamarin forms but now need to use this to create a user profile for the user, using the information provided, for a website.
Are there any add ons or plugins for something like square space or wordpress which would allow me to upload a user program via a RESTful api or something along those lines?
Basically what are my options to transfer user data from a cross platform app to a web app so that my user can then log onto the web app and see all their information?
All you need is a database that can be accessed by both your web app and your mobile app. There are numerous services that would allow you to do this.
But if your web site is going to be a WordPress site (I have never looked into squarespace) then it already uses a MySql back end for data storage. I would imagine squarespace uses a database of some sort as well. You could then create RESTFul urls on that same server to send and request data and use whatever database system that your website is using. If you don't want to implement your own service code for sending and receiveing data that can be used by both your web app and your mobile app, then you could use some service like Azure, AWS, Apigee, etc. just for the database.

Authentication for a desktop app

First of all, I took a look to every related topic on her about this issue. However non of them was successful in answering my question fully.
Currently I am working on a desktop app, coded in C#/wpf, that requires MySQL connection both for authentication and storing user custom lists etc.
However, the problem is that apparently allowing everyone to remotely connect to MySQL db is not good practice. Also, my current host requires IPs to be whitelisted before they can connect to the db.
What are my options on this?
Thank you in advance
You should look into creating a web service (SOAP), http web-api (REST) or some other middleware to abstract your data storage.
This has the benefits of:
Allows you to move much of the business logic out of your desktop app and into middle ware
Allows you to keep business logic out of sql which might be a bottleneck
Allows you to update your business logic without redistributing your desktop app (easier if you don't have direct control of all the desktops).
Allowing you to control authentication (many web servers have their own modules, method of authentication). Your app would control access and access storage under it's own service account.
Allows you to complete change your data storage (let's say in the future you store some in sql, some in mongodb, some in cloud storage - once again, without having to update all your desktops.
Allows you to scale out your front ends and even possibly scale out your backend storage (for example, read/write DB replicas)
If you're already working with C#, then the new MVC4 web-api should be a good fit. Read more here:
http://www.asp.net/web-api
If you go that route you could control access in your service and have your service access the database either via credentials in a connection string or if you use IIS, credentials on the application pool mapped to your site.
If you're shipping your desktop app (you're not hosting the DB) then you can also self host web-api in it's own exe if your customers don't want to install/manage IIS.
Finally, if your mysql is online, your middleware could be in the cloud (azure etc...)
Create a web service, such as with WCF or MVC Web API where your app can pass through their credentials and authenticate. I'd recommend https for transport security.

Architechting a complete web service, website, and iphone app

I am trying to architect a system that will have a website and an iphone app that will be driven off the same data. I understand how I would create and architect the website, but when it comes to adding the iphone app I am unsure on how it will apply.
My considerations for design:
-Using C#, SQL Server, asp.net for the website (would try to get most of my data using web services where I could)
-Using Objective-C, x-code, etc for the iphone app development
1.) Will I need to expose a web service for the iphone to interact with? If so, would that be considered a seperate web app from the actual website? Or would the webservice be built in with the website and then the iphone would interact with that web service as well?
2.) What do I need to consider, security wise, when it comes to exposing a web service?
3.) Any other architecture advice for building a system such as this? Maybe personal experiences with doing a website/iphone app that runs off the same database.
Yes you will need to expose a webservice for the application to bind/talk to. I would suggest that the service be run as a separate site (such as data.yourdomain.com, where as the site would run on yourdomain.com) which the website also uses for it's data. That way you share the same architecture for both your "end points" (site and app).
Ensuring that you webservice takes a authentication token (username/password or oauth/etc) with each call will help to prevent any unauthorised calls to the service/database. Also ensuing that your service is exposed via a valid HTTPS connection (and only https) will prevent sniffing of the data to get passwords.
As I said in point 1, build the service in such a way that it does not matter what "end point" is accessing it. That way should you add an android app or windows phone app (or even a second website) you will not need to make a fresh service. Perhaps tie each applications "account" to a "end point type" (such as Android/iPhone/WinPhone/WebSite) that will allow you to customise the data objects that you return if needed.
Will I need to expose a web service for the iphone to interact with?
If so, would that be considered a seperate web app from the actual
website? Or would the webservice be built in with the website and then
the iphone would interact with that web service as well?
It depends, if you want a native application, then you would expose the service, else you can develop an iPhone web app
What do I need to consider, security wise, when it comes to exposing a
web service?
Normal security consideration as if you would develop a web service to a windows desktop application
Any other architecture advice for building a system such as this?
Maybe personal experiences with doing a website/iphone app that runs
off the same database.
Try to make the web service as clear and light as you can
At first use use just one data source for all your projects. Expose the database with webservices. User authentication to invoke webservice procedures for security.

Good way of communicating between web and desktop app

I want my web app (running in a browser) to, at some point, communicate (bidirectionally) with a desktop app (in Windows), the client has installed in its computer.
What's an elegant and modular and simple way of doing this (with Java and C#)?
Not much information will be passed between the web app and the desktop app. Just something like "I was here", "Pick this from this point", etc.
I solved that problem by using a database on the network.
All communications where made trough the database.
Website -> DB -> User logged in <- DB <- Desktop
However, if no trusted information needs to be shared, you could consider just posting and reading some http headers to a common website, or a simple log file.
Greetings
I suggest you to use the backend part of your webapp, assuming that your app is based on some backend services.
You have two options:
Your desktop apps use the same services of your web app. You must use a class that mimic a web-browser to give the data (curl, ie). If your web app is based on AJAX push ( APE Server i.e ) use library that is able to run some javascript
Use a REST protocol, with a JSON format in your backend services. It's easy to manage and is supported by many client-side languages (java/c#/python....)
Use a specialized endpoint only for your desktop app,for C#, you can use WCF, that allow you, in one of his forms bidirectional communications. For JAVA, there are WSDL, DWR
My preferred solution is to decouple the web app in a front-end side and a backend side, that expose the services as REST that are used by the web app via AJAX.
If I need true bidirectional communication with other desktop app, I'll create a separate service / endpoint for it. (APE , WCF, ..)
I see several options to achieve part of what you are asking:
Besically you expose the relevant parts of your apps (web and desktop) via some sort of API and use that for the communication - for example DB and/or WCF (SOAP/REST/whatever).
BEWARE:
If you are after some sort of direct/interactive communication between both apps on the same computer then this won't be possible - at least not without some security related issues.
The browser executes your web app in a sandbox which doesn't allow for direct communication between the web app and the desktop... there are technologies which can help circumvent that (ActiveX, signed Java applets, some Flash technology called AIR etc.)... or you could host some webbrowser/control in your desktop app which in turn runs the web app... BUT basically I would recommend against using any such measures...
IF you really want to go this route then please describe your environment and goal with much more detail.

Categories

Resources