You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/architecture.rst
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,5 @@
1
+
.. _kvasirarch:
2
+
1
3
Kvasir's Architecture
2
4
=========================
3
5
This page details Kvasir's architecture. It explains in detail why each architecture decision was made.
@@ -40,3 +42,9 @@ In order to achieve this, we came up with this idea of a "middleware component."
40
42
41
43
This middleware can be provided in any language that the developer chooses, using any structure that they want. As long as it can receive and send back information in the way that Kvasir expects, the rest is up to the developer. The information that Kvasir requests may be spread out across three or four tables for one developer, but be completed contained in a single table for another. This middleware piece allows Kvasir to be apathetic towards a developer's underlying database. This provides us with the necessary flexibility to be able to provide this as a solution to all company's currently using WePay, not just a handful.
42
44
45
+
46
+
Integrating with Kvasir
47
+
----------------------------
48
+
The entire architectural model assumes that this application is running on an company's internal network. It does not come with any sort of authentication and there are no plans for it. Similarly to database configurations there are a plethora of authentication systems out there that we cannot provide mechanisms to interact with all of them.
49
+
50
+
You should launch Kvasir on system that is only accessible to your employees and not the greater Internet. Otherwise, you will be exposing your database, and all of the information about your end users.
Kvasir is designed to aid in the completion of many actions that your typical customer support user would have to do after integrating with WePay.
@@ -29,7 +37,7 @@ These actions include:
29
37
30
38
Tech Stack
31
39
-----------
32
-
Kvasir is comprised of two major components - a back end server running on `NodeJS <http://https://nodejs.org/en/>_` and a set of front-end JavaScript files built on top of `ReactJS <https://facebook.github.io/react/>_` and `Redux <http://redux.js.org/>_`.
40
+
Kvasir is comprised of two major components - a back end server running on `NodeJS <http://https://nodejs.org/en/>`_ and a set of front-end JavaScript files built on top of `ReactJS <https://facebook.github.io/react/>`_ and `Redux <http://redux.js.org/>`_.
33
41
34
42
You are free to pick and choose what parts of the application you want to use. ReactJS is designed to be back end agnostic - it doesn't care what technology you use on the back end, as long as it receives the information it needs and in the format that it expects. You could chose to scrape the NodeJS server and rebuild it in your own language of choice. The reverse is true as well - if you want to work your support dashboard within an existing infrastructure, then you can throw away the front end component and build your own on top of our NodeJS server.
35
43
@@ -42,7 +50,7 @@ NodeJS comes with some nice functions that make compiling our front end JavaScri
42
50
43
51
Installation
44
52
---------------
45
-
First make sure that you have `NodeJS <https://nodejs.org/en/download/>_` installed on your machine. Node comes prepackaged with it's package manager `npm <https://www.npmjs.com/>_` which will allow you to download and manage all of the packages and dependencies.
53
+
First make sure that you have `NodeJS <https://nodejs.org/en/download/>`_ installed on your machine. Node comes prepackaged with it's package manager `npm <https://www.npmjs.com/>`_ which will allow you to download and manage all of the packages and dependencies.
* Request data from the given wepay_endpoint, using the specified access_token and package. This function will immediately send the response back to the client
65
+
*
66
+
* @param res - Express response object
67
+
* @param wepay_endpoint - the WePay API endpoint we want to hit
68
+
* @param access_token - the access token we want to use with the request. NOTE: for certain endpoints, this can be *null*
69
+
* @param package - the package of data we want to send along with request. This can be an empty object depending on the endpoint
* Parse the response from the middleware and decide what to do with it.
123
+
* If the middleware sends an error, raise that error back to the client
124
+
* If a wepay_endpoint is provided, then use the information provided by the client and request information from the provided endpoint with the wepay_package
125
+
* If no wepay_endpoint is provided, then just send the results from the middleware back to the client
126
+
*
127
+
* @params req - Expresses Request object
128
+
* @params res - Express Response object
129
+
* @params error - A JSON structure with error information (empty if no error occured)
130
+
* @params response - A detailed response object
131
+
* @params body - A JSON structure with returned data
132
+
* @params wepay_endpoint - The wepay_endpoint to hit after receiving a response from the middleware
133
+
* @params wepay_package - The package to send to the wepay_endpoint
0 commit comments