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

📚 Documentation: Tutorial for TypeScript #269

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

PrerakMathur20
Copy link

What does this PR do?

Provides step-by-step tutorial to build an WebApp with React TypeScript using AppWrite

Test Plan

Pure static documentation. Tested and Verified Locally.
Home -> Docs -> Tutorials -> TypeScript

Related PRs and Issues

Closes 📚 Documentation: Tutorial for Appwrite with Typescript

Have you read the Contributing Guidelines on issues?

Yes.

@vercel
Copy link

vercel bot commented Oct 21, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 21, 2023 7:25pm

Copy link
Contributor

@gewenyu99 gewenyu99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, great job, some changes are required. The Ideas interface you defined is inconsistent used. Some places it's used with the $id field, some places it's declared without the $id field.

Take a look, make sure the code works.

const title = 'Tutorials' + DOCS_TITLE_SUFFIX;
const description = DEFAULT_DESCRIPTION;
const ogImage = DEFAULT_HOST + '/images/open-graph/docs.png';
const title = 'Tutorials' + DOCS_TITLE_SUFFIX;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove all the white space changes?

import { DOCS_TITLE_SUFFIX } from '$routes/titles';
import { MainFooter } from '$lib/components';
import { DEFAULT_DESCRIPTION, DEFAULT_HOST } from '$lib/utils/metadata';
import { DOCS_TITLE_SUFFIX } from '$routes/titles';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why were these changed?

src/routes/docs/tutorials/typescript/step-4/+page.markdoc Outdated Show resolved Hide resolved

```

Then, optionally render the `Login` component if the path is `/login`, otherwise render the `Home` component.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why optionally?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we have given the steps to design 2 Login components, the user can choose which one suits their project the best.

step: 5
---

In our app we want to have a navigation bar that is always visible. We will add it to the `App` component and use the `useUser` hook to show either:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also navigate to the homepage automatically if already logged in?
It's confusing without this behavior based on how you built this app 👀

import { databases } from "../appwrite";
import { ID, Query } from "appwrite";

export const IDEAS_DATABASE_ID = "<YOUR_DATABASE_ID>"; // Replace with your database ID
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be defined and init in appwrite.js

ID.unique(),
idea
);
setIdeas((currentIdeas) => [response.$id, ...currentIdeas].slice(0, 10));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My intellisense was not happy about this line
Screenshot 2023-10-25 at 7 00 43 PM

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also facing the same Issue... Can you please guide on how to fix this?

src/routes/docs/tutorials/typescript/step-6/+page.markdoc Outdated Show resolved Hide resolved
@gewenyu99
Copy link
Contributor

gewenyu99 commented Oct 31, 2023

Hey,
a
Due to time constraints, I'm going to mark this PR hacktoberfest-accepted for now so you get DO's Hacktoberfest rewards. We'll continue to work with you on this issue for review and merge.

When it is merged, we'll contact you for Appwrite-specific Hacktoberfest swag.

Thanks for helping us improve Appwrite!

@PrerakMathur20
Copy link
Author

Thank you so much for adding the label. I can assure you I'm working on fixing all these issues and will make a PR as soon as possible.

@tessamero
Copy link
Contributor

Hello @PrerakMathur20 ,

Thank you for your contribution to Hacktoberfest 2023! We've noticed that your PR is still pending and requires some updates based on our engineering team's feedback.

We would love to see your PR successfully merged and send you the Appwrite swag as a token of appreciation. To remain eligible for the swag, please address the pending suggestions and/or ensure the tests pass by Friday, November 17th. If the PR isn't updated by then, we will unfortunately have to close it due to the end of the Hacktoberfest event.

Looking forward to your updates and thank you!

Copy link

vercel bot commented Nov 17, 2023

@PrerakMathur20 is attempting to deploy a commit to the appwrite Team on Vercel.

A member of the Team first needs to authorize it.

@PrerakMathur20
Copy link
Author

@gewenyu99 Thanks a lot for all the insightful reviews. My apologies for the delay in getting back to them.

To create the TypeScript tutorial, I have taken inspiration from the React Tutorial, since they're not that different when it comes to converting JS to TS.

Here For all the reviews that I haven't resolved yet, all of them are inspired by the tutorial of React.
For eg. the src/routes/docs/tutorials/+page.svelte file in the TS tutorial is copied as is from the React Tutorial. So in my git lens, The white spaces are exactly the same as the React and the imports are the same.

The same goes for the src/routes/docs/tutorials/typescript/step-6/+page.markdoc file. If you still wish for me to make these changes I will, but can you please guide me on them as that file, because as per the latest pull, that file is entirely rewritten now in a completely different way.

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

Successfully merging this pull request may close these issues.

📚 Documentation: Tutorial for Appwrite with Typescript
3 participants