Back

User Profile

  • 0
  • Users
  • Accounts
  • Web
  • Cloud
Susmita
18 May, 2023, 11:33

I wanna create a user profile dashboard in my web app. I've used Appwrite auth service but I want to help users to upload their photo in their profile route of the web application and also add other details.

Do I need to create a separate collection for it? Also, how to store the photo that will be uploaded by the user?

TL;DR
To create a user profile dashboard, you can use Appwrite auth service. However, by default, user profile information is not publicly available. To make it publicly available, you can use functions or create a separate database for user data. Another option is to group users into teams, which allows you to access other users' data. To update the user's preferences, you can use the accountUpdatePrefs method in the Appwrite client SDK. Use the accountGetPrefs method to fetch the preferences. To store a user's profile picture, you can store it as a JSON object in the prefs property of the user object. For example, it
Asutosh
18 May, 2023, 11:38

Hey you might want to checkout the user object from the docs

Asutosh
18 May, 2023, 11:38
Asutosh
18 May, 2023, 11:39

in prefs User's preferences can be storged as a key-value object

Asutosh
18 May, 2023, 11:40

so you may use that according to your need

Faisal7
18 May, 2023, 15:06

I recently discovered this useful project and also prefer you to look into this Project https://github.com/lohanidamodar/flutter_appwrite_starter/tree/main it has demontrated the exact use case what you are trying to do.

Susmita
22 May, 2023, 14:43

How to do that?

Susmita
22 May, 2023, 14:44

I'm using React.js in my application

Asutosh
22 May, 2023, 15:11

So you can set a users profile pic using the prefs property of the user object as a json

Susmita
22 May, 2023, 15:12

I'm new to all these

Asutosh
22 May, 2023, 15:12
Asutosh
22 May, 2023, 15:13

It can be stored as a json say {"profile_pic": "YourImageUrl"}

Susmita
22 May, 2023, 15:13

where to store? how to do that?

Asutosh
22 May, 2023, 15:16

Use the accountUpdatePrefs method to update the Prefs key-value json https://appwrite.io/docs/client/account?sdk=web-default#accountUpdatePrefs And then to fetch the same you can use accountGetPrefs method https://appwrite.io/docs/client/account?sdk=web-default#accountGetPrefs

Asutosh
22 May, 2023, 15:18

Hope this helps, pls let me know if you are still facing any issue following this

D5
22 May, 2023, 15:24

If you want it to be publicly available, it's not possible to achieve that by default, unless using functions. In such case you will need a separate database with users data (probably more efficient than functions). Another way is grouping users in teams, that way you can get other users data

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more