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

Scrum 86 #11

Merged
merged 12 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,27 @@
# book_report
독후감을 작성하고 관리할 수 있는 서비스
# 프로젝트 소개
독후감을 작성하고 관리할 수 있는 서비스를 제공합니다. 도서와 태그를 선택해 독후감에 추가하여 저장할 수 있습니다.
[Google 권장 아키텍처](https://developer.android.com/topic/architecture?hl=ko&_gl=1*1kcgipb*_up*MQ..*_ga*MTgwMzU4NjM3Mi4xNzI1MDIyNzE3*_ga_6HH9YJMN9M*MTcyNTAyMjcxNy4xLjAuMTcyNTAyMjcxNy4wLjAuMA..) 및 [now in android](https://github.com/android/nowinandroid/tree/main) 를 참고하고 있습니다.

## 핵심 기능
- 독후감 저장
- 독후감 및 도서 즐겨 찾기
- 도서 검색 및 상세 정보 확인
- 독후감에 사용할 태그 생성

## 모듈 아키텍처
![doc/![module_architecture.png](..%2Fandroid-lab%2Fdoc%2Fmodule_architecture.png)](module_architecture-1.png)
| **이름** | **책임** |
| --- | --- |
| feature: … | 특정 기능을 담당하며 기능과 관련된 UI 요소와 ViewModel 을 포함 되어 있습니다. |
| core:data | data source 에 접근하여 feature 에 필요한 데이터를 제공합니다. UI 계층에서 사용하기 수월하도록 model 을 맵핑하는 등의 비지니스 로직이 포함 되어 있습니다. |
| core:designsystem | material 3 를 기반으로 사용하며, 핵심적인 UI 구성요소에 대한 정의가 포함되어 있습니다. |
| core:ui | 여러 feature 에서 사용되는 UI 요소를 포함합니다. designsystem 과 달리 model 모듈에 대한 의존성을 가지고 model 을 렌더링 합니다. |
| core:database | Room 을 사용하여 로컬 data source 를 저장 및 관리합니다. |
| core:network | Retrofit 을 이용해 remote data source 에 대한 네트워크 요청 및 응답을 처리합니다. |
| core:model | 앱 전체에서 사용되는 모델을 포함하는 모듈입니다. |

## Tech
Kotlin, Coroutine + Flow
Compose, Hilt, Retrofit, Glide, Navigation, Room
Android Clean Architecture, multi module, MVVM
Junit4
38 changes: 23 additions & 15 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import java.util.Properties

plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.jetbrains.kotlin.android)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.kotlin.serialization)
id("com.google.devtools.ksp")
id("com.google.dagger.hilt.android")
}

val properties = Properties().apply {
load(project.rootDir.resolve("local.properties").inputStream())
}

android {
Expand All @@ -21,22 +17,14 @@ android {
minSdk = 24
targetSdk = 34
versionCode = 1
versionName = "1.2.0"
versionName = "1.3.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")

buildConfigField("String", "NAVER_API_CLIENT", properties["naver_api_client"].toString())
buildConfigField("String", "NAVER_API_SECRET", properties["naver_api_secret"].toString())
}

debug {
buildConfigField("String", "NAVER_API_CLIENT", properties["naver_api_client"].toString())
buildConfigField("String", "NAVER_API_SECRET", properties["naver_api_secret"].toString())
}
}
compileOptions {
Expand All @@ -49,11 +37,25 @@ android {
buildFeatures {
viewBinding = true
compose = true
buildConfig = true
}
}

dependencies {
implementation(project(":feature:home"))
implementation(project(":feature:calendar"))
implementation(project(":feature:bookreport"))
implementation(project(":feature:book"))
implementation(project(":feature:tag"))
implementation(project(":feature:favorites"))
implementation(project(":feature:settings"))
implementation(project(":feature:search"))
implementation(project(":core:designsystem"))
implementation(project(":core:ui"))
implementation(project(":core:model"))
implementation(project(":core:data"))
implementation(project(":core:network"))
implementation(project(":core:database"))

// Hilt
implementation(libs.hilt.android)
ksp(libs.hilt.android.compiler)
Expand All @@ -62,6 +64,7 @@ dependencies {
// Glide
implementation(libs.glide)
annotationProcessor(libs.glide.compiler)
implementation(libs.glide.compose)

// Room
implementation(libs.androidx.room.runtime)
Expand All @@ -78,6 +81,10 @@ dependencies {
implementation(libs.kotlinx.coroutines.core)
implementation(libs.kotlinx.coroutines.android)

// Kotlin serialization
implementation(libs.kotlinx.serialization.core)
implementation(libs.kotlinx.serialization.json)

implementation(libs.androidx.runtime.livedata)
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
Expand All @@ -90,6 +97,7 @@ dependencies {
implementation(libs.androidx.navigation.fragment)
implementation(libs.androidx.fragment)
implementation(libs.androidx.constraintlayout)
implementation(libs.androidx.constraintlayout.compose)
implementation(libs.androidx.recyclerview)
implementation(libs.androidx.ui)
implementation(libs.androidx.ui.graphics)
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
android:theme="@style/Theme.BookReport"
tools:targetApi="31">
<activity
android:name=".presentation.ui.MainActivity"
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand All @@ -26,7 +26,7 @@
</activity>

<activity
android:name=".presentation.ui.SettingsActivity"
android:name="com.twitty.feature.settings.SettingsActivity"
android:theme="@style/Theme.Material3.DayNight.NoActionBar"
android:exported="false" />
</application>
Expand Down
26 changes: 26 additions & 0 deletions app/src/main/java/com/towitty/bookreport/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.towitty.bookreport

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import com.towitty.bookreport.ui.BookReportApp
import com.towitty.bookreport.ui.rememberBookReportAppState
import com.twitty.designsystem.theme.BookReportTheme
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class MainActivity : ComponentActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

setContent {
val appState = rememberBookReportAppState()

BookReportTheme {
BookReportApp(appState)
}
}
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package com.towitty.bookreport.navigation

import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.navigation.compose.NavHost
import com.towitty.bookreport.ui.BookReportAppState
import com.twitty.feature.book.navigation.bookScreen
import com.twitty.feature.book.navigation.navigateToBook
import com.twitty.feature.bookreport.navigation.bookReportScreen
import com.twitty.feature.bookreport.navigation.navigateToBookReport
import com.twitty.feature.calendar.navigation.calendarScreen
import com.twitty.feature.home.navigation.HomeRoute
import com.twitty.feature.home.navigation.homeScreen
import com.twitty.feature.search.navigation.searchScreen

@Composable
fun BookReportAppNavHost(
appState: BookReportAppState,
modifier: Modifier = Modifier
) {
val navController = appState.navController

NavHost(
navController = navController,
startDestination = HomeRoute,
modifier = modifier,
) {
homeScreen(
onNavigateToBook = navController::navigateToBook,
onNavigateToBookReport = navController::navigateToBookReport,
onNavigateToBarcode = { TODO() },
)
searchScreen(
onNavigateUp = navController::navigateUp,
onNavigateToBook = navController::navigateToBook,
)
calendarScreen()
bookReportScreen(
onNavigateUp = navController::navigateUp,
)
bookScreen(
onNavigateUp = navController::navigateUp,
onNavigateToBookReport = navController::navigateToBookReport,
)
}
}
Loading
Loading