Guest User

Untitled

a guest
Nov 14th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. ## Gateway documentation
  2.  
  3. - [About](#about)
  4. - [Config](#config)
  5. - [Setup](#setup)
  6. - [Usage](#usage)
  7. - [Editing using openapi-gui](#editing-using-openapi-gui)
  8. - [Used technologies](#used-technologies)
  9.  
  10. ## About
  11.  
  12. This project is for viewing and editing formal open-api type documentations for our API's.
  13.  
  14. ## Config
  15.  
  16. Config files:
  17. * ***src/config.js*** -- for frontend (mainly, you only need to change url path)
  18. * ***public/restapi/constants.php*** -- for restapi (specify mysql connections)
  19.  
  20. To configure, create a symbolic link (or copy) from provided examples to config files like so:
  21. ```
  22. # cd into src/
  23. ln -s config.dev.example.js config.js
  24. # cd into public/restapi/
  25. ln -s constants.dev.example.php constants.php
  26. ```
  27.  
  28. ## Setup
  29.  
  30. Before setting up project, you may need to create database and create table with example data from:
  31.  
  32. /for-restapi/db_create.sql
  33.  
  34. If you need to, update configs as indicated in previous section and you can proceed with setup.
  35.  
  36. To set up this project, you will need:
  37. * git
  38. * npm
  39. * php5.4+
  40. * mysql5.4+
  41.  
  42. To install, run from gitbash in windows, or command line in linux/mac:
  43.  
  44. ```
  45. git clone git@git.financetechnology.eu:gtw/docs.git
  46. ... install db if necessary ...
  47. ... do configuration ...
  48. npm install
  49. npm run build
  50. ```
  51.  
  52. To get changes:
  53.  
  54. ```
  55. git pull
  56. npm update
  57. npm run build
  58. ```
  59.  
  60. ## Usage
  61.  
  62. Navigate through available documents, using documents menu dropdown.
  63. You will see a new url in browser url bar, you can use that to reference specific document.
  64.  
  65. To edit documents, use edit menu dropdown.
  66.  
  67. To rename document filenames or their description(shown in upper menu) - use modify dropdown menu.
  68.  
  69. ## Editing using openapi-gui
  70.  
  71. You can refer to openapi-gui documentation online for specific instructions of how to use this simple gui.
  72. Most of the functions are self-describing, so you can get to work quickly.
  73. The extra feature added to this app, is the button named ***Save to storage***.
  74. Use that button to save the edited doc to our database through our restapi.
  75.  
  76. Worth noting, that you can export the contents of file, than copy all of that to some other editor if you find those more comfy.
  77. After editing in your favorite editor you can import back not only json, but also yaml format, by using ***UPLOAD*** section, load definition button. You can also edit raw contents there (remember it supports YAML too!).
  78.  
  79. ## Used technologies
  80.  
  81. * PHP5++,Mysql5.4++ for restapi and doc-handling
  82. * React with Redux, axios, reactstrap(bootstrap for react) and other libs for frontend
  83. * React Redoc for showing nice openapi documents (previously known as swagger.json)
  84. * Openapi-gui for openapi doc editing
Add Comment
Please, Sign In to add comment