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 Apple #217

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

Conversation

Mujhtech
Copy link

@Mujhtech Mujhtech commented Oct 7, 2023

What does this PR do?

Added tutorial for Apple in Docs

Test Plan

The Tutorial can be found in the route /docs/tutorials/apple/step-1

Related PRs and Issues

#94

Have you read the [Contributing Guidelines on issues]

Yes

close #94

@vercel
Copy link

vercel bot commented Oct 7, 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 31, 2023 6:28am

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, thank you so much for your PR. I really like that you create a habit tracker app, which is unique and super interesting.

I have some comments, and some of them apply to all pages, please carefully review them and apply to them all.

Let's fix these formatting issues, then I'll take a look at the code.

The Appwrite docs, just like Appwrite, is completely open sourced.
This means, anyone can help improve them and add new guides and tutorials.
{% only_dark %}
![Habit Tracker Screenshot](/images/docs/tutorials/dark/apple-habit-tracker.png)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please give me originals of all your screenshots taking in a 1400x900 view port using DPR:3.0 on your browser's developer tools.

We will have our design team edit the screenshots to fit our style.

Copy link
Contributor

Choose a reason for hiding this comment

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

@Mujhtech please provide original images for all screenshots.

Copy link
Author

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

Those are the screenshots @gewenyu99

}
```

Add the following code to HomeScreen.swift inside **Home/View** folder. Here we will be using newly introduce ``ContentUnavailableView`` if the habits is empty else render ``HabitCellView`` inside the loop.
Copy link
Contributor

Choose a reason for hiding this comment

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

The code tags aren't correct here.

Copy link
Contributor

Choose a reason for hiding this comment

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

This was not resolved

Copy link
Contributor

Choose a reason for hiding this comment

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

Code tags here aren't working, should be single ` instead of two

@gewenyu99
Copy link
Contributor

@Mujhtech Remember to rerequest review from me so I know it's ready to look at again!

@Mujhtech
Copy link
Author

@gewenyu99 You can check this out, I have pushed some update

@Mujhtech
Copy link
Author

@gewenyu99 You can check this out, I have pushed some update

@gewenyu99

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.

Hi, did you forget to push your changes, my comments were not resolved.

The Appwrite docs, just like Appwrite, is completely open sourced.
This means, anyone can help improve them and add new guides and tutorials.
{% only_dark %}
![Habit Tracker Screenshot](/images/docs/tutorials/dark/apple-habit-tracker.png)
Copy link
Contributor

Choose a reason for hiding this comment

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

@Mujhtech please provide original images for all screenshots.

}
```

Add the following code to HomeScreen.swift inside **Home/View** folder. Here we will be using newly introduce ``ContentUnavailableView`` if the habits is empty else render ``HabitCellView`` inside the loop.
Copy link
Contributor

Choose a reason for hiding this comment

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

This was not resolved

Comment on lines +169 to +177
ContentUnavailableView(label: {
Label("No habits", systemImage: "calendar")
}, description: {
Text("Start adding habit to see your list")
}, actions: {
Button("Add Habit") {
router.push(.add_habit)
}
})
Copy link
Author

Choose a reason for hiding this comment

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

This is what I was trying to reference to

@TorstenDittmann TorstenDittmann added the documentation Improvements or additions to documentation label Oct 18, 2023
@Haimantika Haimantika requested a review from gewenyu99 October 19, 2023 11:42
@Mujhtech
Copy link
Author

@gewenyu99

Comment on lines 80 to 93
Create a database file in the **Shared/Constant** folder to contain the database id and collection id.

```swift
import Foundation

enum Database: String {
case habit = "[DATABASE_ID]"
}


