Skip to content

Conversation

@hwakabh
Copy link
Owner

@hwakabh hwakabh commented Aug 22, 2024

Issue/PR link

closes: #353

What does this PR do?

Describe what changes you make in your branch:

  • added axios for fetching certificates/projects data from RapidAPI
  • removed fixture data of certificates/projects

(Optional) Additional Contexts

Describe additional information for reviewers (i.e. What does not included)

  • e2e testings are not included in this PR, since this requires merge into main to confirm changes would be applied

Summary by CodeRabbit

  • New Features

    • Dynamic fetching of certification and project data from an external API.
    • Enhanced presentation of project and certification information with clearer context and improved formatting.
  • Bug Fixes

    • Improved error handling for API requests to ensure reliability.
  • Styling Changes

    • Simplified display of project descriptions and certification details for better readability.

@github-actions github-actions bot added app(api) Issue or PR related to backend API app(ui) Issue or PR related to frontend UI labels Aug 22, 2024
@coderabbitai
Copy link

coderabbitai bot commented Aug 22, 2024

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Files selected but had no reviewable changes (1)
  • api-server/fixtures/payloads/projects.json5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The changes implement asynchronous data fetching from an external API in the Express.js backend for the /certifications and /projects routes, replacing static JSON data. In the Vue.js frontend, the presentation of project and certification data has been improved, including better context and formatting adjustments to enhance clarity.

Changes

File Change Summary
api-server/routes/cv.js Updated /certifications and /projects routes to use Axios for fetching data from an external API, replacing static data with dynamic API responses and adding error handling.
web-frontend/src/pages/Cv.vue Enhanced project and certification data presentation with new context paragraphs, simplified structures, and improved date formatting.

Assessment against linked issues

Objective Addressed Explanation
Make Resume page stateless by fetching data from external APIs ( #353 )
Remove fixture JSON files from Express backend ( #353 ) Static JSON files were not removed as part of the changes.
Add logic for fetching data from external API with Axios ( #353 )

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@hwakabh hwakabh marked this pull request as ready for review August 22, 2024 13:25
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Outside diff range, codebase verification and nitpick comments (4)
web-frontend/src/pages/Cv.vue (2)

Line range hint 5-10: Improve error handling for API requests.

Using console.log for error handling is not ideal for production. Consider using a more robust error handling mechanism, such as displaying an error message to the user or logging the error to a monitoring service.

- .catch((err) => {
-   console.log(err);
+ .catch((err) => {
+   // Display error message to the user or log to a monitoring service
+   console.error('Failed to fetch project data:', err);

Line range hint 11-16: Improve error handling for API requests.

Using console.log for error handling is not ideal for production. Consider using a more robust error handling mechanism, such as displaying an error message to the user or logging the error to a monitoring service.

- .catch((err) => {
-   console.log(err);
+ .catch((err) => {
+   // Display error message to the user or log to a monitoring service
+   console.error('Failed to fetch certification data:', err);
api-server/routes/cv.js (2)

24-34: Improve error handling for the /certifications route.

Using console.log for error handling is not ideal for production. Consider using a more robust error handling mechanism, such as returning an error response to the client or logging the error to a monitoring service.

- .catch(error => {
-   console.log(error);
+ .catch(error => {
+   // Return an error response or log to a monitoring service
+   console.error('Failed to fetch certification data:', error);

58-68: Improve error handling for the /projects route.

Using console.log for error handling is not ideal for production. Consider using a more robust error handling mechanism, such as returning an error response to the client or logging the error to a monitoring service.

- .catch(error => {
-   console.log(error);
+ .catch(error => {
+   // Return an error response or log to a monitoring service
+   console.error('Failed to fetch project data:', error);
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 63571c2 and 29da54d.

Files selected for processing (2)
  • api-server/routes/cv.js (4 hunks)
  • web-frontend/src/pages/Cv.vue (1 hunks)
Additional comments not posted (3)
web-frontend/src/pages/Cv.vue (1)

67-74: Streamlined presentation of certification data looks good.

The changes simplify the presentation by focusing on essential information, which enhances clarity and usability.

api-server/routes/cv.js (2)

9-10: Verify secure management of the API key.

Ensure that the RAPID_API_KEY environment variable is securely managed and not exposed in the codebase or logs. Consider using a secrets management tool if necessary.


36-38: Setting response headers using an object looks good.

The use of an object to set response headers improves readability and maintainability.

Comment on lines +50 to +60
<div v-for="(p, idx) in projectData.items"
:key="idx"
class="project-detail" >
<p>
<h5> {{ p.title }} </h5>
<li v-for="(d, idx) in p.descriptions">
{{ d }}
</li>
<div> {{ p.description }} </div>
<br>
<div> Period: {{ p.start }} - {{ p.end }} </div>
<div> Period: {{ p.start.year }}/{{ p.start.month }} - {{ p.end.year }}/{{ p.end.month }} </div>
<!-- TODO: loop with v-for -->
Skills: {{ p.skills }}
<!-- Since we can not retrieve skills associated to projects from responses of RapidApi, need to consider design -->
<!-- Skills: {{ p.skills }} -->
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider addressing the TODO comment for v-for loop.

The TODO comment suggests considering a v-for loop for a specific part of the project data. Ensure that the current implementation meets the requirements and consider optimizing if the data structure changes.

Do you need help with implementing the v-for loop or optimizing the rendering logic?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app(api) Issue or PR related to backend API app(ui) Issue or PR related to frontend UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(api): make stateless about Resume page

2 participants