fastest public web app framework for quick DB apps? - json

I'd like to pick up a new tech for my toolbox - something for rapid prototyping of web apps. Brief requirements:
public access (not hosted on my machine) - like Google's appengine, etc
no tricky configuration necessary to build a simple web app host
DB access (small storage provided) including some kind of SQLish query language
easy front end HTML templating
ability to access as a JSON service
C# or Java,PHP or Python - or a fun new language to learn is OK
free!
An example app, very simple: render an AJAXy editable (add/delete/edit/drag) list of rich-data list items via some template language, so I can quickly mock up a UI for a client. ie. I can do most of the work client-side, but need convenient back end to handle the permanent storage. (In fact I suppose it doesn't even need HTML templating if I can directly access a DB via AJAX calls.)
I realize this is a bit vague but am wondering if anyone has recommendations. A Rails host might be best for this (but probably not free) or maybe App Engine, or some other choice I'm not aware of? I've been doing everything with heavyweight servers (ASP.NET etc) for so long that I'm just not up on the latest...
Thanks - I'll follow up on comments if this isn't clear enough :)

C# or Java,PHP or Python - or a fun new language to learn is OK
How 'bout Javascript? This place hosts server-side Javascript ticking most of your other boxes. So you can use the same language for client- and server-side stuff (which I find very handy). [Caveat: I only played with their service; seemed cool though. I use Javascript on the server-side on IIS and on Tomcat (via Rhino).]

For something bleeding edge - A new version of spring roo was released recently. With it you can create a great web app in 10 minutes. Supports GAE and GWT...
http://www.springsource.org/roo

xataface is a quick way to make a front end for a MySQL database.
It makes it easy to start an app quickly with dynamically created views and then you can change it to something very customized to your needs.
It simply needs a server service with MySQL and PHP.

Related

Hybrid app development: How to separate HTML5 + CSS3 + JS from PHP + SQL?

I'm used to the full stack approach of developing where PHP can be used to create dynamic HTML and to handle SQL as well. However, I'm now considering creating an hybrid app that can be used across platforms.
So my questions are: should I separate the app into HTML5 + CSS3 + JS and PHP + SQL webservice? If so, how should the connection be done? with ajax requests to the webservice? Is this the correct approach?
Any suggestions, pointers or names of concepts that I should/could read regarding the topic are appreciated.
I'd recommend a microservice approach. Using docker and some other container orchestration tool.
What I mean is that you could have a RESTful API written in php fetching data from a MySQL db (or any other db). Then simply write your front end app, using plain JavaScript, HTML and CSS, or a JavaScript framework (angularjs, react, etc). Then you could make your front end communicate with your back end through your API's endpoints.
The idea behind creating microservices or 12 factor apps, is to separate your apps in components or microservices. Then with some configuration and using the right tools you could have them all communicating between them. This way scaling is way easier, and maintaining the code even more.
Id recommend you read a bit more on JavaScript frameworks and microservices. There's a free course at Udacity on microservices using docker and kubernetes that I know will be extremely helpful. Link here
For front end JavaScript frameworks there's a ton of resources out there. Try CodeSchool free courses or codeacademy's.

Java applet on website?

I have been assigned the task of creating a MySQL database which I will host on a server and create a website for a product my friend is selling. The database will store site information such as order information. I have little knowledge of HTML so my solution would be to use a website creater (weebly) and design it. There are then two routes I could take for accessing my database. I am limited to what I can do because all I know is java, c#, and c++. I figured I could create a java applet (which I could easily do) and embed the code of the code of the applet in an applet tag in my weeblys site. There is functionality to embed HTML code in the designer. Using the applet, with my java knowledge I figured I could easily access and insert/extract data from my hosted database. I know that java applets require the JRE and Java browser extension to run, this made me a little hesitant about doing this. Would that be a fine way to approach this project? I need my website to access my database, should I do this in java, or in php. What would be the correct thing for me to do?
What you're describing doesn't sound like a good idea.
First of all, Java Applets are an obsolete technology. The Java plugin isn't nearly as common now as it was in 1998, and security people have been advising that people disable it for years due to a long string of holes in its security model.
Second, it sounds like you're planning on giving the applet direct access to your database. This would require that you make your database externally accessible, which will make access control and data validation difficult.
The standard way to implement this sort of thing is to write a server-side web application (you can use PHP, any one of various server-side Java systems, ASPX, or one of many other platforms) that interacts with the database and generates web pages on demand. The database is hidden behind a firewall, the web application code handles access control and data validation, and the client doesn't need to run unsafe code.

Delphi - Websockets and uniGUI