enum DatabaseCollections : String {
case habits = "[COLLECTION_ID]"
}
```
Copy link
Author

Choose a reason for hiding this comment

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

Here @gewenyu99

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 work, but I think we have a lot of missing information and changes needed still. Can you upload the full app code into a repo, too? So I can go check and see when there's something missing/weird when I'm following, so there's less back and forth.


# Router {% #router %}

Add the following code to Router.swift File in the root folder
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like we need just a little more explanation, not a lot, in each of these steps to describe what the files do and point out any documentation to swift docs that are relevant.

}
}

#Preview {
Copy link
Contributor

Choose a reason for hiding this comment

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

This a typo?

@Mujhtech
Copy link
Author

Hey, great work, but I think we have a lot of missing information and changes needed still. Can you upload the full app code into a repo, too? So I can go check and see when there's something missing/weird when I'm following, so there's less back and forth.

Here is the link to the repository https://github.com/Mujhtech/appwrite-hacktoberfest

@gewenyu99
Copy link
Contributor

@Mujhtech Have you had a chance to take a look at my comments?

@Mujhtech
Copy link
Author

Have you checked the link? I was kind of expecting your feedback and note I'm still working on your comment and will resolve all by tomorrow @gewenyu99

@gewenyu99
Copy link
Contributor

Screenshot 2023-10-30 at 5 52 45 PM @Mujhtech If you were wondering, I couldn't build your project at all

@gewenyu99
Copy link
Contributor

Are you on Xcode 15? Xcode 15 is currently in beta and iOS 17 is not wide spread. Can you revert to a previous directive in your app?

@gewenyu99
Copy link
Contributor

Hey,

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!

@gewenyu99
Copy link
Contributor

gewenyu99 commented Oct 31, 2023

Hey,

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!

@Mujhtech
Copy link
Author

Mujhtech commented Nov 1, 2023

Are you on Xcode 15? Xcode 15 is currently in beta and iOS 17 is not wide spread. Can you revert to a previous directive in your app?

Yes, I'm using Xcode 15, and it is stable. You can comment on those preview directives and it should work, or can I do it and push the changes? Also I have push some update here @gewenyu99

@Mujhtech Mujhtech requested a review from gewenyu99 November 13, 2023 16:16
Copy link
Contributor

@Kilo-Loco Kilo-Loco left a comment

Choose a reason for hiding this comment

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

There is a lot of great work here:

  • You are going through steps that will be very valuable for users
  • Your opinionated approach will likely teach users some best practices for SwiftUI
  • You're paving the way for iOS devs to understand how Appwrite can be used in their projects

I think it's worth noting that this tutorial will not help Appwrite achieve parity with the other platforms. While it's innovative to show how to build an app other than an idea tracker with Appwrite, any multilingual devs, or teams looking to familiarize themselves with Appwrite, will not have consistent resources across those platforms. Additionally, this tutorial goes above and beyond an Auth recipe, which means it doesn't sufficiently fix #94 .

All things considered, I'd like to know what @Mujhtech and @gewenyu99 think should be the next steps for this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this screenshot being used in the tutorial? Also, why is it different from static/images/docs/tutorials/xcode-new-project-setup.png ?

Copy link
Author

Choose a reason for hiding this comment

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

Yeah it is, @gewenyu99 mentioned I used at least provide screenshot for both dark and light mode so one is dark while other one light.

Copy link
Contributor

Choose a reason for hiding this comment

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

Several views are being implemented in this step; we should consider including screenshots of the different views. This will help users following along by ensuring their UI looks as expected and help users simply reading through to visually understand what is happening in the app.

Copy link
Author

Choose a reason for hiding this comment

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

I think the idea is to limit the number of files added to the repo as much as possible so that's while in the header screenshot I made sure that all those screenshot are included

Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this UI different/special that it deserves its own step outside of the Habit UI step?

Copy link
Author

Choose a reason for hiding this comment

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

That's the UI for creating/add new habit.

@Mujhtech
Copy link
Author

@Kilo-Loco I have pushed some changes, you can go through it again.

@Mujhtech Mujhtech requested a review from Kilo-Loco January 30, 2024 01:44
Copy link
Contributor

@Kilo-Loco Kilo-Loco left a comment

Choose a reason for hiding this comment

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

LGTM. Good job @Mujhtech

Copy link
Contributor

@Kilo-Loco Kilo-Loco left a comment

Choose a reason for hiding this comment

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

This looks really good and we are definitely nearing the end. I think that we should consider removing the reference and step that shows OAuth as the tutorial isn't illustrating that specific flow.

@@ -7,7 +7,7 @@ step: 4

# Appwrite service {% #appwrite-service %}

Create a new file AppwriteService.swift inside `Shared/Services` folder and add the following code to it, replacing [YOUR_PROJECT_ID] with your project ID.
Create a new file AppwriteService.swift inside `Shared/Services` folder and add the following code to it, replacing [YOUR_PROJECT_ID] with your project ID. The purpose of this file is to initialize Appwrite SDK and create necessary methods needed for both authentication and read/write from documents.
Copy link
Contributor

Choose a reason for hiding this comment

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

I like that clarification was added here 👍🏽

@@ -7,6 +7,66 @@ step: 6

# Authentication {% #authentication %}

In order to allow creating OAuth sessions, the following URL scheme must be added to your **Info.plist** file.
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we are actually using OAuth in this flow. This means we should be able to omit the changes to the Info.plist altogether.

In `AppwriteService.swift`, let's update the object to include the auth methods by adding the following snippets.

```swift
public func currentSession() async throws -> User<[String: AnyCodable]> {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should either change the name or the functionality of the function to match what is actually happening. The function is getting the current user as is, but if we want to show it getting the current session, we should use the snippet below:

Suggested change
public func currentSession() async throws -> User<[String: AnyCodable]> {
func currentSession() async throws -> Session {
try await account.getSession(
sessionId: "current"
)
}

@@ -8,3 +8,15 @@ step: 10
# Test your project {% #test-project %}
At the top level menu click on **Product** then **Scheme** and click on **Choose scheme**, you will notice that the active scheme is selected if not click on it to mark it selected then next to it select any iOS Simulator you wish to run the app on then click on play button.

# Delete Appwrite Project in Console {% #delete-appwrite-project-in-console %}
Copy link
Contributor

Choose a reason for hiding this comment

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

I love that we are showing the user how to remove their project from the console. This is a huge plus in terms of keeping their account secure 😍

@Kilo-Loco
Copy link
Contributor

I still want us to consider whether this PR actually addresses #94 like the SvelteKit tutorial or if it is providing the user with a Mobile and Native tutorial like Android Tutorial.

@gewenyu99
Copy link
Contributor

@Mujhtech Hey there! There were a lot of big PRs during this Hacktoberfest, and we wanted to give everyone ample time to collaborate with our engineering team. If you were able to merge your PRs during October, amazing. If it’s still not merged, don’t worry about it either. Either way, we’ve got your Hacktoberfest swag minted and ready to ship.

Please comment with your Discord username here so we can contact you about your shipping information to deliver your Hacktoberfest swag.

@Mujhtech
Copy link
Author

Mujhtech commented Apr 8, 2024

@gewenyu99 my discord username is mujhtech

@Mujhtech
Copy link
Author

@gewenyu99 Please kindly confirm when you see it and also I dropped message to your DM on Discord

@gewenyu99
Copy link
Contributor

Be in touch soon! Putting together some last minute things we need :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation hacktoberfest-accepted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

📚 Documentation: Deep dive authentication recipe with Apple
4 participants