0
Zazler
Ready-made backend for mobile apps
[zăz l r]
ʹ ǝ
User experience first!
The value of an app lies in its user experience, i.e. the
result of frontend development. On the ot...
What is Zazler
Zazler is a backend for mobile apps that saves
developers from having to write server-side code.
This allow...
How Zazler works
With our software you can specify a data query as a
URL per HTTP request and format the result in a
wide ...
Data query as a URL
SELECT
to_char(date_trunc('month', aeg), 'YYYY-MM-01')::date AS kuu, count(*)
FROM kohalolek
JOIN liig...
Zazler architecture
Zazler (in the dashed box) parses the URL, compiles
the query into a respective SQL and adds privilege...
Back-end examples
<?
mysql_connect("localhost", "root", "foo") or
die("Could not connect: " . mysql_error());
mysql_select...
Front-end embed code
Reading and writing the data to and from a database is
possible by using the following code example:
...
Features of Zazler
Functions:
RESTful APIs of SQL
databases
Configurable access rights
(HTTP authentication)
CRUD function...
Contact us
info@zazler.eu
+372 52 861 52
rudolfosman
Want to try Zazler out in your project?
Have comments or questions re...
Upcoming SlideShare
Loading in...5
×

Zazler - the ready-made backend for mobile apps

1,076

Published on

