Ember.js + Ember Data + PostgreSQL - javascript

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.

Related

How can I write to my lowdb-Database from the frontend, using next.js?

I am a hobby programmer with some experience in React, primarily using Firebase for my backend. Recently, I have started using Next.js and am wondering if I can use it as a small JSON-based database for local applications on my Raspberry Pi. I have set up LowDB and can access it from server-side rendered components, but I am unsure of the best way to make them accessible from interactive frontend components, such as allowing user input and saving it to the database. I have considered using Next.js's own API endpoint, but I am unsure if this is the most efficient and desired method. It feels strange to use a DB query in server-side components but an API for data changes.
NextJs as great framework derived from React, its more for UI frontend, for interacting with DB normally you would use an NodeJS API framework like NestJs or simply Express with some kickstart templates.
You will not like use SSC since its just not the way/goal it was designed. like dentist doctor doing eye check haha
Happy coding!

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

How do I connect my postgresDB to Ionic?

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.

Is Node.js suitable for my project given how I'm using it?

I'm about to start writing an application and I want to include newer technologies to improve my knowledge and gain a skill set.
I'm using mysql to store user data (no choice), Angular.js to display/template content on the dom, and I wanted to use node.js to return results from the database in json format to be used by Angular.js.
My assumption was I could use node.js (along with the node-mysql module and maybe express)to accomplish my database queries that feed into my Angular.js templates.
Additionally, the application will live on a different server than the database itself and may reside in a mobile framework.
Am I way off base when it come to how to use node.js? Am I just using the wrong tool? Am I on the right track?
Any help, explanation, and points in the right direction would be great. Most of the info I've seen are copy/paste from the node.js site/wiki and don't really answer my question.
This is largely an opinion-based question and likely to be closed, but you're not way off base. What you want to do is absolutely (and commonly) done using Node.js.
As a complete aside, you might like to check out Platform-as-a-Service providers such as Heroku.com and Nodejitsu.com; both offer great and easy Node.js hosting and addons (such as NoSQL and RDBMS data stores) which have free tiers.
For that matter, MongoLab and MongoHQ both offer free tiers independent of Heroku, which you could use from your MySQL-only hosting provider if you like.

Node.js support for Exporting excel and Database

I am new to node.js.
I am currently in a pre-development phase of an application.
The application will be for tracking status of task of employee. The admin will have the right to export excel which will have data of employes for a given date range
Currently I am thinking WCF Service and SQL Server for the backend.
Few days back, someone told me about node.js and it's capabilities. And yes I was impressed
I wanted to know if I write a service with node.js, how will the service be hosted, also if I can write code for exporting data in excel, and lastly which database providers/adapters does node.js support?
Apologies if there is typo or this question need to be asked in any other community of stackExchange.
Thanks in advance
This is a great and simple plugin for Node to export Excel (xlsx).
https://npmjs.org/package/excel-export
As for the database, I'd recommend using MongoDB as it stores JSON. It's a bit getting used to, but you'll like the concept of documents and it's query capabilities. If you do get into it, here's a shortcut (took me a long time to wrap my head around this):
MongoExplorer (Silverlight MongoDB Manager):
http://mongoexplorer.com
*took me a long time to understand the connections of DBs, collections and then documents. Mongo Explorer really helped.

Categories

Resources