{"id":15695881,"url":"https://github.com/ayushbherwani1998/unsplash_sample","last_synced_at":"2025-05-08T22:31:02.875Z","repository":{"id":184178746,"uuid":"671419919","full_name":"AyushBherwani1998/unsplash_sample","owner":"AyushBherwani1998","description":"This repository showcases the implementation of Flutter concepts such as Pagination, Bloc pattern, Dependency Injection (DI), Code Coverage, Testing, Clean Architecture, Analytics using Mixpanel and Feature flagging using Unleash","archived":false,"fork":false,"pushed_at":"2024-01-22T03:32:25.000Z","size":875,"stargazers_count":10,"open_issues_count":5,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T19:01:43.279Z","etag":null,"topics":["analytics","bloc","codecov","dart","dependency-injection","feature-flags","flutter","unleash","workflows"],"latest_commit_sha":null,"homepage":"","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/AyushBherwani1998.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,"publiccode":null,"codemeta":null}},"created_at":"2023-07-27T09:20:35.000Z","updated_at":"2024-09-08T06:23:17.000Z","dependencies_parsed_at":"2023-09-22T10:50:05.750Z","dependency_job_id":"459843f3-3b68-44b1-be8b-d5f741e3c1dd","html_url":"https://github.com/AyushBherwani1998/unsplash_sample","commit_stats":{"total_commits":66,"total_committers":2,"mean_commits":33.0,"dds":0.2272727272727273,"last_synced_commit":"88b6f76a810cf3b4f5e734a004ec50392fff2636"},"previous_names":["ayushbherwani1998/unplash_sample","ayushbherwani1998/unsplash_sample"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AyushBherwani1998%2Funsplash_sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AyushBherwani1998%2Funsplash_sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AyushBherwani1998%2Funsplash_sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AyushBherwani1998%2Funsplash_sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AyushBherwani1998","download_url":"https://codeload.github.com/AyushBherwani1998/unsplash_sample/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253157639,"owners_count":21863141,"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":["analytics","bloc","codecov","dart","dependency-injection","feature-flags","flutter","unleash","workflows"],"created_at":"2024-10-03T19:05:16.546Z","updated_at":"2025-05-08T22:31:02.843Z","avatar_url":"https://github.com/AyushBherwani1998.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n![unsplash_sample](https://github.com/AyushBherwani1998/unsplash_sample/actions/workflows/main.yml/badge.svg?branch=main)\n[![codecov](https://codecov.io/gh/AyushBherwani1998/unsplash_sample/branch/main/graph/badge.svg?token=N2TBGQQPCU)](https://codecov.io/gh/AyushBherwani1998/unsplash_sample)\n![license](https://img.shields.io/badge/license-MIT-blue.svg)\n# Unsplash Sample Flutter Project\n\n\u003cp align= \"center\"\u003e\n  \u003cimg src=\"./assets/logos/unsplash_logo.png\" height=\"200\"/\u003e\n\u003c/p\u003e\n\nWelcome to the Unsplash Sample Flutter Project! This repository showcases the implementation of Flutter concepts such as Bloc pattern, Dependency Injection (DI), Code Coverage, Testing, Clean Architecture, Analytics using [Mixpanel](https://mixpanel.com/home/), Feature flagging \u0026 A/B testing using [Unleash](https://www.getunleash.io). Whether you're a Flutter enthusiast or a developer aiming to learn these practices, this project offers valuable insights.\n\n## Table of Contents\n\n - [Features](#features)\n - [Getting Started](#getting-started)\n   - [Prerequisites](#prerequisites)\n   - [Installation](#installation)\n   - [Start Unleash](#start-unleash)\n   - [Enviroment](#enviroment)\n - [Project Structure](#project-structure)\n - [Dependency Injection](#dependency-injection)\n - [Testing](#testing)\n - [CodeCoverage](#code-coverage)\n - [License](#license)\n - [Analytics](#analytics)\n - [A/B Testing](#ab-testing)\n\n## Features\n\n- Implementation of the Bloc pattern for efficient state management.\n- Utilization of GetIt for managing and injecting dependencies.\n- Codecov setup to ensure thorough testing and quality assurance.\n- Well-organized project structure following Clean Architecture principles.\n- Utilization of Unleash to demonstrate feature flagging.\n- Utilization of Unleash and Mixpanel to demonstrate A/B testing.\n- Integration of MixPanel to track user behavior and analyze app usage patterns for better insights.\n\n## Getting Started\n\nFollow these steps to set up and run the project on your local machine.\n\n### Prerequisites\n\n - Ensure that you have [Flutter](https://flutter.dev/docs/get-started/install) installed on your machine.\n - [Git](https://git-scm.com/)\n - [Docker](https://www.docker.com/)\n - Ensure that you have [Unplash API key](https://unsplash.com/documentation#creating-a-developer-account)\n - Ensure that you have [Mixpanel API key](https://docs.mixpanel.com/docs/tracking/how-tos/api-credentials)\n### Installation\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/AyushBherwani1998/unsplash_sample.git\n   ```\n\n2. Navigate to the project directory:\n   ```bash\n   cd unsplash_sample\n   ```\n\n3. Install dependencies:\n   ```bash\n   flutter pub get\n   ```\n### Start Unleash \n\n1. Clone the Unleash repo:\n   ```bash\n    git clone git@github.com:Unleash/unleash.git\n    cd unleash\n   ```\n2. Create and attach container:\n   ```bash\n   docker compose up -d\n   ```\n\nThe Unleash instance will be up and running on localhost:4242. The default username and password will be `admin` \u0026 `unleash4all` respectively.\n\n### Enviroment\n\nYou need to setup envoirment while working on this sample. Create a `.env` file under `lib/core/` with the following content:\n   ```\n    UNSPLASH_API_KEY = hgs9ZVWrHQncX8d9tLmy-zq21412\n    UNLEASH_API_KEY = *:development.xxxxyyyyzzz\n    MIXPANEL_API_KEY = f9cbf11xxxxxxxxxxxxc695db39a\n   ```\n\n## Project Structure\n\nThe project adheres to Clean Architecture principles, promoting separation of concerns and maintainability. Notable directories include:\n\n- `lib/features/**`: Contains the primary application code.\n- `lib/features/**/data/`: Manages data handling, repositories, and data sources.\n- `lib/features/**/domain/`: Encompasses business logic, use cases, and entities.\n- `lib/features/**/presentation/`: Handles UI components, Blocs, and Widgets.\n\n## Dependency Injection\n\nDependency Injection (DI) is facilitated using the [get_it](https://pub.dev/packages/get_it) package. This fosters organized code and enhanced testability by efficiently managing dependencies.\n\n## Testing\n\nUnit and widget tests are included to ensure code reliability. Execute tests with the following command:\n\n```\n flutter test\n```\n\n## Code Coverage\n\nCode coverage is enforced using test coverage tools like [codecov](https://about.codecov.io/). This helps track tested code areas and identifies segments needing more thorough testing. You can checkout the Grid graph for the repo below:\n\n\u003cimg src=\"https://codecov.io/gh/AyushBherwani1998/unsplash_sample/branch/main/graphs/tree.svg?token=N2TBGQQPCU\"\u003e\n\n## Analytics\n\nFor app analytics we are using Mixpanel. It's used to track the user behavoiour and usage pattern in the application. You can checkout a gist of app analytics in the screenshot given below: \n\n\u003cimg src=\"./assets/images/mixpanel.png\"\u003e\n\n## A/B testing\nFor the app we are using Unleash to perform A/B testing and mixpanel to collect analytics and funnel.\n\n ### Configuration:\n - Create `likeOptionExperiment` flag in Unleash instance with toggle called `experiment`\n - Create two varinats `gridTile` and `imageDetails` for testing\n - Enable the flags :tada:\n\nBelow is a funnel screenshot for “like image” experimentation\n\n\u003cimg src=\"./assets/images/mixpanel_report.png\"\u003e\n\n## License\n```\nMIT License\n\nCopyright (c) 2023 Ayush Bherwani\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```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayushbherwani1998%2Funsplash_sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fayushbherwani1998%2Funsplash_sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayushbherwani1998%2Funsplash_sample/lists"}