Skip to content

Commit 6ee385b

Browse files
committed
Initial commit: RetailEase, A POS billing system with Room, Hilt, Biometric auth and much more..
1 parent 5afa2d2 commit 6ee385b

151 files changed

Lines changed: 12331 additions & 0 deletions

File tree

Some content is hidden

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

.gitignore

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
.DS_Store
11+
/build
12+
/captures
13+
.externalNativeBuild
14+
.cxx
15+
local.properties
16+
17+
*.apk
18+
*.aar
19+
*.ap_
20+
*.aab
21+
*.dex
22+
*.class
23+
24+
bin/
25+
gen/
26+
out/
27+
build/
28+
.gradle/
29+
30+
app/release/*
31+
32+
*.log
33+
34+
captures/
35+
.navigation/
36+
37+
.idea/
38+
.idea/workspace.xml
39+
.idea/tasks.xml
40+
.idea/gradle.xml
41+
.idea/assetWizardSettings.xml
42+
.idea/dictionaries
43+
.idea/libraries
44+
.idea/jarRepositories.xml
45+
.idea/compiler.xml
46+
.idea/modules.xml
47+
.idea/.name
48+
.idea/misc.xml
49+
.idea/deploymentTargetDropDown.xml
50+
.idea/render.experimental.xml
51+
.idea/caches/
52+
.idea/navEditor.xml
53+
.idea/inspectionProfiles/
54+
55+
# Windows-specific files
56+
Thumbs.db
57+
ehthumbs.db
58+
Desktop.ini
59+
60+
61+
62+
63+

app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle.kts

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
plugins {
2+
alias(libs.plugins.android.application)
3+
alias(libs.plugins.kotlin.android)
4+
id("com.google.devtools.ksp")
5+
id("com.google.dagger.hilt.android")
6+
alias(libs.plugins.compose.compiler)
7+
kotlin("plugin.serialization") version "2.0.21"
8+
}
9+
10+
android {
11+
namespace = "com.example.retailease"
12+
compileSdk = 35
13+
14+
defaultConfig {
15+
applicationId = "com.example.retailease"
16+
minSdk = 24
17+
targetSdk = 35
18+
versionCode = 1
19+
versionName = "1.0"
20+
21+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
22+
vectorDrawables {
23+
useSupportLibrary = true
24+
}
25+
}
26+
27+
buildTypes {
28+
release {
29+
isMinifyEnabled = false
30+
proguardFiles(
31+
getDefaultProguardFile("proguard-android-optimize.txt"),
32+
"proguard-rules.pro"
33+
)
34+
}
35+
}
36+
compileOptions {
37+
sourceCompatibility = JavaVersion.VERSION_1_8
38+
targetCompatibility = JavaVersion.VERSION_1_8
39+
}
40+
kotlinOptions {
41+
jvmTarget = "1.8"
42+
}
43+
buildFeatures {
44+
compose = true
45+
}
46+
composeOptions {
47+
kotlinCompilerExtensionVersion = "1.5.1"
48+
}
49+
packaging {
50+
resources {
51+
excludes += "/META-INF/{AL2.0,LGPL2.1}"
52+
}
53+
}
54+
}
55+
56+
dependencies {
57+
// google fonts library
58+
implementation(libs.androidx.ui.text.google.fonts)
59+
60+
// Hilt Implementation
61+
implementation("com.google.dagger:hilt-android:2.56.2")
62+
ksp("com.google.dagger:hilt-android-compiler:2.56.2")
63+
implementation("androidx.hilt:hilt-navigation-compose:1.2.0")
64+
65+
// Room Implementation
66+
val room_version = "2.7.1"
67+
68+
implementation("androidx.room:room-runtime:$room_version")
69+
ksp("androidx.room:room-compiler:$room_version")
70+
implementation("androidx.room:room-ktx:$room_version")
71+
72+
// DataStore
73+
implementation("androidx.datastore:datastore-preferences:1.1.7")
74+
75+
76+
// Coil Dependency
77+
implementation("io.coil-kt.coil3:coil-compose:3.1.0")
78+
implementation("io.coil-kt.coil3:coil-network-okhttp:3.1.0")
79+
80+
// Material Icons Extended
81+
implementation("androidx.compose.material:material-icons-extended")
82+
83+
84+
// Navigation-Compose
85+
val nav_version = "2.9.0"
86+
87+
implementation("androidx.navigation:navigation-compose:$nav_version")
88+
89+
// ECS/POS for Print
90+
implementation("com.github.DantSu:ESCPOS-ThermalPrinter-Android:3.3.0")
91+
92+
// Json Serialization for backup
93+
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.8.1")
94+
95+
// Biometric
96+
implementation ("androidx.biometric:biometric:1.1.0")
97+
98+
99+
implementation("androidx.appcompat:appcompat:1.7.1")
100+
implementation(libs.androidx.core.ktx)
101+
implementation(libs.androidx.lifecycle.runtime.ktx)
102+
implementation(libs.androidx.activity.compose)
103+
implementation(platform(libs.androidx.compose.bom))
104+
implementation(libs.androidx.ui)
105+
implementation(libs.androidx.ui.graphics)
106+
implementation(libs.androidx.ui.tooling.preview)
107+
implementation(libs.androidx.material3)
108+
testImplementation(libs.junit)
109+
androidTestImplementation(libs.androidx.junit)
110+
androidTestImplementation(libs.androidx.espresso.core)
111+
androidTestImplementation(platform(libs.androidx.compose.bom))
112+
androidTestImplementation(libs.androidx.ui.test.junit4)
113+
debugImplementation(libs.androidx.ui.tooling)
114+
debugImplementation(libs.androidx.ui.test.manifest)
115+
implementation(kotlin("script-runtime"))
116+
}

app/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.example.retailease
2+
3+
import androidx.test.platform.app.InstrumentationRegistry
4+
import androidx.test.ext.junit.runners.AndroidJUnit4
5+
6+
import org.junit.Test
7+
import org.junit.runner.RunWith
8+
9+
import org.junit.Assert.*
10+
11+
/**
12+
* Instrumented test, which will execute on an Android device.
13+
*
14+
* See [testing documentation](http://d.android.com/tools/testing).
15+
*/
16+
@RunWith(AndroidJUnit4::class)
17+
class ExampleInstrumentedTest {
18+
@Test
19+
fun useAppContext() {
20+
// Context of the app under test.
21+
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22+
assertEquals("com.example.retailease", appContext.packageName)
23+
}
24+
}

