Coder Social home page Coder Social logo

react-practical-assignment's Introduction

Structure: This project contains two applications:

  • server app (inside of './server' folder)
  • client app (inside of './client' folder)

The task is related to the client app. So, everything that you have to do you will do it inside the './client' folder

Steps:

  1. Download and install node here - https://nodejs.org/en/ (if needed)
  2. Open project using VSC or some other code editor
  3. Run command in terminal (inside of this folder): npm run setup (it should install all dependencies)
  4. Run command in terminal (inside of this folder): npm run start_server (it should start server app)
  5. Open additional terminal and run command: npm run start_client (it should start client app)

API Client app should use api provided by server app. Here is endpoints description:

MAIN_URL = http://localhost:8080/

CREATE POST: url: MAIN_URL + 'post/' method: post body: { title: , username: } response: { id: , title: , username: likes: <Array> //usernames dislikes: <Array> //usernames imageSrc: //path date: , comments: <Array> }

UPDATE POST url: MAIN_URL + 'post/{id}' method: put body: { title?: , likes?: Array<>, dislikes?: Array<> } response: { id: , title: , username: likes: <Array> dislikes: <Array> date: , comments: <Array> }

FILTER/SEARCH POSTS BY KEYWORD url MAIN_URL + 'post/search/${keyWord}' method: get response: [ { id: , title: , username: likes: <Array> //usernames dislikes: <Array> //usernames imageSrc: //path date: , comments: <Array> } ... ]

GET POSTS BY PAGES (9 posts per page) url MAIN_URL + 'post/page/${pageNumber}' // pageNumber > 0 response: [ { id: , title: , username: likes: <Array> //usernames dislikes: <Array> //usernames imageSrc: //path date: , comments: <Array> } ... ]

  • response contains additional information: totalPages, total and page

DELETE POST url: MAIN_URL + 'post/{id}' method: delete response: { id: , title: , username: likes: <Array> //usernames dislikes: <Array> //usernames imageSrc: //path date: , comments: <Array> }

UPLOAD POST PICTURE url: MAIN_URL + 'post/{id}/picture' method: post body: FormData // should contain file like this formData.append("picture", file); response: { id: , title: , username: likes: <Array> //usernames dislikes: <Array> //usernames imageSrc: //path date: , comments: <Array> }

CREATE COMMENT url: MAIN_URL + 'comment' method: post body: { text: , postId: , username: , } response: { id: , text: , postId: , username: , likes: <Array>, dislikes: <Array>, date: }

UPDATE COMMENT url: MAIN_URL + 'comment/{id}' method: put body: { text: , likes: <Array>, dislikes: <Array>, } response: { id: , text: , postId: , username: , likes: <Array>, dislikes: <Array>, date: }

DELETE COMMENT url: MAIN_URL + 'comment/{id}' method: delete response: { id: , text: , postId: , username: , likes: <Array>, dislikes: <Array>, date: }

=============== i hope next endpoints will not be used, but i left them here, just in case ====================

GET ALL POSTS url: MAIN_URL + 'post' method: get response: [ { id: , title: , username: likes: <Array> //usernames dislikes: <Array> //usernames imageSrc: //path date: , comments: <Array> } ... ]

GET POST url: MAIN_URL + 'post/{id}' method: get response: { id: , title: , username: likes: <Array> //usernames dislikes: <Array> //usernames imageSrc: //path date: , comments: <Array> }

GET COMMENT url: MAIN_URL + 'comment/{id}' method: get response: { id: , text: , postId: , username: , likes: <Array>, dislikes: <Array>, date: }

GET COMMENTS url: MAIN_URL + 'comment' method: get response: [ { id: , text: , postId: , username: , likes: <Array>, dislikes: <Array>, date: }, ... ]

react-practical-assignment's People

Contributors

pairodox avatar serjio1905 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.