From 69a1d1f6b2133d812713fbff82a569fb48e337da Mon Sep 17 00:00:00 2001
From: Alice <alice.poggioli@hotmail.fr>
Date: Thu, 30 Apr 2020 14:24:20 +0200
Subject: [PATCH] add build existing app

---
 .../build-existing-app.rst                    | 70 +++++++++++++++++++
 1 file changed, 70 insertions(+)
 create mode 100644 source/import_documentation/build-existing-app.rst

diff --git a/source/import_documentation/build-existing-app.rst b/source/import_documentation/build-existing-app.rst
new file mode 100644
index 0000000..79a78f8
--- /dev/null
+++ b/source/import_documentation/build-existing-app.rst
@@ -0,0 +1,70 @@
+How to build a SIB application from sources
+#########################################
+
+Requirements
+============
+
+npm 6.7.0
+
+
+Configure the app
+==================
+Get the code of your app (for the example the SIB App):
+
+.. code-block:: bash
+
+    git clone https://git.happy-dev.fr/startinblox/applications/sib-app.git /tmp/sib_app
+    cd /tmp/sib_app
+
+Create JON file and configure the client to contact the servers:
+
+.. code-block:: json
+{
+{
+  "xmpp": "https://jabber.happy-dev.fr/http-bind/",
+  "authority": "http://api.batman.happy-dev.fr/",
+  "clientName": "Sib App",
+  "authorityName": "batman",
+  "publicDirectory": false,
+  "endpoints": {
+    "circles": "https://api.batman.happy-dev.fr/circles/",
+    "users": "https://api.batman.happy-dev.fr/users/"
+  },
+  "analytics": []
+}
+
+The parameters are:
+
+.. list-table::
+   :stub-columns: 1 
+
+   * - xmpp 
+     - authority 
+     - authorityName
+     - clientName
+     - endpoints
+   * - the BOSH access of your Prosody's server 
+     - the primary OpenID authority url, for sib-auth
+     - the primary OpenID authority name, for sib-auth
+     - your client name, for sib-auth
+     - api points to the server to contact for each capability
+
+
+
+In this example we are contacting the same server (batman.happy-dev.fr) for all our application capabilities. Because we installed the server with this configuration we know it supports all capabilities we need. But we could point each capability to different servers as long as they support it.
+If you use a local development server, you should use http://localhost:8000/ instead.
+
+Build the client app
+==================
+Create your application bundle:
+
+.. code-block:: bash
+
+    npm run build
+
+The application bundle is in the dist folder, ready to be deployed everywhere as a static file.
+You can serve your application locally (assuming you already have a SIB server setup) to check its behavior:
+
+.. code-block:: bash
+
+    npm run watch
\ No newline at end of file
-- 
GitLab