18
$\begingroup$

It seems like the Wolfram Cloud now provides all the functionality needed to implement complex server-side web applications. It can handle HTTP requests (via APIFunction) and function calls directly from, say, a Mathematica notebook on a client computer; it can use a network of Wolfram Language functions to implement server-side logic and decision-making; and it can store persistent data natively (via, e.g., CloudObject and CloudExpression), or interface with a RDBMS. So, the Wolfram Cloud can, in principle, do anything that Apache plus PHP plus MySQL (or any other server app stack) can do.

BUT: Very few people code nontrivial web apps by cobbling together HTML files, PHP scripts, and hand-crafted SQL queries. Instead, we use carefully architected frameworks to manage all the complexity: Django, or Ruby on Rails, or WordPress, or Zope, or etc. (Does anyone remember UserLand Frontier?)

I haven't been able to find any advice about or support for developing complex web apps with the Wolfram Cloud. So, my question: What relevant "best practices" or other advice can this community recommend for developing a web app back-end entirely in Wolfram Cloud? (I'm imagining using a Mathematica notebook for the front end, but could also see using a web browser.) How should one organize and keep track of the pieces, and avoid losing or confusing those ugly UUIDs? Store persistent data efficiently without concurrency problems? Authenticate users and avoid security holes? Prototype and test locally, and then deploy? Etc…

And a subsidiary question: How might one organize a WC-based "web application framework"?

$\endgroup$
1
  • 3
    $\begingroup$ I don't believe such framework level machinery exists yet, everything is still very young, but it might be coming with v11. For instance WebServer[] was promised to come with v10.4 but didn't quite make it. See this talk: Web Development in the Wolfram Cloud - youtube.com/watch?v=dgUiIe-Vz6g $\endgroup$
    – user5601
    Mar 28, 2016 at 15:53

1 Answer 1

3
$\begingroup$
  • I have little experience with any web application framework, but my past year or so of experimentation with the Wolfram Development Platform suggests that it may to possible to modify your favorite web application framework to work with an all Wolfram Language server stack. Typically I deploy an API or FormFunction from a desktop notebook and then send it a test post with URLFetch again from my desktop. (Post multipart/form-data to an API that needs a filename with the Zach Bjornson hack.) This suggests that it's in principle possible to have an EmbedCode like function that would take web application framework client side code and convert it into the necessary Wolfram Language code to paste into a client notebook. Yes, I admit that this is starting with a pretty slim thread because there's still the probably larger problem of converting the framework's server side code into Wolfram Language code.

  • At Joel Klein's Wolfram Technology Conference 2015 Cloud Programming talk, he mentioned Wolfram Tweet a Program as an example of a web application that must handle concurrent computation.

  • The FileNameJoin[{$CloudRootDirectory, "sensible-cloud-object-file-path", "sensible-cloud-object-name"}] construct should reduce the need to keep track of cloud object UUIDs.

$\endgroup$
4
  • $\begingroup$ Comments will be appreciated. I'll use them to improve my answer. $\endgroup$ Mar 31, 2016 at 16:06
  • $\begingroup$ It might be related quite close to your question. Components approach is the best so far in industry, so there is one attempt to make it using Wolfram - WLX $\endgroup$ Aug 14 at 8:04
  • $\begingroup$ @kirill-vasin Anybody out there prototyping WLJS clinical health care applications? Bonus points, if your physician's smartphone does Star Trek tricorder-like processing of real time patient images. $\endgroup$ Aug 25 at 17:24
  • $\begingroup$ Well, it is definitely goes much further than all what Wolfram Cloud does, but tricorder might be an issue. ;) SpaceX uses javascript running in chrome to draw UI for controlling panels in their ships, so why can’t we do something similar $\endgroup$ Aug 25 at 22:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.