app/src/main/AndroidManifest.xml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools">
4+
5+
<uses-feature android:name="android.hardware.usb.host"/>
6+
<uses-permission android:name="android.permission.INTERNET"/>
7+
<uses-permission android:name="android.permission.BLUETOOTH"/>
8+
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
9+
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT"/>
10+
<uses-permission android:name="android.permission.BLUETOOTH_SCAN"/>
11+
<uses-permission android:name="android.permission.VIBRATE"/>
12+
13+
<application
14+
android:allowBackup="true"
15+
android:dataExtractionRules="@xml/data_extraction_rules"
16+
android:fullBackupContent="@xml/backup_rules"
17+
android:icon="@mipmap/ic_launcher"
18+
android:label="@string/app_name"
19+
android:name=".di.RetailEaseApp"
20+
android:roundIcon="@mipmap/ic_launcher_round"
21+
android:supportsRtl="true"
22+
android:theme="@style/Theme.RetailEase"
23+
tools:targetApi="31">
24+
<activity
25+
android:name=".MainActivity"
26+
android:exported="true"
27+
android:windowSoftInputMode="adjustResize"
28+
android:label="@string/app_name"
29+
android:theme="@style/Theme.RetailEase">
30+
<intent-filter>
31+
<action android:name="android.intent.action.MAIN" />
32+
33+
<category android:name="android.intent.category.LAUNCHER" />
34+
</intent-filter>
35+
</activity>
36+
</application>
37+
38+
</manifest>
420 KB
Loading
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.example.retailease
2+
3+
import android.os.Bundle
4+
import androidx.activity.compose.setContent
5+
import androidx.activity.enableEdgeToEdge
6+
import androidx.appcompat.app.AppCompatActivity
7+
import com.example.retailease.ui.RetailEaseMain
8+
import com.example.retailease.ui.theme.RetailEaseTheme
9+
import dagger.hilt.android.AndroidEntryPoint
10+
11+
@AndroidEntryPoint
12+
class MainActivity : AppCompatActivity() {
13+
14+
15+
override fun onCreate(savedInstanceState: Bundle?) {
16+
super.onCreate(savedInstanceState)
17+
enableEdgeToEdge()
18+
19+
setContent {
20+
RetailEaseTheme {
21+
RetailEaseMain()
22+
}
23+
24+
25+
}
26+
}
27+
}
28+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.example.retailease.backup
2+
3+
import com.example.retailease.models.Product
4+
import com.example.retailease.models.Salesman
5+
import com.example.retailease.models.WholesaleProduct
6+
import kotlinx.serialization.Serializable
7+
8+
@Serializable
9+
data class RetailEaseBackup(
10+
val products : List<Product>,
11+
val wholesaleProducts: List<WholesaleProduct>,
12+
val salesmen: List<Salesman>,
13+
)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package com.example.retailease.datasource.dao
2+
3+
import androidx.room.Dao
4+
import androidx.room.Delete
5+
import androidx.room.Insert
6+
import androidx.room.OnConflictStrategy
7+
import androidx.room.Query
8+
import com.example.retailease.models.Customer
9+
import com.example.retailease.models.Employee
10+
import kotlinx.coroutines.flow.Flow
11+
12+
@Dao
13+
interface CustomerDao {
14+
@Insert(onConflict = OnConflictStrategy.REPLACE)
15+
suspend fun insertCustomer(customer: Customer)
16+
17+
@Delete
18+
suspend fun deleteCustomer(customer: Customer)
19+
20+
@Query("SELECT * FROM customers where customerId = :customerId")
21+
suspend fun getCustomerById(customerId: Int): Customer
22+
23+
@Query("SELECT * FROM customers")
24+
fun getAllCustomers(): Flow<List<Customer>>
25+
26+
@Insert
27+
suspend fun insertEmployee(employee: Employee)
28+
29+
}

0 commit comments

Comments
 (0)