How do I connect my postgresDB to Ionic? - javascript

How do I connect my postgresDB to Ionic??? I've been stuck on this for awhile. I tried looking in the docs, for videos or tutorials, but i can't find what i'm looking for.
when starting a new ionic app
where do I put my models?
Does it matter where I put my Config files for my database?
I am looking for a step by step on how to connect my postgresDB to my Ionic project?

The thing is; you can't connect Ionic to Postgres directly. No, there's no workaround, no magic involved, it's just not the way this is supposed to work. Ionic works on top of Angular and Angular is a frontend framework.
However, the way you should do it is that you basically create a (RESTful) API on your server side.
Most likely this will be made with PHP which will talk directly to Postgres and query it.
After you write your (RESTful) API then you can consume it through your services in Angular by using Angular's $resource object.
Sure, this is not a step by step answer, and it seems you're just starting in this area, so you have some learning to do on your part (REST, RESTful, $resource, services...), but I wish you good luck and if you'll have any more specific questions, don't hesitate to ask them.

Related

How to setting up a project in eclipse to program a SPA with JavaEE and AngularJS?

I'm trying to create a project all day long (in vain) to be able to write an SPA (Single Page Application) for learning purposes with JavaEE and AngularJS but I have no idea how to proceed...
I need in following topics your help:
How or which project I have to create/choose in Eclipse to be able to write in JavaEE(Backend) and AngularJS(Frontend Clientside)
What do I need to do this so?
I could not find any continue bringing sources in the net like step by step guides in setting up the project and if needed any dependencies which I will need for the project.
I would really appreciate if someone could help me at least in setting up the project so I can start coding with JavaEE and AngularJS
Thanks!
First of all you have to define your learnig criteria.There are number of ways to start learn on this.
On github you can get some boilerplates available.Using this boilerplates you can start easily.
ex. https://github.com/radcortez/javaee7-angular
you can also refer [https://medium.com/#swhp/build-single-page-application-with-java-ee-and-angularjs-4eaacbdfcd][1]
On client side you can create the application using AngularJS,Bootstrap and integrate this application with backend using API.
On server side you can create API either with latest spring boot
https://www.blazemeter.com/blog/creating-a-simple-spring-boot-api-from-scratch
or
you can create simple java application using JAX-RS and Jersey.

django with angular js vs jus javascript

I want to make a lightening-fast web application and am wondering about the best way to implement it. It's a drawing app that will need support for vector graphics, but it will use a database to store data in user accounts. Here's how I'm breaking it down in MVC terminology:
Controller: Django, hosted on GCP Python app engine
Model: CloudSQL
View: AngularJS
I'm wondering if a Javascript/JQuery approach would be better, since I could have Django handle the database operations and am worried that I'll just be adding overhead with Angular.
I'd welcome any thoughts.
Once you use Javascript framework such as Angular.js and React.js. Your backend and frontend becomes totally isolated. First thing you should do it you gotta make your django REST API. Build your logics to do the vector graphic in your django REST API and build your angular.js app in away that it will "consume" your REST API services.
For the second question, it is depending on your architecture design. If your application is going to be DOM-driven, use jQuery since still jquery still provides lots of UI stuff. However, if it's going to be data-driven and you will use Javascript to organize and display the data in efficient way, choose Angular.js.
Please leave a comment if you have more questions. Thanks!

Is there a way to allow user accounts (sign up+register) with just javascript (angular frontend and node,express server code)?

Most of what I've found uses php, or something similar.
I have an Angular frontend, and Node/express server code. No backend yet. I'm not sure how to proceed with user sign-up.
It is very unsafe to to do sign-up and so on without a backend. A backend means a thing running on server rather than client, so what it does is invisible to the users, thus making it safe. Think about how dangerous it will be when your password-checking and so on are all on client and the user can see everything - thus change everything!
However, node.js is already a backend.
For your question, please search nodejs user system then you will find a lot of answers.
Possible answers:
User Management System in node.js
https://engineering.gosquared.com/admin-systems-in-node
...
In short, you have two main ways: The first is to use a framework or a library containing that feature, and the second is to build it yourself through a tutorial.
Hope it works!
It looks like you are one step away from a MEAN stack! And yes, as Sylwit pointed out, your node/express server code is your back-end.
I would recommend you take a look into MongoDB as a database to get you started (you will need to store user credentials/registration information somewhere).
MongoDB is a NoSQL style of a database that will allow you to do what you want, assuming you write the registration and login/logout code to link up to the DB. You don't have to use MongoDB, but since you are just getting started this might be easier because the MEAN stack (Mongo, Express, Angular, Node) is a very popular stack right now and there are plenty of resources online (and on Stack Overflow) to get you started.
Check out the following guide for example:
http://jasonwatmore.com/post/2015/12/09/mean-stack-user-registration-and-login-example-tutorial

Ember.js + Ember Data + PostgreSQL

I'm having trouble understanding how to connect Ember.js with PostgreSQL using Ember Data adapter.
My main problem is finding a complete example where I can study how I would do this.
I know I have to create a jsonapi to provide the data. My goal is using Node.js to provide the data.
I've found this project here and I see that it has a relational db store.
Anyone knows where I can find a complete example of a project using Ember with a PostgreSQL jsonapi server implemented in Node.js?
Preferably a simple project where I can understand the basics of getting a connection running and show the data in Ember.
Any help appreciated. :)
I've written a boilerplate node app and a boilerplate ember app that are designed to work together as a frontend/backend app. They aren't especially simple, but if you explore them you might be able to gain some good insight into how these two frameworks can connect.
For example, in the users controller, the show method maps to /users/:id, and then responds with a custom JSON payload conforming to JSON API spec. Although it hasn't been implemented yet, in Ember simply having this.store.findRecord('user', 1) will automatically send a request to /users/1.
You can explore the config files to look at the postgres connection (I implemented using bookshelf and knex).
Hope that helps!
You actually have two questions here. You first need to choose how nodejs communicates with your ember-data. This is a possible approach. It also provides a connector to your database.
Secondly, you need to define how nodejs communicates with the db. Here is a list of possible packages that might fit your needs.

