{"id":13550509,"url":"https://github.com/sbis04/rapyd_checkout","last_synced_at":"2025-03-18T09:30:38.233Z","repository":{"id":121353124,"uuid":"494344709","full_name":"sbis04/rapyd_checkout","owner":"sbis04","description":"A minimalistic story writing and publishing platform.","archived":false,"fork":false,"pushed_at":"2022-05-30T19:33:25.000Z","size":6568,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T08:29:57.938Z","etag":null,"topics":["appwrite","flutter","rapyd","sendgrid"],"latest_commit_sha":null,"homepage":"https://youtu.be/u0U6Mfzo3ig","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sbis04.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-05-20T06:18:03.000Z","updated_at":"2024-10-18T17:36:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"89588e0b-f3ef-49cc-9bfe-0ce7ca946e3b","html_url":"https://github.com/sbis04/rapyd_checkout","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbis04%2Frapyd_checkout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbis04%2Frapyd_checkout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbis04%2Frapyd_checkout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbis04%2Frapyd_checkout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sbis04","download_url":"https://codeload.github.com/sbis04/rapyd_checkout/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243910666,"owners_count":20367546,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["appwrite","flutter","rapyd","sendgrid"],"created_at":"2024-08-01T12:01:34.131Z","updated_at":"2025-03-18T09:30:36.297Z","avatar_url":"https://github.com/sbis04.png","language":"Dart","funding_links":[],"categories":["Dart"],"sub_categories":[],"readme":"# Slibro [![Codemagic build status](https://api.codemagic.io/apps/6240c24a66f743ede7aca591/android-workflow/status_badge.svg)](https://codemagic.io/apps/6240c24a66f743ede7aca591/android-workflow/latest_build)\n\n![](screenshots/slibro-rapyd-cover.png)\n\n**Slibro** is a full-fledged story writing and publishing platform that supports short and long format stories. [Flutter](https://flutter.dev/), [Appwrite](https://appwrite.io/), and [Rapyd](https://www.rapyd.net/)  is used to create this amazing cross-platform experience. Though I have focused mainly on the mobile side for building the UI and made sure it's a nice to use on small sized devices.\n\n\u003e Try out the app on Android from [here](https://appdistribution.firebase.dev/i/49e1c8034f8a2ab9).\n\n## Usage\n\nTo run this from your system, you should have:\n\n1. [Flutter SDK](https://docs.flutter.dev/get-started/install) installed and configured on your system.\n2. Setup Appwrite using Docker.\n3. Host the server locally using [ngrok](https://ngrok.com/).\n4. Under `lib` directory, create a `secrets.dart` file, and add the server URL and Appwrite project ID to it. Example:\n\n    ```dart\n    class Secrets {\n      static String hostname = 'https://127b-203-163-244-125.in.ngrok.io/v1';\n      static String projectID = '6276341092e81e829ab0';\n    }\n    ```\n5. Create a Rapyd developer account.\n6. Get the Rapyd Sandbox API key and secret.\n7. Add them to the `secrets.dart` file and use them inside the Rapyd Flutter SDK.\n8. Run using the following command:\n\n   ```sh\n   flutter run\n   ```\n\n\u003e ** The Dart code of the Flutter app is present inside the `lib` directory (in case you want to check out or review the code).\n\n## App Overview\n\nThe app now has full-fledged **story editor** (rich text - markdown), **story reader**, and **story management system** (to manage published/unpublished stories and explore other publisher's stories).\n\nSome glimpses of Slibro's user interface are as follows:\n\n![Slibro Auth Screens](screenshots/sr-1.png)\n\nThe above four screens cover the authentication flow on the app using email/password method. These screens help a user to either create a new account or login using an existing account. Once a user signs up to the app, it navigates to the story creation flow.\n\nOn a successful registration, a new user is created on Appwrite and a corresponding customer is created on Rapyd.\n \n![Slibro Story Detail Screens](screenshots/sr-2.png)\n\nOnce authenticated, there are two options - either start writing a new story right away, or navigate to the dashboard of the app.\n\nIf the user selects \"Start Writing\" - the next two screens help a user to create the first story as a draft in the Slibro app. The user can also publish the story following the flow.\n\n![Slibro Editor and Reader Screens](screenshots/sr-3.png)\n\nThe app consists of four main screens:\n\n* **Home Page:** Displays the list of all published stories inside the Slibro app.\n\n* **My Stories Page:** It has two sections, the first section displays your purchased stories (if any), and the next section displays the stories that you have written (if any).\n\n* **Cart Page:** Displays the list of stories that you have specifically added to the cart for purchasing. You can proceed with the checkout from this page.\n\n* **Profile:** Let's you view your profile information along with an options to edit your information. You will also find the log out button on this page.\n\n![Slibro Dashboard Screens](screenshots/sr-4.png)\n\nThe following pages shows if the users tries to checkout the cart items. It used the Rapyd Checkout Toolkit to open the embedded web view inside the app - there's a 2-way communication set up between Dart and JS.\n\nUser's card information and billing information is taken as a part of this process. And, once the payment is successful an invoice is automatically sent to the user's email via SendGrid. There's also an option to download the invoice.\n\n![Slibro Dashboard Screens](screenshots/sr-5.png)\n\n## Rapyd APIs\n\nThe following Rapyd APIs are used in this project:\n\n* [Customer API](https://docs.rapyd.net/build-with-rapyd/reference/customer-object): Used for creating and retrieving the customer information - mainly for storing the saved card information.\n\n* [Checkout API](https://docs.rapyd.net/build-with-rapyd/reference/checkout-page-object): Used for generating and retrieving the checkout ID for the products that the user wants to purchase - it's also required while loading the embedded checkout toolkit inside the app.\n\n## Appwrite APIs\n\nThree of the major Appwrite APIs are used:\n\n* [Account API](https://appwrite.io/docs/client/account?sdk=flutter-default): Used for implementing user authentication and user data management.\n* [Database API](https://appwrite.io/docs/client/database?sdk=flutter-default): Used for storing app data related to stories and chapters.\n* [Storage API](https://appwrite.io/docs/client/storage?sdk=flutter-default): Used for storing the Rich Text story file in JSON format.\n\n## Flutter packages\n\nA lot of community members for searching for a Flutter SDK to access the Rapyd APIs, so I have started working on a **[Rapyd Flutter SDK](https://pub.dev/packages/rapyd)**. The package is in very early stage of development and has limited APIs to interact with, but has some of the major functionality like calculation of the salt and signature for the header that is required for performing a valid API call.\n\nThis SDK should make the Rapyd API calls really easy to perform. Here's a small example of how a new customer can be created using the SDK:\n\n```dart\n// Initializing\nfinal rapydClient = RapydClient('\u003caccess_key\u003e', '\u003csecret_key\u003e');\n\ntry {\n  // Creating a new customer\n  final customer = await rapydClient.createNewCustomer(\n    email: 'example@name.com',\n    name: 'User',\n  );\n  print('Created customer successfully, ID: ${customer.data.id}');\n} catch (e) {\n  print('ERROR: ${e.toString()}');\n}\n```\n\n\u003e This project used the Rapyd Flutter SDK for perform the API Calls!\n\nThe following Flutter packages are used to build this app:\n\n* [rapyd](https://pub.dev/packages/rapyd)\n* [appwrite](https://pub.dev/packages/appwrite)\n* [flutter_quill](https://pub.dev/packages/flutter_quill)\n* [path_provider](https://pub.dev/packages/path_provider)\n* [shared_preferences](https://pub.dev/packages/shared_preferences)\n* [google_nav_bar](https://pub.dev/packages/google_nav_bar)\n* [tuple](https://pub.dev/packages/tuple)\n* [image_cropper](https://pub.dev/packages/image_cropper)\n* [image_picker](https://pub.dev/packages/image_picker)\n* [http](https://pub.dev/packages/http)\n* [convert](https://pub.dev/packages/convert)\n* [crypto](https://pub.dev/packages/crypto)\n* [webview_flutter_plus](https://pub.dev/packages/webview_flutter_plus)\n* [rive](https://pub.dev/packages/rive)\n* [printing](https://pub.dev/packages/printing)\n* [file_saver](https://pub.dev/packages/file_saver)\n* [sendgrid_mailer](https://pub.dev/packages/sendgrid_mailer)\n\n## License\n\nCopyright (c) 2022 Souvik Biswas\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbis04%2Frapyd_checkout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsbis04%2Frapyd_checkout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbis04%2Frapyd_checkout/lists"}