Skip to content

Commit

Permalink
Merge pull request Kaaveh#248 from Kaaveh/refactor/update_readme
Browse files Browse the repository at this point in the history
Refactor/update readme
  • Loading branch information
VahidGarousi authored Jan 5, 2025
2 parents 6884151 + b62a00e commit b48de33
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 16 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@

This repo is a playground about best practices, using updated libraries and solutions in the Android world!

Check the apk [from here](asset/app_v1.0.0.apk)
Check the app apk [from here](asset/app_v1.0.0.apk)

## ⚙️ Architecture

![Architecture diagram](asset/architecture.jpg)

The main architecture of code based on MVI + CLEAN architecture. The division criteria is a hybrid strategy based on Feature + Layer by module.
For the detail of architecture, please read [this article](https://medium.com/@kaaveh/migrate-from-mvvm-to-mvi-f938c27c214f).
The main architecture of the code is based on MVI + CLEAN architecture. The division criteria is a hybrid strategy based on Feature + Layer by module.
For the details of architecture, please read [this article](https://medium.com/@kaaveh/migrate-from-mvvm-to-mvi-f938c27c214f).

## Wear OS
This project includes a WearOS module designed for Android-based smartwatches like the Galaxy Watch. The `app-watch` module contains `app`, `designsystem`, `navigation`, and `ui` submodules. You can build the `app-watch:app` to have wearOS version of the application.
This project includes a WearOS module for Android-based smartwatches like the Galaxy Watch. The `app-watch` module contains `app`, `designsystem`, `navigation`, and `ui` submodules. You can build the `app-watch:app` to have a wearOS version of the application.

## 🚦 Navigation

For the detail of navigation implementations, please read [this article](https://proandroiddev.com/all-about-navigation-in-the-jetpack-compose-based-production-code-base-902706b8466d).
For the details of navigation implementations, please read [this article](https://proandroiddev.com/all-about-navigation-in-the-jetpack-compose-based-production-code-base-902706b8466d).

## 📱 Previewing

For the detail of handling preview of composable functions in this code-base, please read [this article](https://proandroiddev.com/an-introduction-about-preview-in-jetpack-compose-b72a96daac35).
For the details of handling the preview of composable functions in this code-base, please read [this article](https://proandroiddev.com/an-introduction-about-preview-in-jetpack-compose-b72a96daac35).

## 🛠 Technologies

Expand All @@ -39,13 +39,13 @@ For the detail of handling preview of composable functions in this code-base, pl
- Support large screens
- Support WearOS devices
- Monochromatic app icon
- Version catalog & Convention Plugin (For the detail, please read [this article](https://proandroiddev.com/mastering-android-dependency-management-b94205595f6b))
- Version catalog & Convention Plugin (For the details, please read [this article](https://proandroiddev.com/mastering-android-dependency-management-b94205595f6b))
- CI
- Git Hooks
- GitHub Actions
- Static Analysis(Kotlinter, Detekt) (For the detail, please read [this article](https://blog.kotlin-academy.com/detekt-gradle-configuration-guide-d6d2301b823a))

### We are porting the project to KMP. Here's the steps:
### We are porting the project to KMP. Here are the steps:
- [x] GSON → Kotlinx Serialization
- [x] ROOM → SQLDelight
- [x] Retrofit → Ktor
Expand All @@ -71,17 +71,17 @@ For the detail of handling preview of composable functions in this code-base, pl

![](asset/large_screen.jpg)

### WearOS devises (Android based smart watches)
### WearOS devices (Android-based smartwatches)
![Wear OS screenshots](asset/wearos.jpg)

## Additional Resources

- [Git Hooks](documentation/GitHooks.md) - Learn about Git hooks used in this project for code formatting and analysis.
- [Git Hooks](documentation/GitHooks.md) - Learn about Git Hooks used in this project for code formatting and analysis.
- [GitHub Actions](documentation/GitHubActions.md) - Explore the GitHub Actions workflows used to validate the code.
- [Static Analysis](documentation/StaticAnalysis.md) - Discover how static analysis tools like Detekt and Ktlint are used in this project for code quality assurance.

## 🤝🏻 Contribute

Any PRs are very welcome! 😍 You can fix a bug, add a feature, optimize performance and even propose a new cool approach in code-base architecture. Feel free and make a PR! 😌
Any PRs are very welcome! 😍 You can fix a bug, add a feature, optimize performance, and propose a new cool approach in code-base architecture. Feel free to make a PR! 😌

We use static analysis tools like Detekt and Ktlint in this project. Please either set up [Git Hooks](documentation/GitHooks.md) on your project or run [Static Analysis](documentation/StaticAnalysis.md) before creating PR.
54 changes: 49 additions & 5 deletions documentation/GitHooks.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,55 @@
# Git Hooks

This project has some Git hooks included inside the [git-hooks](/git-hooks) folder. These hooks can be installed automatically via the [setup.sh](/git-hooks/setup.sh) (just windows machine currently, support others OS comming soon).
This project has some Git hooks included inside the [git-hooks](/git-hooks) folder.

## Pre-Commit
## **Usage Instructions**

There is a [pre-commit](/git-hooks/pre-commit) hook that will automatically run Ktlint formatting over any modified Kotlin files. This way you can just commit your code and trust that formatting happens behind the scenes, without having to consciously worry about it.
1. **Install Git Hooks**:
- Run the `clean` task to automatically install or update hooks:
```bash
./gradlew clean
```

## Pre-Push
2. **Commit-Msg Hook**:
- Ensures commit messages include an issue number (e.g., `#123` or `[ #123 ]`).
- Blocks commits with invalid messages.
There is a [pre-push](/git-hooks/pre-push) hook that will run static analysis checks before any code is pushed up to the remote repository. This way, if you have any code smells, you can be alerted right away without waiting for the GitHub Actions to fail.
---
## **Examples**
### Valid Commit Messages:
- `Fix login issue #123`
- `[ #456 ] Refactor module`
### Invalid Commit Messages:
- `Fix login issue` _(No issue number)._
- `Updated README 123` _(Missing `#` prefix)._
## **Why These settings?**
1. **Improving Traceability**:
- The `commit-msg` hook enforces commit message standards, making it easier to link commits to specific issues.
2. **Automating Hook Installation**:
- Integrating hook installation with the `clean` task reduces manual steps and ensures hooks are always up-to-date.
---
## **Directory Structure**
```plaintext
project-root/
├── .git/
│ ├── hooks/
│ ├── pre-commit
│ ├── pre-push
│ ├── commit-msg
├── build.gradle.kts
├── git-hooks/
│ ├── pre-commit-unix.sh
│ ├── pre-commit-windows.sh
│ ├── pre-push-unix.sh
│ ├── pre-push-windows.sh
│ ├── commit-msg-unix.sh
│ ├── commit-msg-windows.sh

0 comments on commit b48de33

Please sign in to comment.