Simple MVVM android app that built with local database using room. It allows ordering one deal per day for user. Providing admin dashboard to add, delete & update data.
- Ordering Meals (One Per Day)
- tracking orders history
- Admin dashboard
- Permissions & Roles Management based on permission matrix Json file
- Built using Mvvm, RoomDB, Kotlin coroutines
- Contains Implementation for:
- DateTimeHelper to convert UTC DatTime to local with specific pattern
- ImageBase64Converter to convert Images from/to Base64
- TextFieldValidator to validate text fields using regex
Daily.Deal.Demo-1.mp4
[
{
"addItem": true,
"adminDashboard": true,
"deleteItem": true,
"editItem": true,
"orderItem": true,
"role": "admin"
},
{
"addItem": false,
"adminDashboard": false,
"deleteItem": false,
"editItem": false,
"orderItem": true,
"role": "user"
}
]
[
{
"address": "-",
"email": "admin@dailydeal.co",
"id": 0,
"name": "admin",
"password": "Admin123456789$",
"phone": "0",
"role": "admin"
}
]
lifecycleScope.launch {
for(day in arrayOf("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")){
for(i in 0..10){
val images = arrayOf(R.drawable.test_image1, R.drawable.test_image2, R.drawable.test_image3)
val base64Image = ImageBase64Converter.encode(ContextCompat.getDrawable(applicationContext, images.random())!!,false)
AppDatabase.get(applicationContext).dao().addItem(ItemData(
name= arrayOf("Family Meal", "Ranchit", "Beef Bomb", "Chicken Fajita", "Urban X").random(),
description = "description text test",
restaurant = arrayOf("Big Meal", "EatMore", "Grilled", "Chief Ahmed", "Fast & Food").random(),
image = base64Image,
originalPrice = DecimalFormat("#.#").format(Random.nextDouble(80.0, 150.0)).toDouble(),
discountPrice = DecimalFormat("#.#").format(Random.nextDouble(50.0, 120.0)).toDouble(),
day = day.uppercase()
))
}
}
}