A rails web app, quickbooks, and mysql - mysql

I've gotta use the inventory from quickbooks in my rails web app...it would be nice if I could get quickbooks to use mysql, as that way I could just use mysql between the app and quickbooks, which would make things easy.
Does anyone know how to get quickbooks to use mysql? Or will I be forced to have my app communicate directly with quickbooks, which I wanna avoid :P

There are a few ways of integrating with QuickBooks, but if it's a web application, your best bet is to use the QuickBooks Web Connector, or to use a commercial package for SQL access.
The Web Connector is the only Intuit-supported solution to integrating with QuickBooks from a web application. Basically, you build a SOAP server / Web Service which speaks a specific set of methods. The Web Connector then is installed on the machine running QuickBooks, and polls your web service asking "Hey, got anything for me to do?" Your web service can then respond with qbXML requests (examples of qbXML here: QuickBooks qbXML Examples) which tell the Web Connector "Add this customer: ..." or "Send me invoices which match: ..." or etc. etc. etc. The Web Connector then relays those requests to QuickBooks, QuickBooks processes them, and the response is relayed back to your web service. Your web service might then process the response somehow, and then send the next request over to the Web Connector. This can continue in a loop for as long as you like, continuing to send requests to QuickBooks and receiving the responses.
You might also look into AccessBooks and QODBC. Both are commercial wrappers around the QuickBooks qbXML SDK which allow direct SQL access to QuickBooks.
Here is some additional information on my QuickBooks Integration Wiki about how to integrate applications with QuickBooks.
You might also want to search around on Google. I know there were some QuickBooks Rails packages/gems out there somewhere, but last I looked it did not support the QuickBooks Web Connector. Instead, the Rails application had to be installed on the same machine as QuickBooks, and it communicated via COM.

Pretty sure you will have to interface with Quickbooks directly. The other problem is going to be that because Quickbooks is a client-side application you will need to have an app on the client that pushes the data to the server. It's definitely doable.
Alternatively, you could just use the export functions of Quickbooks to periodically export the inventory as CSV.

http://behindlogic.com provides a Rubygem (for sale) that will deal with all of the pains of QBXML for you, and an HTTP Connector for QuickBooks that allows you to send/receive messages with QuickBooks through HTTP, which opens the door for connecting from another computer. The gem has an adapter built to use the Connector as well, so you can very quickly get up and running with QuickBooks on Windows and your Rails app on Linux or on your development Mac.
EDIT: Unfortunately, the maintainer of Behind Logic and the gem mentioned above has passed away. I hate bringing this up, however it took me a while to figure out why the GitHub repo was inactive and the site had gone down.

We have been using the Web connector for a while now, and let me tell you its been pretty smooth so far. Though the Intuit Quickbooks SDK doesn't let you do wt exactly QB UI would let you. Problems occur especially when you want to enter group items to QB using the SDK. Use a webservice and let it build requests and process responses and push the required data to your database which can simply be anything from a SQL server to MySql/Oracle etc etc. Using this approach good amount of error handling can also be done.

Related

How to keep a Rails app from being copied

I am a Ruby on Rails developer. I specialise in Point of Sale Systems. Recently, one of my customers found a way to copy my app with the DB structure and shared the app amongst his friends(theft/piracy).
How can I safeguard my app from being copied/duplicated/stollen? Can I compile my rails app so as to hide the source code?
I was also thinking about use a MAC address as one of the app sessions. This any developer can take out of the code. I thought of not installing MySQL Workbench so as to hide DB Structure, but anyone can reinstall it. What can I do secure my Rails app?
You don't distribute it as an on premises solution. You offer it as SaaS, on your own servers or the cloud.
If they only have access through the browser, they don't have access to the code and cannot copy it.
If the app is running on something they have access to, it's already lost. You can try to mitigate it through a confidentiality agreement or other contract, but that is going to be difficult to prove and enforce.

What are the risks of connecting to database directly from Electron app?

