Back

How to run todo-with-react project on the localhost

  • 0
  • Web
!! Henry
11 Aug, 2023, 17:28

Hi. I am trying to run demo-todo-with-react on my local. Before doing it, I created a project in cloud.appwrite.io and also created a web platform, a database/collection. And I set the environment information with the following

TypeScript
REACT_APP_ENDPOINT=https://cloud.appwrite.io/v1
REACT_APP_PROJECT=<my project id>
REACT_APP_COLLECTION_ID=<my collection id>
REACT_APP_DATABASE_ID=<my database id>

After "npm start", I can see that react app interface is shown but I can't signup. So I looked at what the account api's response is.

TypeScript
{
    "message": "User (role: guests) missing scope (account)",
    "code": 401,
    "type": "general_unauthorized_scope",
    "version": "0.10.51"
}

Is there anyone to help me to solve this problem?

TL;DR
TL;DR: The user is having trouble running a 'todo-with-react' project on their local machine. They are unable to sign up, and after investigating, they found an error message stating "User missing scope (account)". They are seeking help to solve this issue.
Drake
11 Aug, 2023, 17:30

Would you please share screenshots of the network logs for the create account request from your browser

Drake
11 Aug, 2023, 17:30

Btw, it's best to use 3 back ticks with multi-line code. See https://www.markdownguide.org/extended-syntax/#syntax-highlighting

!! Henry
11 Aug, 2023, 17:43

These are screenshots

Drake
11 Aug, 2023, 17:50

This is the get account API call and is expected to fail since you don't have a session. Where's the API call for creating an account?

!! Henry
11 Aug, 2023, 17:58

Yes, sorry now the signup works. I am not sure what the reason is. Btw, the create document api doesn't work

Drake
11 Aug, 2023, 18:03

Did you grant permissions to the collection?

!! Henry
12 Aug, 2023, 04:25

Where? In the code or in the cloud setting page?

Asutosh
12 Aug, 2023, 04:30

In the settings menu of your collection

Asutosh
12 Aug, 2023, 04:31

make sure you add the required permissions

!! Henry
12 Aug, 2023, 04:38

Are these correct?

Drake
12 Aug, 2023, 04:42

This will give everyone full access to every document. Do you want people to have full access to the todos another person created? If not, you should turn on document security and only enable create access on the collection

!! Henry
12 Aug, 2023, 04:43

But I think based on these settings, the react todo program should create a document. right?

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