Ionic Framework / .NET application sync? - javascript

I want to create a Android application (using Cordova/PhoneGap Ionic Framework, which means it's source code will be JavaScript + HTML + CSS and AngularJS as well. I need that app to sync to a cloud database service, but, I also have a .NET based project, which need to sync to the same database. I wanted to use like a Firebase-ish backend, that could manage all the database stuff, as I wrote only (at least mostly) front-end code for my app. Keeping in mind that I need a NoSQL database service.
To give an example:
I want my app to communicate with, let's say, CouchDB (IrisCouch on the cloud to be specific), and my .NET project to listen to the changes my app makes to the database, and handle them. What I need is a platform where I only need to call API's functions, or the closest I can get to that. I tried Firebase already, but that will get too expensive, as I need something cheaper, at least for now. Am I expecting too much? Do I really need to write server-side code in this case, and if so, which would you guys think it's the best way?

For back-end you can use ASP.NET Web-API which supports ASP.NET Identity with OAuth login like Facebook, Twitter etc. and on front-end you can you use IonicFramework with AngularJs to call those API.
Helpful resources:
ASP.NET
IonicFramework
AngularJS
Restangular (Restful operations made easy for angular)

Related

Using ASP.NET MVC or Web API 2 backend + Angular for dashboard platform

I am trying to create a web-based dashboard platform and framework. The techniques I think about using is either ASP.NET MVC 5/6 (backend and frontend integrated) or a ASP.NET Web API 2 backend and an Angular frontend.
The application should function as an application (host), but also as a framework in which applications can be made. An application in this case is a small web application which can be shown on the dashboards. One of the main bottlenecks I came across is figuring out a way to instantiate the same application multiple times on a dashboard. Since by default doing this introduces ID collision between multiple HTML elements on the web page.
I know Angular kind of 'solves' this problem for you since the scope of your application (looking at an application like it's a component) is maintained by the Angular framework. The reason I mention ASP.NET Web API is because I'd then like to use this as a backend where all the configurations of the applications is stored.
ASP.NET MVC does not (as far as I know) allows you nice ways to handle this, except for rendering the HTML on the server and replacing all HTML ID's to something unique. But even when you manage to do that, you still have the issue of your js files referring to the old not-unique HTML elements. This could then maybe be fixed by using a JS framework that allows you to do such thing.
The reason I ask this question is because I have a lot of experience in the .NET framework and very little experience using Angular. The choice for Angular seems more suited for this use case, but due to my lack of experience in Angular, I am not able to make an arguable choice. I have some experience in ASP.NET MVC specifically, but not enough to also think of a nice way of handling the ID collision issue.
Therefore my question to you, the StackOverflow community, is do you have any experience using any of these frameworks? And if so, what would you choose and why do you think the choice is better suited for the job?
Use angular 2 (or 4) and webapi. Through use of components and parameterized directives, that can solve it. If you need good authentication, that will have to be dealt separately.

is DjangoRestFrameWork really needed for a website

Is it worth it to use DRF+Ajax+bootstrap to build a website where no app is needed, or is it better to stick to the normal django template language without even Ajax? I want to avoid using angular since I don't want things to get complicated.
I want to create a website where a user or an admin logs in and accesses a different set of views and performs different actions.
Sorry for my primitive question, I'm a newbie in web development and Django.
Django REST Framework is only necessary if you're building a RESTful API; An HTTP service that reads and writes data, usually as JSON payloads.
Services are typically created to allow external clients such as mobile apps, single page applications (React, Angular, etc.) or 3rd parties to gain access to your data.
It is not necessary to create a service if you just want a traditional "form-based" web application. What you're describing in your question is totally possible with the standard Django implementation. User logins, user access levels, database access via the ORM and templating are all built in. All without any need for a REST service.
You can always add Django REST Framework later when you know you'll need RESTful services since DRF uses the same models that the normal views do, it just wraps them in serializers.
You can accomplish what you're suggesting easily without any special additions or changes to Django. Just because a certain way of development is popular does not mean it works in every situation.

Creating a RESTful api for my Ionic app

I have created an Ionic app which uses pouchdb to store items locally and then syncs them with remotely with couchdb
I am looking to create a REST api for this app which uses the items stored in my couchdb from the app. A web app will also show all of the items from the mobile ionic app.
I have experience with Node using Express. Would node/express be the best/easiest thing to use when building the api build? Or is there another much simpler more popular way?
You can use Firebase https://firebase.google.com/, it' a mobile platform that helps you quickly develop high-quality apps
If you're not completely set on using NoSQL on your API, you should really take a look at Django Rest Framework.
If you can map your data to objects, I'm sure you can go from zero knowledge to having an API up in hours. The quickstart tutorial is fully functional and you can set that up in just minutes! Plus, having more frameworks and languages under your belt can only be a good thing.
There's a Node client which you can use in your Expresss server for Couch DB called Nano , just like you would use mongoose for dealing with MongoDB . Since CouchDB already provides the ability to retrieve data using http, so you can even use an http wrapper like request but you can use Nano for a higher level abstraction.
You can then go ahead build an API that simply proxies those requests to your CouchDB instance.

Angular and Database Access : Proper Practices

I get the general idea at this point, angular.js is client-side, so any attempts to do database communication is done via initiating get/post requests to a server-side script on the server (via node, php, asp.net, whatever you're using)...
Only thing I haven't been able to determine is what's the proper practice for this in both conventions/security : do you make specialized pages for many of your particular queries, or 1 to a few general purpose pages that run whatever passed in as parameters. That latter option seems like a security nightmare but at the same time making a page for each table's select,insert,update, etc also seems nonviable.
To be clear and try and focus this back to a single question, it feels like I'm missing a concept here. How do you structure the database calls for an angular.js application?
From a security standpoint it isn't very different than a traditional web app. Your web server sends and receives json (most likely) instead of html. This means using something like rails-api instead of full rails. It's best to think of your Angular app as completely disconnected from your web server like an Android or iOS app is.
You might use token based authentication instead of cookies (nothing would preclude you from using token based auth in a traditional web app but I wouldn't say it's commonplace in traditional web apps). Other than that any concepts that apply to securing a traditional web application apply to securing an API.
What database do you use? Structure depends on the app you're building and if DB is relational or not. It's a strategic question, for example it may be better to have nested documents, or not.

Symfony2 + NodeJS + AngularJS?

I want to start the development of an real time and single-page application with authentification, actions, and notifications.
Is it possible to make the back-end treatment with Symfony whom I know well, and to add NodeJS / AngularJS by above?
This plan will help you has to understand me. Is it possible to apply it, and is it a good practice?
First, I believe we need to clarify some misunderstandings regarding the real time and AngularJS. AngularJS $http and $resource use Ajax in the background.
To have real time communication where the server pushes information to the client (instead of responding to Ajax calls), you would have to use Websockets. There are several alternatives in this domain, for example, socket.io integrates very well with nodejs, Ratchet socketo.me is specific for PHP, or you can use a 3rd party like Pusher through github.com/pusher/pusher-angular.
Second, you can certainly invoke PHP scripts from nodejs, however, unless you have a very specific reason to do so, it seems to me that it defeats the purpose of using nodejs. If you do not have such a requirement on use nodejs.
Of course yes.You can have nodejs and symfony2 in your server.you can use nodejs inside Symfony2 using CLI method.in front-end you can use angular and nodejs (converted).There is nodejs package,which lets you to convert your nodejs code to browser(browserify) side code and you can use it with angularjs.NodeJs has a package called socket.io.You can use it to have biDirectinal connection between server and client.

Categories