GSYGithubAppCompose
Compose 超完整的开源项目,功能丰富,适合学习和日常使用。GSYGithubApp 系列的优势:我们目前已经拥有 Flutter、Weex、ReactNative、Kotlin View、Kotlin Jetpack Compose 五个版本,功能齐全,项目框架内技术涉及面广,完成度高,持续维护,配套文章,适合全面学习,对比参考。
Install / Use
/learn @CarGuo/GSYGithubAppComposeREADME

一款 Android 原生的开源 Github 客户端 App,提供更丰富的功能,更好体验,旨在更好的日常管理和维护个人 Github,提供更好更方便的驾车体验~~Σ( ̄。 ̄ノ)ノ,项目采用 Jetpack Compose 开发,并提供丰富的同款对比:
-
同款 Flutter 版 ( https://github.com/CarGuo/GSYGithubAppFlutter )
-
同款 Kotlin View 版 ( https://github.com/CarGuo/GSYGithubAppKotlin )
-
同款 ReactNative 版 ( https://github.com/CarGuo/GSYGithubApp )
-
同款 Weex 版 ( https://github.com/CarGuo/GSYGithubAppWeex )
-
如果克隆太慢或者图片看不到,可尝试从码云地址下载
| 公众号 | 掘金 | 知乎 | CSDN | 简书
|---------|-------------------------------------------------------------|-------------------------------------------|-----------------------------------------|----------------------------------------------|
| GSYTech | 点我 | 点我 | 点我 | 点我
基于 Jetpack Compose 开发的原生 Android App 。目前初版,持续完善中。
项目的目的是为方便个人日常维护和查阅 Github ,同时适合 Compose 练手学习,覆盖了各种框架的使用。
随着项目的使用情况和反馈,将时不时根据更新并完善用户体验与功能优化吗,欢迎提出问题。
| | | | |
|------------|------------|------------|------------|
|
|
|
|
|
编译运行流程
环境要求:项目使用了 AGP 9,至少需要 Android Studio Otter (2025.1.1) Feature Drop 或更高版本才能正常编译运行。
重点:你需要项目根目录下,配置
local.properties文件,然后输入你申请的Github client_id 和 client_secret。
ndk.dir="xxxxxxxx"
CLIENT_ID = "xxxxxx"
CLIENT_SECRET = "xxxxxx"
注册 Github APP 传送门 ,当然,前提是你现有一个github账号(~ ̄▽ ̄)~ 。
3、现在 Github API 需要使用安全登录(授权登录),那么在上述注册 Github App 的 Authorization callback URL 一栏必须填入
gsygithubapp://authed
项目结构图
KeyFeatures

Core Technologies

Layer Structure

Technology Stack

Navigation Flow

Data Flow Architecture

整体架构图
┌─────────────────────────────────────────────────────────────────────────┐
│ GSYGithubAppCompose │
│ (Jetpack Compose + MVVM) │
└─────────────────────────────────────────────────────────────────────────┘
│
┌───────────────────┼───────────────────┐
│ │ │
┌───────▼────────┐ ┌──────▼──────┐ ┌───────▼────────┐
│ Presentation │ │ Data │ │ Core │
│ Layer │ │ Layer │ │ Layer │
└────────────────┘ └─────────────┘ └────────────────┘
│ │ │
┌───────▼────────┐ ┌──────▼──────┐ ┌───────▼────────┐
│ feature/* │ │ data │ │ core/network │
│ │ │ │ │ core/database │
│ - welcome │ │ Repository │ │ core/common │
│ - login │ │ Pattern │ │ core/ui │
│ - home │ │ │ └────────────────┘
│ - dynamic │ │ - User │
│ - trending │ │ - Event │
│ - profile │ │ - Repo │
│ - search │ └─────────────┘
│ - detail │
│ - code │
│ - issue │
│ - push │
│ - list │
│ - notification │
│ - info │
│ - history │
└────────────────┘
模块依赖关系图
┌─────────┐
│ app │
└────┬────┘
│
┌───────────────────────┼────────────────────────┐
│ │ │
┌──────▼──────┐ ┌─────▼─────┐ ┌──────▼──────┐
│ feature/* │ │ data │ │ core/ui │
│ │ │ │ │ │
│ 所有功能模块 │◄────────┤ Repository │ │ 通用UI组件 │
│ │ │ │ │ │
└──────┬──────┘ └─────┬─────┘ └──────┬──────┘
│ │ │
│ ┌───────┼────────┐ │
│ │ │ │ │
└──────────────┼───────┼────────┼──────────────┘
│ │ │
┌───────────▼─┐ ┌──▼────────▼──┐ ┌─────────────┐
│core/network │ │core/database │ │core/common │
│ │ │ │ │ │
│ Retrofit │ │ Room │ │ DataStore │
│ Apollo │ │ Entity │ │ Token │
│ Model │ │ DAO │ │ Resources │
└─────────────┘ └──────────────┘ └─────────────┘
依赖规则:
app → feature/*, core/ui, data
feature/* → data, core/ui, core/common
data → core/network, core/database, core/common
core/ui → core/common
core/network → (独立模块)
core/database→ (独立模块)
core/common → (独立模块)
模块详细结构
GSYGithubAppCompose/
│
├── app/ # 主应用模块
│ ├── MainActivity.kt # 主入口,导航配置
│ ├── MainViewModel.kt # 应用级 ViewModel
│ └── GSYApplication.kt # Application,Hilt 入口
│
├── core/ # 核心基础模块
│ │
│ ├── network/ # 网络层
│ │ ├── api/
│ │ │ └── GitHubApiService.kt # GitHub REST API 接口
│ │ ├── model/ # 网络数据模型
│ │ │ ├── User.kt
│ │ │ ├── Repository.kt
│ │ │ ├── Event.kt
│ │ │ └── ...
│ │ ├── config/
│ │ │ └── NetworkConfig.kt # 网络配置(PAGE_SIZE等)
│ │ └── di/
│ │ └── NetworkModule.kt # Retrofit、OkHttp、Apollo DI
│ │
│ ├── database/ # 数据库层
│ │ ├── entity/ # Room Entity
│ │ │ ├── UserEntity.kt
│ │ │ ├── RepositoryEntity.kt
│ │ │ ├── HistoryEntity.kt
│ │ │ └── ...
│ │ ├── dao/ # Room DAO
│ │ │ ├── UserDao.kt
│ │ │ ├── RepositoryDao.kt
│ │ │ ├── HistoryDao.kt
│ │ │ └── ...
│ │ ├── AppDatabase.kt # Room Database 配置
│ │ └── di/
│ │ └── DatabaseModule.kt # Room DI
│ │
│ ├── common/ # 公共资源模块
│ │ ├── datastore/
│ │ │ └── UserPreferencesDataStore.kt # 用户偏好存储
│ │ ├── utils/
│ │ │ └── StringResourceProvider.kt # 字符串资源提供者
│ │ ├── di/
│ │ │ └── CommonModule.kt # DataStore DI
│ │ └── res/ # 公共资源
│ │ ├── values/ # 英文资源
│ │ │ └── strings.xml
│ │ └── values-zh-rCN/ # 中文资源
│ │ └── strings.xml
│ │
│ └── ui/ # UI组件模块
│ ├── components/
│ │ ├── GSYPullRefresh.kt # 下拉刷新控件
│ │ ├── GSYGeneralLoadState.kt # 通用加载状态
│ │ ├── GSYTopAppBar.kt # 通用标题栏
│ │ ├── GSYLoadingDialog.kt # 加载对话框
│ │ └── ...
│ ├── navigation/
│ │ ├── GSYNavigator.kt # 导航器
│ │ └── GSYNavHost.kt # 导航Host
│ ├── theme/
│ │ ├── Theme.kt # Material 3 主题
│ │ ├── Color.kt # 颜色定义
│ │ └── Type.kt # 字体定义
│ └── base/
│ ├── BaseScreen.kt # 基础Screen(Toast支持)
│ └── ...
│
├── data/ # 数据层
│ ├── repository/ # Repository 实现
│ │ ├── UserRepository.kt # 用户数据仓库
│ │ ├── EventRepository.kt # 事件数据仓库
│ │ ├── RepositoryRepository.kt # 仓库数据仓库
│ │ ├── HistoryRepository.kt # 浏览历史数据仓库
│ │ └── vm/
│ │ ├── BaseViewModel.kt # 基础 ViewModel
│ │ └── BaseUiState.kt # 基础 UI 状态
│ └── mapper/
│ └── DataMappers.kt # 数据映射(Entity ↔ Model)
│
└── feature/ # 功能模块
│
├── welcome/ # 欢迎页
│ ├── WelcomeScreen.kt
│ └── WelcomeViewModel.kt
│
├── login/ # 登录页
│ ├── LoginScreen.kt
│ └── LoginVie
