Skip to content

Commit 16ffc10

Browse files
committed
add/retactor : mockups , some bug fixes and refactor.
1 parent 69f3b8d commit 16ffc10

File tree

93 files changed

+576
-95
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+576
-95
lines changed

.github/workflows/android-build-debug.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,24 @@ jobs:
2020
cache: gradle
2121
- name: Grant execute permission for gradlew
2222
run: chmod +x gradlew
23+
- name: Config Luffy API
24+
env:
25+
Y: ${{secrets.API_BASE_URL}}
26+
run: echo -e "API_BASE_URL=$Y \n" >> ./local.properties
27+
- name: Config Avatar API
28+
env:
29+
X : ${{secrets.AVATAR_API}}
30+
run: echo -e "AVATAR_API=$X \n" >> ./local.properties
31+
- name: Config RabbitMQ
32+
env:
33+
A : ${{secrets.RABBITMQ_HOST}}
34+
B : ${{secrets.RABBITMQ_PORT}}
35+
C : ${{secrets.RABBIT_USER_NAME}}
36+
D : ${{secrets.RABBIT_USER_PASSWORD}}
37+
run: echo -e "RABBITMQ_HOST=$A\nRABBITMQ_PORT=$B\nRABBIT_USER_NAME=$C\nRABBIT_USER_PASSWORD=$D" >> ./local.properties
2338
- name: Build App
2439
run: ./gradlew assembleDebug --stacktrace
2540
- uses: actions/upload-artifact@v2
2641
with:
2742
name: zoro-build-debug
28-
path: app/build/outputs/apk/debug/app-debug.apk
43+
path: app/build/outputs/apk/debug/app-debug.apk

.github/workflows/android-lint.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,24 @@ jobs:
2020
cache: gradle
2121
- name: Grant execute permission for gradlew
2222
run: chmod +x gradlew
23+
- name: Config Luffy API
24+
env:
25+
Y: ${{secrets.API_BASE_URL}}
26+
run: echo -e "API_BASE_URL=$Y \n" >> ./local.properties
27+
- name: Config Avatar API
28+
env:
29+
X : ${{secrets.AVATAR_API}}
30+
run: echo -e "AVATAR_API=$X \n" >> ./local.properties
31+
- name: Config RabbitMQ
32+
env:
33+
A : ${{secrets.RABBITMQ_HOST}}
34+
B : ${{secrets.RABBITMQ_PORT}}
35+
C : ${{secrets.RABBIT_USER_NAME}}
36+
D : ${{secrets.RABBIT_USER_PASSWORD}}
37+
run: echo -e "RABBITMQ_HOST=$A\nRABBITMQ_PORT=$B\nRABBIT_USER_NAME=$C\nRABBIT_USER_PASSWORD=$D" >> ./local.properties
2338
- name: Lint Debug
2439
run: ./gradlew lint
2540
- uses: actions/upload-artifact@v2
2641
with:
2742
name: zoro-lint-report
28-
path: app/build/reports/lint-results-debug.html
43+
path: app/build/reports/lint-results-debug.html

.github/workflows/android-tests.yml

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,21 @@ jobs:
1414
run: chmod +x gradlew
1515
- name: Decode BASEURL
1616
run: echo API_BASE_URL=TEST > ./local.properties
17-
# env:
18-
# API_BASE_URL: ${{ secrets.API_BASE_URL }}
19-
# run: echo API_BASE_URL=$API_BASE_URL > ./local.properties
17+
- name: Config Luffy API
18+
env:
19+
Y: ${{secrets.API_BASE_URL}}
20+
run: echo -e "API_BASE_URL=$Y \n" >> ./local.properties
21+
- name: Config Avatar API
22+
env:
23+
X : ${{secrets.AVATAR_API}}
24+
run: echo -e "AVATAR_API=$X \n" >> ./local.properties
25+
- name: Config RabbitMQ
26+
env:
27+
A : ${{secrets.RABBITMQ_HOST}}
28+
B : ${{secrets.RABBITMQ_PORT}}
29+
C : ${{secrets.RABBIT_USER_NAME}}
30+
D : ${{secrets.RABBIT_USER_PASSWORD}}
31+
run: echo -e "RABBITMQ_HOST=$A\nRABBITMQ_PORT=$B\nRABBIT_USER_NAME=$C\nRABBIT_USER_PASSWORD=$D" >> ./local.properties
2032
- name: Unit tests
2133
run: ./gradlew test --stacktrace
2234

