marwanm-dev / Devto-clone

Dev.to clone
https://marwanm-devto-clone.vercel.app
BSD 4-Clause "Original" or "Old" License
91 stars 20 forks source link

can u say to me what is CLOUDINARY_DEFAULT_URL = and CLOUDINARY_DEFAULT_PUBLIC_ID= #6

Closed am0029 closed 1 year ago

am0029 commented 1 year ago

please can u say to me what is CLOUDINARY_DEFAULT_URL = and CLOUDINARY_DEFAULT_PUBLIC_ID=

because cloudinary said there is no cloudinary_default_url and cloudinary_default_pulic id

what should i fill in this two ?

I still have problem uplaoding to clouadinary this error occurs to me when i click in register button

{status: 500, data: "Cannot read properties of undefined (reading 'url')"} data: "Cannot read properties of undefined (reading 'url')" status: 500

marwanm-dev commented 1 year ago

you should upload a default image to cloudinary and then, CLOUDINARY_DEFAULT_URL is the default image url if profile picture didn't exist, and CLOUDINARY_DEFAULT_PUBLIC_ID is the public id of the default image learn more about public ids from cloudinary

am0029 commented 1 year ago

please if possible can u open this question i need this project for my college . can u wait i test .

am0029 commented 1 year ago

CLOUDINARY_CLOUD_NAME="dks####y6" CLOUDINARY_API_KEY="84969881####289" CLOUDINARY_API_SECRET="ge917s#####IGmngeMe3LgwIkLY" CLOUDINARY_DEFAULT_URL="https://res.cloudinary.com/dkseqv8y6/image/upload/v1670343227/cld-sample-2.jpg" CLOUDINARY_DEFAULT_PUBLIC_ID= "sample_id"

i gave star to you nice man thank you you mean like this ?

when i write name username password email and choose one picture to upload this line gives me error in chrome console in user controller file it said url is not defined .

message: 'Stale request - reported time is 2022-12-10 22:26:41 +0000 which is more than 1 hour ago', [0] name: 'Error', [0] http_code: 400 [0] } [0] C:\Users\atii\Desktop\project\Dev to\( $$ Backend ++ Front End $$ )\Devto-clone-main\server\controllers\postsController.js:19 [0] const { url, public_id: publicId } = await uploadToCloudinary(file, 'Posts'); [0] ^ [0] [0] TypeError: Cannot destructure property 'url' of '(intermediate value)' as it is undefined. [0] at createPost (C:\Users\atii\Desktop\project\Dev to\( $$ Backend ++ Front End $$ )\Devto-clone-main\server\controllers\postsController.js:19:11) [0] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) if (req.body.picture.publicId !== process.env.CLOUDINARY_DEFAULT_PUBLIC_ID) { const { url, public_id: publicId } = await uploadToCloudinary(req.body.picture.url, 'Profiles'); req.body.picture = { url, publicId }; console.log(publicId); }

my problem is can not upload any picture when sign up becasue this i can not even register becasue can not upload picture

please can u say how can i remove avatar part of website and upload to cloudinary becasue i can not understand 1 month iam trying but i can not .

can u say what can i do to remove the upload part from website and just for all user just show simple icon for all

i can not make it work with this cloudinary

in vercel.com your app is working fine i test sign up and create post but for me locally 1 month iam trying

. i can not change my project because teacher wants this

can u say how can i remove the upload part of website and for all user just simple icon i can not make it work

marwanm-dev commented 1 year ago

For example: This is my default public url enviroment => https://res.cloudinary.com/det2uv5o1/image/upload/v1670686758/DevToClone/profiles/default-avatar_eahzpe_bgjmns.png then this is the public id => DevToClone/profiles/default-avatar_eahzpe_bgjmns.png

Try to fork the new repo its update maybe it will work! if it doesn't work locally you should remove the upload part simply by making the inputs not required and in the controller remove anything related to if picture doesnt exist + it shold work find when no picture t will just use the default one.

am0029 commented 1 year ago

Sir I tried to remove things from source code . u know what i did i do not know

just i removed the image input and reauired and again i copy past real source code but not working .

i do not what page did i change even after copy past blank white page

i could not . i just want sucide . see this error Post.jsx:72 Uncaught TypeError: Cannot read properties of undefined (reading 'url') at Post (Post.jsx:72:23) at renderWithHooks (chunk-7NXEZD77.js?v=c02254b7:1 it just blank white page even after i copy past real source code

forget about it . my friend thanks for everything . nice kind man answering questions for free

i just wasting time iam not devloper i can not remove the cloudinary part from website

thank you my friend if u want close . u can close it is not important anymore ...

marwanm-dev commented 1 year ago

Ok thanks, You should try to fork the repo now after its updated several times in the last month and hopefully it'll work locally for you.

am0029 commented 1 year ago

can u do this for me if u had time ? because i downloaded new repository after u updated . and even now i can not even run project locally . blank white page and what is y folder ? not important ? and this error in postlist componnets i did not change any thing i just downloaded new repository

Post.jsx?t=1670773069475:72 Uncaught TypeError: Cannot read properties of undefined (reading 'url') at Post (Post.jsx?t=1670773069475:72:23) at renderWithHooks (chunk-ZN6VZZCW.js?v=f9c65a92:11767:26) at mountIndeterminateComponent (chunk-ZN6VZZCW.js?v=f9c65a92:14496:21) at beginWork (chunk-ZN6VZZCW.js?v=f9c65a92:15451:22) at HTMLUnknownElement.callCallback2 (chunk-ZN6VZZCW.js?v=f9c65a92:3579:22) at Object.invokeGuardedCallbackDev (chunk-ZN6VZZCW.js?v=f9c65a92:3604:24) at invokeGuardedCallback (chunk-ZN6VZZCW.js?v=f9c65a92:3638:39) at beginWork$1 (chunk-ZN6VZZCW.js?v=f9c65a92:19264:15) at performUnitOfWork (chunk-ZN6VZZCW.js?v=f9c65a92:18697:20) at workLoopSync (chunk-ZN6VZZCW.js?v=f9c65a92:18636:13)

can u do it for me ? i sended you email

if u had time can u remove the cloudinary part please and send me source coude that works . i need this

becasue when i remove this line

        // src={post.image.url}

line 52 in post.jsx componnets it works . but another problem is when y click on created post. it just goes to a blank page

am0029 commented 1 year ago

I mean this page when u click on created post it goes to this page but in locally it goes to a blank page

just fix this last problem . please what is wrong with locally ?

https://marwanm-devto-clone.vercel.app/asdadad/javascript-6395bd751952a0d3e371e45a

is it possbile u send me full backup of vercel host ? because project is working amazing in vercel but in locally not working

please do this for me please send me full bakcup of this project hakimlord10@gmail.com

isend u 3 email but u did not answer .

i have to find why this project not working

marwanm-dev commented 1 year ago

I set everything locally again for you and everything works fine, I created new post with a photo then edited the post with a new image then removed the entire thing, there's nothing wrong with mine I think its different os or something and ofcourse maybe your configuration in the enviromental variables, And note that I can't remove cloudinary from the app this will consider me digging through a project that I leaved about 6 months ago and I will have to configure the database and the entire system of uploading images everywhere and what to display instead, the feature is so big and complicated, You can get the app to the college and say that this part is not working or something and ofcourse you can forward them to the hosted app and try locally on another device with the correct setup and configurations and also consider that there's a license, I tried my best wish you luck man and I hope you understand me.