I am really a beginner in delphi, as the client request the project to be done in delphi, so I have to ask to get some help as possible as I can. This project will be involved in HTML5 and websockets as well, so there are some questions I need your advices.
Sorry let me explain more, this application have two parts mainly, one is HTML5 client web app (this app will be loaded from web server, and run locally in browser), and the other is its service located in server. The HTML5 web app is doing some product editing job, as well send its final output to server, during this process, there will be many communications between client app and service, and I planed to use Websockets.
I did plan this application in HTML5 and Node.js before, but as client send request to ask for the Delphi XE as primary development tool also it will be compiled to DLL (ISAPI, have to be) at last. For consistency of UI, I also was required to use uniGUI (http://www.unigui.com/demo)for Delphi. Now I have these questions:
Is there any other way to do this application with HTML5 as web front exclude uniGUI in Delphi?
What good libraries support Websockets in Delphi?
What book you can recommend me to read, as I don't know Delphi at all.
Thanks.
1: yes, make a "single page app" (static html + js) and communicate with server using xml or json.
At least with indy 10 it is quite straight forward to implement static file serving (response.contentstream := tfilestream.create(sfilename) or something like that)
2: yes, if you search for it on google you will find some :)
WebSocket server implementations for Delphi
btw, I'm busy with delphi socket.io implementation, which makes it easier to use websockets instead of plain low level tcp-like websockets itself
Is there any other way to do this application with HTML5 as web front exclude uniGUI in Delphi?
First concept : HTML5 applications are a bunch of HTML files and JS's wich can be processed by browsers.
Second concept : You need an application that can bind HTTP queries and return files from the first concept.
Third concept (paradigm) : With first two concepts, a third concept arises. Dynamic HTML. What is dynamic HTML? HTML that generates at runtime at the backend server and/or at frontend with JS.
Solution :
Yes, with Delphi as a backend server you can manipulate and return HTML5 views, if you know (MVC paradigmn for example) you can program an HTTPServer application that binds HTTP request from network and responses your HTMLs and JS.
What good libraries support Websockets in Delphi?
You need a multilayer library. The best library I know is mORMot. mORMot is like a swiss razor for Object Pascal.
You can create an HTTP server with websocket published interfaces. mORMot's Site
What book you can recommend me to read, as I don't know Delphi at all.
I have more than 10 years with Delphi and Free Pascal and I didn't read a book at all. But I read a lot from internet and a lot of computer architecture and another languages like C and C++.
If you like Delphi there are tons of documentation via Internet. I cannot recomend you a book because I will lie you.

Rails or node.js for Restful API