@@ -28,9 +40,21 @@ jobs:
2840
run: chmod +x gradlew
2941
- name: Decode BASEURL
3042
run: echo API_BASE_URL=TEST > ./local.properties
31-
# env:
32-
# API_BASE_URL: ${{ secrets.API_BASE_URL }}
33-
# run: echo API_BASE_URL=$API_BASE_URL > ./local.properties
43+
- name: Config Luffy API
44+
env:
45+
Y: ${{secrets.API_BASE_URL}}
46+
run: echo -e "API_BASE_URL=$Y \n" >> ./local.properties
47+
- name: Config Avatar API
48+
env:
49+
X : ${{secrets.AVATAR_API}}
50+
run: echo -e "AVATAR_API=$X \n" >> ./local.properties
51+
- name: Config RabbitMQ
52+
env:
53+
A : ${{secrets.RABBITMQ_HOST}}
54+
B : ${{secrets.RABBITMQ_PORT}}
55+
C : ${{secrets.RABBIT_USER_NAME}}
56+
D : ${{secrets.RABBIT_USER_PASSWORD}}
57+
run: echo -e "RABBITMQ_HOST=$A\nRABBITMQ_PORT=$B\nRABBIT_USER_NAME=$C\nRABBIT_USER_PASSWORD=$D" >> ./local.properties
3458
- name: Setup Java
3559
uses: actions/setup-java@v2
3660
with:

.github/workflows/detekt-analysis.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,21 @@ jobs:
3232
run: chmod +x gradlew
3333
- name: Run Detekt
3434
run: ./gradlew detekt
35-
35+
- name: Config Luffy API
36+
env:
37+
Y: ${{secrets.API_BASE_URL}}
38+
run: echo -e "API_BASE_URL=$Y \n" >> ./local.properties
39+
- name: Config Avatar API
40+
env:
41+
X : ${{secrets.AVATAR_API}}
42+
run: echo -e "AVATAR_API=$X \n" >> ./local.properties
43+
- name: Config RabbitMQ
44+
env:
45+
A : ${{secrets.RABBITMQ_HOST}}
46+
B : ${{secrets.RABBITMQ_PORT}}
47+
C : ${{secrets.RABBIT_USER_NAME}}
48+
D : ${{secrets.RABBIT_USER_PASSWORD}}
49+
run: echo -e "RABBITMQ_HOST=$A\nRABBITMQ_PORT=$B\nRABBIT_USER_NAME=$C\nRABBIT_USER_PASSWORD=$D" >> ./local.properties
3650
# Make sure we always run this upload task,
3751
# because the previous step may fail if there are findings.
3852
- uses: github/codeql-action/upload-sarif@v1

.idea/copyright/anshul.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/copyright/profiles_settings.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 80 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,55 @@
11
# Zoro
22

