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

🚀 Feature: Unify Dart and Flutter Package #588

Open
2 tasks done
Mabenan opened this issue Nov 16, 2022 · 3 comments
Open
2 tasks done

🚀 Feature: Unify Dart and Flutter Package #588

Mabenan opened this issue Nov 16, 2022 · 3 comments

Comments

@Mabenan
Copy link

Mabenan commented Nov 16, 2022

🔖 Feature description

At the moment we have different SDKs for Backend (Dart) and Frontend (Flutter). This is not optimal for people who want to reduce their boilerplate code.

For example if someone want to use the same strongly typed data models in functions like he does in the frontend he is forced to write a lot of Boilerplate code to first generalize the API calls in a Package and then again define specific for the appwrite packages in a Server Package and Client Package again.

🎤 Pitch

My Idea is to create a Dart SDK booth used by Dart and Flutter and then one Specific Flutter SDK which is only used by Flutter.

In the specific Flutter framework only things like OAuth or other Frontend Specific things are defined.

This can be done b using Mixins in the Flutter SDK.

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@stnguyen90
Copy link
Contributor

Thanks for raising this issue! 🙏🏼

For example if someone want to use the same strongly typed data models in functions like he does in the frontend he is forced to write a lot of Boilerplate code to first generalize the API calls in a Package and then again define specific for the appwrite packages in a Server Package and Client Package again.

Can you expand more on the boilerplate?

@Mabenan
Copy link
Author

Mabenan commented Nov 16, 2022

I created abstract API class which has basically the same methods like database,account,team and so on.

Then I have a singelton Class which holds an instance of the API that is given over an Init method.

In Server functions I created an Implementation of the API class that uses dart_appwrite package

In Client code I created an Implementation of the API class that uses appwrite package

@eldadfux
Copy link
Member

We did this split for a few reasons:

  1. A lot of the server or client method don't work in the opposite environment and no way for someone to understand that just like that no matter how familiar they are with Appwrite

  2. Using an API key for authentication on the client is very dangerous. In the past we had the web SDK including both functionalities and we saw a lot of developers passing an API key on the client side, this is very risky.

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

No branches or pull requests

3 participants