Zazler is a backend for mobile apps that saves developers from having to write server-side code. This allows them to focus on frontend development creating great user experience instead!

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,076
On Slideshare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
1
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Transcript of "Zazler - the ready-made backend for mobile apps"

  1. 1. Zazler Ready-made backend for mobile apps [zăz l r] ʹ ǝ
  2. 2. User experience first! The value of an app lies in its user experience, i.e. the result of frontend development. On the other hand, backend development involves many tasks which are often not appreciated by the users. That's what the users perceive as valuable! Many times including tedious, repetitive tasks
  3. 3. What is Zazler Zazler is a backend for mobile apps that saves developers from having to write server-side code. This allows them to focus on frontend development. Reducing substantially the time spent on boilerplate backend coding Creating great user experienceto make the app stand out!
  4. 4. How Zazler works With our software you can specify a data query as a URL per HTTP request and format the result in a wide array of output types. Puzzled? Check out the next slide Zazler software in a nutshell
  5. 5. Data query as a URL SELECT to_char(date_trunc('month', aeg), 'YYYY-MM-01')::date AS kuu, count(*) FROM kohalolek JOIN liige ON liige.id = kohalolek.liige_id WHERE kohal IS TRUE AND liige_id = 13979 GROUP BY to_char(date_trunc('month', aeg), 'YYYY-MM-01')::date ORDER BY to_char(date_trunc('month', aeg), 'YYYY-MM-01')::date; With Zazler you can take a database query like this: … and instead present it as a URL like this: http://dev.zazler.eu/data/riigikogu/kohalolek.html? join[liige]=liige.id=liige_id&where=kohal=1:liige_id=L&select=month(aeg)@kuu, count(1)&group=month(aeg)&limit=20&L=13979&order=month(aeg) SQL URL
  6. 6. Zazler architecture Zazler (in the dashed box) parses the URL, compiles the query into a respective SQL and adds privileges. It also presents the output data in the required format. Privileges Database Client applications HTTP Format adapters URL parser
  7. 7. Back-end examples <? mysql_connect("localhost", "root", "foo") or die("Could not connect: " . mysql_error()); mysql_select_db("tutorial"); $task = ''; if ( isset($_GET ['task'])) { $task = $_GET ['task']; } if ( isset($_POST['task'])) { $task = $_POST['task']; } switch($task){ case "LISTING": // Give the entire list getList(); break; default: echo "{failure:true}"; // Simple 1-dim JSON array to tell Ext the request failed. break; } function getList() { // $query = "SELECT * FROM presidents pr, parties pa WHERE pr.IDparty = pa.IDparty"; TODO $query = "SELECT * FROM presidents pr"; $result = mysql_query($query); $nbrows = mysql_num_rows($result); if($nbrows>0){ while($rec = mysql_fetch_array($result)){ // render the right date format $rec['tookoffice']=codeDate($rec['tookoffice']); $rec['leftoffice']=codeDate($rec['leftoffice']); $arr[] = $rec; } echo '({"total":"'.$nbrows.'","results":'.json_encode($arr).'})'; } else { echo '({"total":"0", "results":""})'; } } // Encodes a YYYY-MM-DD into a MM-DD-YYYY string function codeDate ($date) { $tab = explode ("-", $date); $r = $tab[1]."/".$tab[2]."/".$tab[0]; return $r; } http://v1.zazler.eu/tutorial/listing.grid1.ext.html?select=firstname,lastname package com.loiane.web; @Controller public class ContactController { private ContactService contactService; @RequestMapping(value="/contact/view.action") public @ResponseBody Map<String,? extends Object> view() throws Exception { try{ List<Contact> contacts = contactService.getContactList(); return getMap(contacts); } catch (Exception e) { return getModelMapError("Error retrieving Contacts from database."); } } @RequestMapping(value="/contact/create.action") public @ResponseBody Map<String,? extends Object> create(@RequestParam Object data) throws Exception { try{ List<Contact> contacts = contactService.create(data); return getMap(contacts); } catch (Exception e) { return getModelMapError("Error trying to create contact."); } } @RequestMapping(value="/contact/update.action") public @ResponseBody Map<String,? extends Object> update(@RequestParam Object data) throws Exception { try{ List<Contact> contacts = contactService.update(data); return getMap(contacts); } catch (Exception e) { return getModelMapError("Error trying to update contact."); } } @RequestMapping(value="/contact/delete.action") public @ResponseBody Map<String,? extends Object> delete(@RequestParam Object data) throws Exception { try{ contactService.delete(data); Map<String,Object> modelMap = new HashMap<String,Object>(3); modelMap.put("success", true); return modelMap; } catch (Exception e) { return getModelMapError("Error trying to delete contact."); } } private Map<String,Object> getMap(List<Contact> contacts){ Map<String,Object> modelMap = new HashMap<String,Object>(3); modelMap.put("total", contacts.size()); modelMap.put("data", contacts); modelMap.put("success", true); return modelMap; } private Map<String,Object> getModelMapError(String msg){ Map<String,Object> modelMap = new HashMap<String,Object>(2); modelMap.put("message", msg); modelMap.put("success", false); return modelMap; } @Autowired public void setContactService(ContactService contactService) { this.contactService = contactService; } } PHP Java URL So instead of writing this in backend You just write this in frontend
  8. 8. Front-end embed code Reading and writing the data to and from a database is possible by using the following code example: /* Getting data from table */ function getData() { var url = 'http://www.example.com/db/table.json'; var get = new XMLHttpRequest(); get.open('GET', url, false); get.send(); return JSON.parse(get.responseText); } console.dir(getData()); /* Putting data to table */ function putData(data) { var send = new XMLHttpRequest(); send.open('POST', 'http://www.example.com/db/table.json', false); send.send(JSON.stringify(data)); return (send.status == 200); } console.dir(putData([{id:1,name:"Jim"}])); JavaScript
  9. 9. Features of Zazler Functions: RESTful APIs of SQL databases Configurable access rights (HTTP authentication) CRUD functionality Readily available formats: JSONArray, JSONObject, HTML, ASCII Other properties: One interface for databases: MySQL, PostgreSQL Intuitive syntax Possibility of inline solutions Rapid prototyping Implementable with an existing information system Creating mash-ups Zazler documentation and examples: http://docs.zazler.net
  10. 10. Contact us info@zazler.eu +372 52 861 52 rudolfosman Want to try Zazler out in your project? Have comments or questions regarding Zazler? Just drop us an e-mail!
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×