I have an existing website written in ASP.net, I have recently switched to Mac full time (With Windows in Boot Camp), and need to write a public API for accessing my website's MySQL data. I primarily want to use the API to allow building an iOS application.
I am interested in learning either Ruby on Rails or Node.js, I haven't used either of them yet.
Which language would be better for me to learn?
Rails is a relatively mature web framework based in Ruby and is designed for handling object-mapped data persistence in a relational database backend.
Node.js is much newer on the scene, and unlike Rails, is a more bare-bones package that allows for server-side Javascript applications thanks to a pretty tight HTTP(S) API. Node applications are by nature event-driven, which may or may not be ideal for your application.
Since it seems that you'll need data-persistence (you mentioned accessing MySQL data...), Rails might be easier to get started with, as it comes packaged with all the things you need in this respect and is designed to facilitate this sort of application.
If you you don't really need relational data persistence, Node is probably a better bet as it stays out of your way and lets you decide how to handle things. It's important to note that Node is a much more bare-bones "framework" than Rails -- if you want something slightly higher-level but still lighter than Rails that runs on Node, express is good place to start.
Still, if you want to try Node (I will confess: it's a lot of fun!), it's totally possible to access MySQL in a nice, event-driven (non-blocking) way. Here are two modules that will be helpful:
node-dbslayer
node-mysql
Neither is a language; they're frameworks. There is no "better", there may be a "more suitable" (probably not in this case).
Which would you prefer to develop in, Ruby (Rails), or JavaScript (node.js)?
Would you like to transfer that knowledge to a different job without rampup time (Rails)?
Would you like to learn something a bit more esoteric, event-driven (node.js)? (Ruby has Event Machine, but IMO node.js takes it a bit further.)
So this new application is just a middle man between your ASP.NET thing and your other clients.
In that case, totally use node. Node is great at being networking glue. Node scales great with IO bound applications (i.e. being a network middleman).
If you're going to use node then you probably want to look at express to make it easier.

Delphi with HTML/CSS interface

I want to develop a delphi application with an HTML/CSS graphical user interface, not necessarily running from within a web browser. I want to do this do create a richer graphical user interface with animations etc. and break away from normal VCL components / Windows look. Any suggestions?
HTML and CSS won't deliver animations or a Rich User Interface to your feet. Far from it in fact. Quite the opposite. You will need to invest in a toolkit to provide that sort of functionality and almost certainly involve JavaScript. And even if you don't want your eventual application hosted in a web browser, your application will itself have to host a web browser to render your HTML/CSS/JavaScript UI, and you will then have a much more difficult job of connecting your GUI to your application logic (unless you do actually embrace a web application architecture).
Delphi (or any Windows application development language for that matter) gets you much, much further down the road towards a more simply, effectively and quickly implemented Rich User Interface than HTML or CSS.
If you don't like the look and feel of the standard Delphi controls (which in essence is what you are saying) there are numerous alternative libraries available.
Also bear in mind however that when someone uses a Windows application they expect it to look and behave a certain way to a large extent. Using fancy, web based paradigm's in a desktop application simply for the sake of it is likely to confuse and frustrate users if taken too far.
I'm all for user interfaces breaking with convention where it leads to a more intuitive user interface, but simply being "prettier" does not necessarily lead in that direction and is just as misguided as dogmatically adhering to convention.
In one of my applications I have an an embedded browser and I have implemented the IDocHostUIHandler interface. This allows me to expose a COM object via the "GetExternal" method. I simply have a COM object that exposes methods and properties of my application which makes them available to the web pages hosted inside the embedded browser.
So the script in my web pages has lines like "external.DoSomething()" and "i=external.GetThisValue()". So, for example, behind button onclick events you can run a method of your application (implement in the main form, in the COM object itself, or whatever you like).
This site has lots of info on embedding a browser in your Delphi app:
http://www.delphidabbler.com/articles?article=22
It can certainly be cumbersome to implement a lot of this stuff and in many cases there are probably better options. But for my specific purpose I am able to offer a "home page" which can easily be modified to change its layout, look and even expose more (or less) functionality as required by myself or my users.
If you want a Delphi program with a better-looking interface, HTML is really not what you're looking for. What you really need are better-looking VCL controls.
Take a look at TMS Smooth Controls, for example. If you're on Delphi 2009 or 2010, you can get it as a free download here. That's one of many component libraries that can bring a slicker user interface to your program.
HTML / CSS offers some nice features which are (not yet?) available in Delphi and the VCL. They are also a good starting point for client/server programming, separating the user interface and the business logic is a key factor here.
One popular library for Delphi is the extpascal project:
ExtPascal is an Object Pascal (Delphi,
FreePascal/Lazarus) wrapper/binding
for Ext JS, a complete GUI Ajax
framework, made in JavaScript, for
Rich Internet Application (RIA)
development. ExtPascal lets you use
Ext JS from Object Pascal commands
issued by the server. It brings the
structure and strict syntax of the
Object Pascal for programming the web
browser. ExtPascal will wrap Draw2d
into future releases.
Some demos are online here and here.
p.s. and I really like the HTML / CSS support for element and font sizes in relative units (for exampe percent). Combined with browser zoom in / zoom out and WCAG, user interface ergonomy can not be much better.
HTML Option 1
If you relly want to use HTML+CSS(+JavaScript) to build a GUI, you can have a look at HTML Applications, a very fascinating concept from Microsoft. HTML Applications, .hta files, have been supported from Windows ME, if I remember correctly, and they are still supported on Windows 7.
You could create an HTML Application (i.e. an HTA file), and by so doing, creating a GUI using only HTML, CSS, and JavaScript. When the user double-clicks the HTA file, it will open like a program, but the GUI is entirely based on HTML; in fact, the entire Window is an Internet Explorer window in disguise.
And now comes the important part: you could create non-GUI Delphi applications (i.e., Delphi applications that are not console applications, but that have no forms either), and start them via hyperlinks (or JavaScript) from within your HTA GUI. (Well, it is probably better to create one such Delphi application, and use command-line arguments (ParamStrs) to communicate the desired action.)
Just an idea...
HTML Option 2
Alternatively, you could create a normal Delphi GUI application, but fill the entire main form with a TWebBrowser (a IE control), using Align := alClient. Then you could either load static HTML pages (stored in the Program Files folder or on the Internet), or you could use Delphi to dynamically create HTML pages to show. I think it is possible to intercept links from the control, so that you could respond to links using Delphi code.
What about OpenGL?
If you want to "break away" from the normal Windows look and feel, then I would recommend you to create your GUI using OpenGL. It is very easy to make a Delphi application with OpenGL (as long as you are familiar with OpenGL) - just add "OpenGL" to your uses list.
First this: I completely agree with Deltics' answer.
Having said that, if you master HTML and CSS (and JavaScript and AJAX etc etc) and you are looking for a way to use the power and speed of the Delphi compiler to run the dynamics of a website, this may be of interest.
I've created a project that uses the Delphi compiler to build a library that runs a website. The source-files combines HTML and Delphi, much like other web-scripting tools out there, but gets processed on a page-refresh, and compiled automatically. It uses a 'library handler' that plugs in the website library into pretty much anything you like: IIS, Apache, a stand-alone HTTP server (for hosting), or directly into InternetExplorer or FireFox (which is great for developing).
http://xxm.sourceforge.net/
New versions of Qt contain ability to use html/js for interfaces. I don't know if there is Qt library bindings for Delphi, but Qt is exactly what you want.
for Rich GUI and animation, have you looked at KSDev DXScen and VGScene ?
If you want to keep your delphi/Pascal Object 'background' and have a Web like RIA you also have a look to Morfik : link text