Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. Guest Blog
  2. ===
  3. It's test assignment that represents geust blog with following abilities:
  4. * viewing posts
  5. * creating posts
  6. * submitting comments
  7.  
  8. This applicaton consists two part:
  9. * backend
  10. * frontend
  11.  
  12. Backend represents RESTfull (or almost)) applicaton that is designed using Spring Boot framework and MongoDB database.
  13. Frontend is designed using React.js framework and MATERIAL-UI React components.
  14.  
  15. Backend
  16. ---
  17. Dependencies:
  18.  
  19. * openjdk-8-jre
  20. * openjdk-8-jdk (probably for building)
  21. * mongodb
  22.  
  23. Build and run instruction:
  24.  
  25. cd /backend_root_example/
  26. ./mvnw clean package
  27. java -jar target/guest-blog-0.0.1-SNAPSHOT.jar
  28.  
  29. Backend API:
  30. ---
  31.  
  32. ### Getting all posts
  33. GET URL: **/posts/**
  34. Response:
  35.  
  36. [ {
  37. "id": "123",
  38. "title": "Title",
  39. "date": "2019-12-10T21:14:32.019Z",
  40. "content": "Content",
  41. "picture": "https://example.com/1.jpg",
  42. "comments":
  43. [ {
  44. "userName": "UserName",
  45. "date": "2019-12-10T21:16:34.141Z",
  46. "content": "Message"
  47. }, ]
  48. }, ]
  49.  
  50. ### Getting post with ID
  51. GET URL: **/posts/123**
  52. Response:
  53.  
  54. {
  55. "id": "123",
  56. "title": "Title",
  57. "date": "2019-12-10T21:14:32.019Z",
  58. "content": "Content",
  59. "picture": "https://example.com/1.jpg",
  60. "comments":
  61. [ {
  62. "userName": "UserName",
  63. "date": "2019-12-10T21:16:34.141Z",
  64. "content": "Message"
  65. }, ]
  66. }
  67.  
  68. ### Creating post
  69. POST URL: **/posts/**
  70. Body:
  71.  
  72. {
  73. "title": "Title",
  74. "content": "Content",
  75. "picture": "https://example.com/2.jpg",
  76. }
  77.  
  78. Response:
  79.  
  80. {
  81. "id": "456",
  82. "title": "Title",
  83. "date": "2019-12-10T21:14:32.019Z",
  84. "content": "Content",
  85. "picture": "https://example.com/2.jpg",
  86. "comments": []
  87. }
  88.  
  89. ### Submitting comment
  90. POST URL: **/commets/**
  91. Body:
  92.  
  93. {
  94. "postID": "456"
  95. "useName": "UserName",
  96. "content": "Content"
  97. }
  98. Response:
  99.  
  100. {
  101. "postID": "456"
  102. "useName": "UserName",
  103. "content": "Content"
  104. }
  105. Fronend
  106. ---
  107. Dependencies:
  108.  
  109. * node ~v12.13
  110. * npm ~v6.12
  111. * yarn ~1.19 (for building)
  112.  
  113. Build and run instruction:
  114.  
  115. cd /fronend_root_example/
  116. npm install
  117. npm start
  118. #for building and workin together with backend
  119. yarn build
  120. mv build /backend_root_example/resources/staitc
  121.  
  122. Fronend working examples:
  123. ---
  124. ![alt text](https://i.imgur.com/Kgd3byj.png)
  125. ![alt text](https://i.imgur.com/VgXhwTV.png)
  126. ![alt text](https://i.imgur.com/ao6A36U.png)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement