Skip to content

Added a download button to download the generated image and handled Cors issues#50

Open
saeitoshi-10 wants to merge 2 commits intochinmay29hub:mainfrom
saeitoshi-10:main
Open

Added a download button to download the generated image and handled Cors issues#50
saeitoshi-10 wants to merge 2 commits intochinmay29hub:mainfrom
saeitoshi-10:main

Conversation

@saeitoshi-10
Copy link

@saeitoshi-10 saeitoshi-10 commented May 22, 2025

Fixes #23

HaikuReadme Pull Request

Hey there, contributor! πŸŽ‰ Thanks for helping make HaikuReadme better!
This template helps us understand your changes and keeps things organized.
Please fill out the sections below, check the relevant boxes, and delete any sections that don’t apply.

Let’s make some poetic code! πŸ“œ


🧩 Related Issue

Issue Number: #23

If this PR doesn’t relate to an issue, explain why it’s needed.


✨ What Changes Did You Make?

Describe what you did in a few sentences. Be specific but keep it simple!

Example: Added vercel.json configs to trigger builds only for main branch and frontend//backend/ changes.
added a download handler in app.js and added a download svg button under the preview image which on click downloads the image
added cors to the backend for


πŸ› οΈ Type of Changes

Check all that apply:

  • Frontend: Changes to frontend/ (e.g., App.jsx, App.css, UI tweaks)
  • Backend: Changes to backend/ (e.g., index.js, svg.js, words.json)
  • Documentation: Changes to README.md, CONTRIBUTING.md, etc.
  • Configuration: Changes to vercel.json, .gitignore, etc.
  • Bug Fix: Fixed an issue (describe briefly)
  • New Feature: Added something new (describe briefly)
  • Other: (specify, e.g., CI/CD, GitHub Actions)

πŸ“Έ Screenshots (Optional)

If you changed the UI (e.g., new theme, layout), add screenshots or a GIF to show it off!
Drag and drop images here or link to them.
Screenshot 2025-05-22 at 11 02 08β€―AM


βœ… Contributor Checklist

Please check these to confirm your PR is ready:

  • [ βœ…] I’ve followed the steps in CONTRIBUTING.md.
  • [ βœ…] I’ve tested my changes locally.
  • My code follows the project’s style (e.g., no trailing spaces, clear comments).
  • [βœ… ] I’ve linked this PR to the correct issue (if applicable).
  • I’ve updated README.md or other docs if needed.

Thanks for contributing to HaikuReadme! I’ll review your PR soon and provide feedback.
Let’s keep the haikus flowing! πŸš€

@welcome
Copy link

welcome bot commented May 22, 2025

πŸŽ‰ Welcome to HaikuReadme!
Thanks for submitting your first pull request! ✨
We're thrilled to have your poetic touch in the codebase.
Let’s review and merge your haikus! πŸ“œπŸš€

@vercel
Copy link

vercel bot commented May 22, 2025

@saeitoshi-10 is attempting to deploy a commit to the Chinmay Sonawane's projects Team on Vercel.

A member of the Team first needs to authorize it.

@saeitoshi-10
Copy link
Author

hi @chinmay29hub can you review my pr and suggest any changes

@chinmay29hub
Copy link
Owner

@saeitoshi-10 Hi πŸ‘‹! Thank you for opening a PR. I will review it shortly πŸš€!

@chinmay29hub
Copy link
Owner

@saeitoshi-10 can you comment something below the issue you are working so I can assign that issue to you! Thanks!

@chinmay29hub
Copy link
Owner

@saeitoshi-10 The download svg feature is working but the same displayed svg in the frontend is not the same as downloaded. The text haiku is different but the styles are same. We need the displayed and downloaded svg to be the same.

image


image


  • Also you have added cors which is great. But the package.json in backend does not contain the new lib cors that you used/installed. In the commit I can only see package-lock.json changed for both frontend and backend. I don't think package-lock.json needs to be changed in frontend since we are installing only installing new lib in backend i.e. cors.

  • In your below code can you introduce environment variable for frontend. We dont want to allow all origins, just our frontend's origin.

// in your code here in backend
app.use(cors());
app.options('*', cors());

Can you please update the PR accordingly? Thanks πŸš€!

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Download Button for SVGs in Frontend

2 participants