appwrite / awesome-appwrite

Carefully curated list of awesome Appwrite resources 💪
https://appwrite.io
967 stars 281 forks source link

Add Nuxt 3 + Appwrite web app #438

Closed EshaanAgg closed 1 year ago

EshaanAgg commented 1 year ago

What does this PR do?

Adds a demo for Nuxt 3 + Appwrite so that the developer community has get started with Appwrite more easily in future! You can checkout the app here!

Related PRs and Issues

Have you read the Contributing Guidelines on issues?

Yes.

EshaanAgg commented 1 year ago

Sure! I'll try to implement these changes!

EshaanAgg commented 1 year ago

@stnguyen90 Added the requested changes.

  1. Used Appwrite CLI to create appwrite.json, and included the same in the repository as well the README.md of the project.
  2. Deleted the redundant createdAt attribute from theworkouts collection and started using the in-built $createdAt attribute for documents.
  3. Added support for persistence of users (removed the auth middleware, and implemented the same in the navbar component by the means of redirection: did this to avoid conflicts with the Nuxt 3 life cycle)
EshaanAgg commented 1 year ago

@stnguyen90 I can't seem to replicate the issue. For me, the redirection is to /login page after clicking on the logout button.

image

This is the code for the handleLogout function which ensures the same.

EshaanAgg commented 1 year ago

@stnguyen90

  1. I tried browsing to / after logging out, and it redirected me to /workouts instead of /login.
  2. Even I am getting the same error logged in my console, but I can't seem to fathom the reason for the same.

I have posted the same question here on StackOverflow, as I wasn't able to debug it myself. Any help or possible causes would be appreciated :)

EshaanAgg commented 1 year ago

@stnguyen90 Pushed a new commit. Since I wasn't able to figure out the reason for the error, I decided to remove redirection from the home page, and instead created buttons in the navbar that enable users to navigate on the basis of the fact if they are logged in or not, and the current page they are on.

EshaanAgg commented 1 year ago

Did you try rebuilding without SSR?

I did but no avail.

stnguyen90 commented 1 year ago

@EshaanAgg npm run dev seems to work for me:

image

How are you running it?

EshaanAgg commented 1 year ago

@stnguyen90 Running it the same way. The errors arise when I browse to the website on localhost and navigate around.

Update: Deleted all the cache and then used the latest code with ssr disabled, and finally no errors logged to the console. 😭

EshaanAgg commented 1 year ago

Thanks so much @stnguyen90! Can't explain how much I appreciate you taking out the time to review my code multiple times!

stnguyen90 commented 1 year ago

Thank YOU! For your hard work on the app!

christyjacob4 commented 1 year ago

THANK YOU! All changes merged 🥳

Please reach out to me on our Discord server if you would like to claim your Appwrite swags! As a way of saying thank you, we would also love to invite you to join the Appwrite organization on GitHub. Please share your GitHub username with us on Discord.  

You can accept the invite by visiting https://github.com/orgs/appwrite/invitation. By joining our team, you will officially be an Appwrite maintainer on GitHub.

You can change your membership visibility settings, so your new Appwrite team membership badge will show up on your personal GitHub profile.

Please feel free to look for more PRs you might be interested in helping with on our long list of Hacktoberfest friendly issues and help make Appwrite better :)