Using Ember.js with DDP / Meteor backend

After past experience with Laravel and Backbone, I've recently gotten into contact with Ember.js and Meteor (for different projects). I really like Ember.js for its structured, route-based approach and for its open and forward-thinking community. On the other hand, I really like Meteor for its simplicity; how fast you can get something working.
There is one thing that I really love about Meteor, which is the DDP Protocol. The reason I ended up using Meteor for a project was because I wanted the best Websocket solution, and DDP's simple combination of RPC for client->server and PubSub for server->client is absolutely brilliant.
Would it be possible to connect Ember.js with a Meteor backend, and how would I go about doing this?
There's some work done for AngularJs: https://medium.com/#zfxuan/the-wonderful-duo-using-meteor-and-angularjs-together-4d603a4651bf
The best option that you have currently for Emberjs is to create your own solution.
I've a background in AngularJs but I don't like the idea of using AngularJs + Meteor. The same goes for Emberjs or any other frameworks that are redundant. By adding AngularJS/Ember/others you're increasing your project complexity. Meteor is great because every plays nice together but there is still a lot of work to be done by the MDG or by community packages.
You can simply use DDP in your application but then you're going to reinvent the wheel. Meteor already handles DDP, in-browser database (minimongo), the UI is reactive (Blaze), the auth system is integrated at the client and server, etc, etc, etc.
You can use 3rd party plugins with your Meteor app but trying to replace parts that Meteor already provides is the quickest way to have a really hard project to maintain. But, in the end, it's just my opinion on this topic and you should use whatever makes you happy.
Maybe you should consider sails.js: http://sailsjs.org/ it has support for SQL systems and probably serves best your purpose.
You can indeed connect other apps to a meteor backend without using meteor on the client.
Meteor has a full wiki page on different libraries. I think that is the most up to date source for information on libraries to connect to a DDP meteor backend.
A link to the JavaScript section: http://meteorpedia.com/read/DDP_Clients#JavaScript

Categories

Resources