I'm fairly new at building Electron apps and I've seen a lot of examples where Electron app connects directly to a remote database (MySQL in my case) so I started wondering what the problems might be with doing it that way. My first thought was to have a remote API (built on top of Express) which would communicate with the database and Electron app (React) would just utilize that API.
Any advice? Thoughts?
Thanks.
A problem with directly connecting to the database is you have to embed the database credentials in the electron app which makes them available to anyone who wants to snoop through the code. In addition, once the credentials are exposed, you lose control over what anyone can do to your database.
This is why you would usually give the user their own credentials, have the user authenticate to a web server and then have the web server be the only one who can directly talk to the remote database. You can then completely control what happens to the database since your web server is the intermediary and the only one that actually talks to the database.
This doesn't mean that there aren't some circumstances where you might want the client to talk directly to the database as it really depends upon what you're doing, what the data is and what the risk exposure is for allowing untrusted code to directly manipulate the data in the database.
Remember, you cannot protect credentials embedded in a client. They can be discovered by the client and used for other things.

connecting an ios app to send information to a mysql database

Im doing my final project which is a taxi booking service. i intend to make an ios app for the customer so that they can book a taxi. the request will then be sent to the mysql database (held at the taxi base). i want to no how can i send the information from the app to the datatbase; and the datatbase to send a confirmation message back to the app confirming the taxi has been booked!>>>>>
i have read a lot about web servers but am very confused. can i use an web server e.g. windows home server 2008? any help would be appreciated.
I am not familiar with Windows home server 2008, but I'm pretty much sure that you can use it for your project.
If you want to keep things simple,
Just install XAMPP server which comes with all the components you need to work on this project including PHP and MySQL. It is one of the easiest servers to work with and most of all, its free and open source. http://www.apachefriends.org/en/xampp-windows.html
Then write the business logics inside your Web App using whatever the programming language you want to (for this one PHP would be enough, or choose Java if you want to have a more complex scalable solution). Writing data to a MySQL database using PHP is very easy and you can find ton of tutorials and sample source codes in the internet.
Now your web app is all set, the next step is to expose these services using REST where an iPhone can communicate with your services. Use JSON for interacting with your Web server from iPhone. Again, there are tones of tutorials on how to write a JSON RESTful service using PHP.
Finally in your iPhone app, you can access the service exposed from the server for saving data as well as to retrieve anything from it through JSON. For making this, use a good Objective-C framework such as AFNetworking. It comes with the JSON parser as well. Ref. http://afnetworking.com
Good luck with your project !
RESTful web services are going to be your best friend here.
Create a server side program in django or python or whstever. Connect it to a database (mysql).
You can host it on Amazon Web Services. I think they have windows 2008 instances. I would personally use the amazon linux ami.
Use afnetworking to invoke a get or a post on the server app and you are off to the races.
take a look at this open source taxi project
its work with RESTful web services but its better to forget about Microsoft Windows its better to use Linux hosting for your web service.

Server for mobile feed app (like Instagram, Twitter...)?

I've made a mobile native app with a feed system like Instagram/Twitter. In development mode I was just running a PHP/MySQL Apache local server, but now I need to publish the app and work with a real server. Which kind of server do I need? I just need to send http requests (JSON), loads of them!
Do I just need a hosting server like 1and1? (http://www.1and1.com/linux-web-hosting?__lf=Static)
But this one, it only has 1GB MySQL databases... not enough
Is there any kind of app/server whatever? Which kind of server does Instagram use?
These days lots of users are moving to the cloud.
Check out Amazon EC2: http://aws.amazon.com/ec2/
You can setup a micro instance server and it is very cheap to run tests on and get off the ground. Then if you like how it's running, you can simply upgrade to a more powerful server without having to re-install everything.
It also allows you to scale if your application gets really popular by just cloning the server.
Really worth checking out.

Integrating a Swing App With Tomcat

I recently created a web application with GWT. Then re-used most of the code to create a Swing version of the application that accesses a local database in offline mode. I am now implementing the 'online' mode of the application and want to access the same data as my GWT application.
Any ideas? Considered connecting directly to the MySQL server via SSL, but that's not working and doesn't seem as scalable. Should I use REST?
Any suggestions would be helpful.
To solve this problem in the past, we've used Jersey to create REST Web services which returns protocol buffers. The Swing app would then interact with the protocol buffers. The GWT app would ask for content type 'json' and receive protostuff objects in return. It worked quite well. That way, both apps can communicate with the server in the exact way.
Edit:
To allow your swing app to communicate with GWT-RPC, look at this blog article.