- Install Node.js depending on the operating system that you use.
- Download front-end repository from https://github.com/adriantoczydlowski/recruitment-task
- go to the repository folder and install dependencies
npm install
(terminal).
- Download back-end repository from https://github.com/adriantoczydlowski/json-server
- install
json-server
usingnpm install -g json-server
(terminal).
front-end (recruitment-task folder) - run npm start
(terminal)
back-end (json-server folder) - run json-server db.json --routes routes.json
(terminal)
Description:
Tha main page displays posts of the user "John". Posts are downloaded from the back-end using method getPosts
, which is defined in the api.service.ts
file.
- Create a component
PostComponent
. - Use a created component to displays posts.
- Use input decorator to transmit post data.
- Display the post information (id, title, author) and create CSS styles.
- Handle post selection (click event) by using output decorator.
- Create Comment interface with fields id, body and postId.
- When a user selects a post, download the comments associated with it from the backend ('/api/comments?postId=x', where 'x' is post id).
- Create a component
CommentComponent
. - Use a created component to display comments under the post they belong to.
- Create a form (reactive) for creating posts.
- Create a new route to modify existing posts, use already created form component to modify post information.
- Add form validation - title should be required and not be longer than 50 characters.
- Create a unit tests for a form component.
- Visualize data using d3.js library.