3-
### How to setup :
4-
- Backend
3+
<p align="center">
4+
<a href="https://devlibrary.withgoogle.com/products/android/repos/skydoves-pokedex"><img alt="Google" src="https://skydoves.github.io/badges/google-devlib.svg"/></a><br>
5+
<a href="https://opensource.org/licenses/Apache-2.0"><img alt="License" src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"/></a>
6+
<a href="https://android-arsenal.com/api?level=27"><img alt="API" src="https://img.shields.io/badge/API-27%2B-brightgreen.svg?style=flat"/></a>
7+
<a href="https://github.com/sarafanshul/Zoro/actions"><img alt="Build Status" src="
8+
https://github.com/sarafanshul/zoro/actions/workflows/android-release-artifact.yml/badge.svg"/></a>
9+
</p>
10+
11+
<p align="center">
12+
Zoro is an secure chat application based on <a href="https://www.amqp.org/">AMQP</a> for pub-sub service ,<a href="https://github.com/sarafanshul/luffy/">Luffy</a> for secure backend and utilizes MVVM architecture.<br>This project uses Hilt of implementing dependency injection.<br>
13+
Also fetching data from the network and integrating persisted data in the database via repository pattern.
14+
</p>
15+
<br>
16+
17+
<p align="center">
18+
<img src="./assets/mockups/merger_mockup.png"/>
19+
</p>
20+
21+
## Download
22+
Go to the [Releases](https://github.com/sarafanshul/Zoro/releases) to download the latest package.
23+
24+
25+
<img src="./assets/mockups/Screenshot_1641750816_framed.png" align="right" width="32%"/>
26+
27+
## Tech stack & Open-source libraries
28+
- Minimum SDK level 29
29+
- [Kotlin](https://kotlinlang.org/) based, [Coroutines](https://github.com/Kotlin/kotlinx.coroutines) + [Flow](https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/) for asynchronous.
30+
- [Hilt](https://dagger.dev/hilt/) for dependency injection.
31+
- JetPack
32+
- Lifecycle - dispose of observing data when lifecycle state changes.
33+
- ViewModel - UI related data holder, lifecycle aware.
34+
- Room Persistence - construct a database using the abstract layer.
35+
- Architecture
36+
- MVVM Architecture (View - DataBinding - ViewModel - Model)
37+
- [Datastore](https://developer.android.com/topic/libraries/architecture/datastore) - Uses Kotlin coroutines and Flow to store data asynchronously, consistently, and transactionally..
38+
- Repository pattern
39+
- [Retrofit2 & OkHttp3](https://github.com/square/retrofit) - construct the REST APIs and paging network data.
40+
- [Glide](https://github.com/bumptech/glide), [GlidePalette](https://github.com/florent37/GlidePalette) - loading images.
41+
- [Timber](https://github.com/JakeWharton/timber) - logging.
42+
- [Material-Components](https://github.com/material-components/material-components-android) - Material design components like ripple animation, cardView.
43+
44+
UI is utilising a dual-theme approach, allowing users to choose from light or dark theme. Components from Material Design library (MaterialCardview, MaterialToolbar, BottomNavigationView etc.) have been used due to their ability to switch between colour Primary and colour Surface. Detail Fragments are designed in a way that allows the user to drag and move contents - this behaviour is implemented by using MotionLayout. MaterialContainerTransform (shared element transitions), MaterialFadeThrough and MaterialElevationScale from Material Design library have been used to animate transitions between list and detail fragments.
45+
46+
## How to setup :
47+
- Backend
548
- Clone [Luffy](https://github.com/sarafanshul/Luffy) for backend (not necessary if using compose).
6-
- If not cloned , copy the `compose file` from [docker/anshulsaraf/luffy](https://hub.docker.com/repository/docker/anshulsaraf/luffy) into a folder
49+
- If not cloned , copy the `compose file` from [docker/anshulsaraf/luffy](https://hub.docker.com/repository/docker/anshulsaraf/luffy) into a folder
750
- Make sure [Docker](https://www.docker.com/) is running .
8-
- `cd` inside the folder where `compose file` is saved and run `docker compose up`
9-
- Now your backend should be up
51+
- `cd` inside the folder where `compose file` is saved and run `docker compose up`
52+
- Now your backend should be up
1053
- Frontend
1154
- Inside `NetworkingConstants.kt` configure your backend constants
1255
- Replace the keystore from `app/keystore/ZoroKeyStore.jks`with your signed one.
@@ -15,3 +58,35 @@
1558
- Android Studio specific
1659
- Invalidate Cache (just to be safe)
1760
- Build and add magic
61+
62+
## MAD Score
63+
![summary](./assets/mad/summary.png)
64+
![kotlin](./assets/mad/kotlin.png)
65+
66+
## Architecture
67+
NarutoDex is based on MVVM architecture and a repository pattern.
68+
69+
![architecture](/assets/architecture/mvvm.png)
70+
71+
## Authors
72+
[Anshul](https://github.com/sarafanshul)
73+
74+
## Find this repository useful? :heart:
75+
__[follow](https://github.com/sarafanshul)__ me for my next creations! 🤩
76+
77+
# License
78+
```xml
79+
Designed and developed by 2020 sarafanshul (Anshul Saraf)
80+
81+
Licensed under the Apache License, Version 2.0 (the "License");
82+
you may not use this file except in compliance with the License.
83+
You may obtain a copy of the License at
84+
85+
http://www.apache.org/licenses/LICENSE-2.0
86+
87+
Unless required by applicable law or agreed to in writing, software
88+
distributed under the License is distributed on an "AS IS" BASIS,
89+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
90+
See the License for the specific language governing permissions and
91+
limitations under the License.
92+
```

app/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/*
2+
* Copyright (c) 2022. Anshul Saraf
3+
*/
4+
15
apply plugin: 'com.android.application'
26

37
apply plugin: 'kotlin-android'

app/src/androidTest/java/com/projectdelta/zoro/ExampleInstrumentedTest.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/*
2+
* Copyright (c) 2022. Anshul Saraf
3+
*/
4+
15
package com.projectdelta.zoro
26

37
import androidx.test.ext.junit.runners.AndroidJUnit4
@@ -19,4 +23,4 @@ class ExampleInstrumentedTest {
1923
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
2024
assertEquals("com.projectdelta.zoro", appContext.packageName)
2125
}
22-
}
26+
}

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@
5050

5151
</application>
5252

53-
</manifest>
53+
</manifest>

0 commit comments

Comments
 (0)