{"id":18048443,"url":"https://github.com/ch8n/instastories","last_synced_at":"2025-04-05T05:17:05.198Z","repository":{"id":251235986,"uuid":"836784732","full_name":"ch8n/InstaStories","owner":"ch8n","description":"Demo application for Instagram like story feature","archived":false,"fork":false,"pushed_at":"2024-08-21T13:04:33.000Z","size":14329,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T13:14:31.996Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ch8n.png","metadata":{"files":{"readme":"ReadMe.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-08-01T14:50:33.000Z","updated_at":"2024-08-21T13:04:36.000Z","dependencies_parsed_at":"2024-10-30T20:13:04.253Z","dependency_job_id":"fd319015-d99c-4061-a322-4b8d8344660a","html_url":"https://github.com/ch8n/InstaStories","commit_stats":null,"previous_names":["ch8n/instastories"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ch8n%2FInstaStories","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ch8n%2FInstaStories/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ch8n%2FInstaStories/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ch8n%2FInstaStories/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ch8n","download_url":"https://codeload.github.com/ch8n/InstaStories/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247289434,"owners_count":20914464,"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":[],"created_at":"2024-10-30T20:12:56.871Z","updated_at":"2025-04-05T05:17:05.177Z","avatar_url":"https://github.com/ch8n.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Documentation\n\n### Get apk from [here](./app-demo.apk)\n\n## Directory structure\n```\n.\n└── instastories\n    ├── Data.kt\n    ├── MainActivity.kt\n    ├── data\n    │   ├── remote\n    │   │   ├── StoriesService.kt\n    │   │   └── injector\n    │   │       ├── OkHttpClientProvider.kt\n    │   │       └── RemoteServiceProvider.kt\n    │   └── repositories\n    │       └── StoryRepository.kt\n    ├── domain\n    │   ├── injector\n    │   │   ├── RepositoryProvider.kt\n    │   │   └── UseCasesProvider.kt\n    │   ├── models\n    │   │   └── Story.kt\n    │   └── usecases\n    │       └── GetStoriesRemoteUseCase.kt\n    ├── server\n    │   └── EmbeddedServer.kt\n    ├── ui\n    │   ├── features\n    │   │   ├── AppNavigation.kt\n    │   │   ├── storiesHome\n    │   │   │   ├── StoriesScreen.kt\n    │   │   │   ├── StoryViewModel.kt\n    │   │   │   └── components\n    │   │   │       └── CircularUserIcon.kt\n    │   │   └── storiesPreview\n    │   │       ├── StoriesPreviewScreen.kt\n    │   │       ├── StoryPreviewViewModel.kt\n    │   │       └── component\n    │   │           ├── AutoScrollIndicator.kt\n    │   │           ├── AutoScrollingPager.kt\n    │   │           └── CrossIcon.kt\n    │   ├── injector\n    │   │   └── AppInjector.kt\n    │   └── theme\n    │       ├── Color.kt\n    │       ├── Theme.kt\n    │       └── Type.kt\n    └── utils\n        ├── Extensions.kt\n        └── TestTags.kt\n\n```\n\n## Architecture\n![App arch](./arch.png)\n\nThe `instastories` application follows a structured architecture to ensure modularity and maintainability:\n\n- **Data Layer**: Manages remote data access via `StoriesService` and repositories like `StoryRepository`, with dependency injection provided by `OkHttpClientProvider` and `RemoteServiceProvider`.\n- **Domain Layer**: Contains core business logic, including use cases such as `GetStoriesRemoteUseCase`, and domain models like `Story`. Dependency injection is handled by `RepositoryProvider` and `UseCasesProvider`.\n- **Server**: Includes `EmbeddedServer` for backend operations.\n- **UI Layer**: Composed of feature-specific screens and view models, such as `StoriesScreen` and `StoryViewModel`, with UI components and themes.\n- **Utils**: Provides extension functions and test tags for enhanced functionality.\n\n## Dependency Injection\nApplication is small level therefore isnt require complex solutions such\nas koin or Dagger/hilt, \n\nImplemented manual DI I explain more about it [here](https://proandroiddev.com/hold-on-before-you-dagger-or-hilt-try-this-simple-di-f674c83ebeec)\n\n## Server \n\nIn this application, I have embedded a Ktor server within the app itself. It automatically starts in `MainActivity`'s `onCreate` method and stops in `onDestroy`. To test it, simply install the application and visit [http://localhost:8080/chetan/api/stories](http://localhost:8080/chetan/api/stories) from your mobile chrome browser. \n\nYou can learn more about Ktor [here](https://ktor.io/docs/server-create-a-new-project.html).\n\n\n## UI features\n\n### Functional Requirements\nImplement the following features:\n- [x] A list of stories should be visible in a smaller view in a horizontally scrollable list.\n- [x] The data for stories should be served by a backend API.\n- [x] User should be able to start viewing one of the available stories from list.\n- [x] Stories should automatically advance to the next one after a set duration (say 5 seconds).\n- [x] The user should be able to manually navigate between stories using UI controls. Tapping on the left\n  side of an open story should take\n- [x] the user to the previous story. Tapping on the right side of an open story should take the suer to\n  the next story.\n- [x] Use animations or transitions for smoother story transitions and UI interactions.\n\n### Non-Functional Requirements\n- [x] Performance - stories should load smoothly without any delay from the backend or observable delay in loading of images.\n- [x] Tests - Write Integration tests for this feature.\n- [x] Caching - Write a service to cache the API response.\n\n### Technical Requirements\n- [x] Language: Kotlin\n- [x] Framework: Native Android\n- [x] Testing Framework: Feel free to use any testing framework of your choice.\n- [x] CI/CD Pipelines: use any service of your choice to run tests on every push.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fch8n%2Finstastories","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fch8n%2Finstastories","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fch8n%2Finstastories/lists"}