Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature | Ability to add a cover image to an article #7

Open
aadeshkulkarni opened this issue Apr 26, 2024 · 14 comments
Open

Feature | Ability to add a cover image to an article #7

aadeshkulkarni opened this issue Apr 26, 2024 · 14 comments
Labels

Comments

@aadeshkulkarni
Copy link
Owner

aadeshkulkarni commented Apr 26, 2024

When?

  • User writes a new article.
  • User edits an existing article.

What?

  • User should be able to add a cover image to the article.

Challenge:

  • How to persist images in the backend ?
@aadeshkulkarni aadeshkulkarni changed the title Ability to add images to articles Feature | Ability to add images to articles May 9, 2024
@aadeshkulkarni aadeshkulkarni changed the title Feature | Ability to add images to articles Feature | Ability to add a cover image to an article May 10, 2024
@RahulSingh9131
Copy link
Contributor

Hey, can I try this?

@aadeshkulkarni
Copy link
Owner Author

Sure, please discuss your approach here before starting dev

@aadeshkulkarni
Copy link
Owner Author

@RahulSingh9131 - This has been assigned to you. Would be grateful if could estimate the timeline for this one and share it.

@RahulSingh9131
Copy link
Contributor

i saw this now , sure i will share my approach and tell the timeline for completing it.

@techypants
Copy link

A fixed w:h ratio with object cover property. Image drap and deop or select and stored in cloudinary or aws s3, generated link is got and rendered.

@RahulSingh9131
Copy link
Contributor

@techypants did you already fixed this issue?

@techypants
Copy link

no not yet, suggested a method

@RahulSingh9131
Copy link
Contributor

ok thanks, i will try this

@RahulSingh9131
Copy link
Contributor

@aadeshkulkarni hey i went ahead and added cloudinary for the image upload feature, and also added coverImage field in the Post collection ,after running migartion command for the prisma i am getting this error on terminal, do i need to add DATABASE_URL in .env.example file to solve this issue?

Screenshot 2024-05-20 at 10 52 35 AM

@aadeshkulkarni
Copy link
Owner Author

@aadeshkulkarni hey i went ahead and added cloudinary for the image upload feature, and also added coverImage field in the Post collection ,after running migartion command for the prisma i am getting this error on terminal, do i need to add DATABASE_URL in .env.example file to solve this issue?

Screenshot 2024-05-20 at 10 52 35 AM

Yes.

You would need to create 2 things to use prisma/backend in your local system correctly:

  1. Prisma connection string, (you can get one easily from aiven.io, which will be stored in .env as DATABASE_URL)
  2. Prisma connection pool connection string. ( you can get one easily from https://www.prisma.io/data-platform/accelerate , which will be stored in wrangler.toml file's DATABASE_URL

Also make sure your ./frontend/src/config.ts's BACKEND_URL is pointing to http://localhost:8787

@RahulSingh9131
Copy link
Contributor

@aadeshkulkarni i have added the DATABASE_URL from aiven.io and also update wrangler.toml file with prisma connection string, but still i am getting erros on console while trying to run prima migrate cmd. i am getting confused in enabling this.

Screenshot 2024-05-22 at 10 05 12 AM

@aadeshkulkarni
Copy link
Owner Author

aadeshkulkarni commented May 22, 2024

@RahulSingh9131 - You are editing .env.example file, instead of .env.

The .env file needs to be created using .env.example as reference point.

Please restart the server after doing this since HMR does not work with env changes.

@aadeshkulkarni
Copy link
Owner Author

@RahulSingh9131 - Any update on this ?

Contributing doc

@RahulSingh9131
Copy link
Contributor

have a look at the PR , have added my cloudinary API key and secret and cloud name , so we may need a different cloudinary account where images will be stored.
Also let me know how to test a newly created API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants