Skip to content

ztacole/kasirkain-android

Repository files navigation

KasirKain - Android POS System

KasirKain is a modern Point of Sale (POS) application for Android designed to simplify sales transaction management with comprehensive features and a user-friendly interface.

✨ Key Features

  • 📱 Modern Interface - Built with Jetpack Compose for responsive and intuitive UI
  • 🔍 Barcode Scanning - ML Kit integration for real-time barcode scanning
  • 🖨️ Thermal Printer - Support for ESCPOS thermal printers for invoice printing
  • 📷 Camera Integration - Using CameraX for optimal image capture
  • 💾 Local Database - Room Database for offline data storage
  • 🌐 API Integration - Retrofit for server data synchronization
  • 📊 Pagination - Jetpack Paging for efficient data loading
  • 🔐 Dependency Injection - Dagger Hilt for clean dependency management
  • 💬 Preferences Storage - DataStore for storing user preferences

🛠️ Tech Stack

Core Technologies

  • Language: Kotlin
  • UI Framework: Jetpack Compose
  • Architecture: Clean Architecture (Data, Domain, Presentation)
  • Min SDK: API 26
  • Target SDK: API 35
  • Java Compatibility: Java 11

Main Dependencies

  • Navigation: Jetpack Navigation Compose 2.7.7
  • HTTP Client: Retrofit 2.11.0 + Gson
  • Database: Room 2.6.1
  • Image Loading: Coil 2.5.0
  • Dependency Injection: Dagger Hilt 2.48.1
  • Camera: CameraX 1.3.1
  • ML Kit: Barcode Scanning 17.2.0
  • Printer: ESCPOS Thermal Printer Android 3.3.0
  • Permissions: Accompanist 0.30.1
  • Pagination: Jetpack Paging 3.2.1
  • Data Storage: DataStore Preferences 1.1.1
  • Splash Screen: Core Splashscreen 1.0.1

📋 Requirements

  • Android Studio Koala or newer
  • JDK 11 or higher
  • Gradle 8.0 or newer
  • Android SDK 35

🚀 Getting Started

1. Clone Repository

git clone https://github.com/ztacole/kasirkain-android.git
cd kasirkain-android

2. Open in Android Studio

android-studio .

3. Setup Local Properties (If needed)

Create local.properties file at the root of the project if it doesn't exist:

sdk.dir=/path/to/android/sdk

4. Run the Application

  • Select an emulator or connected physical device
  • Click the "Run" button or press Shift + F10

📁 Project Structure

kasirkain-android/
├── app/
│   ├── src/
│   │   ├── main/
│   │   │   ├── java/com/takumi/kasirkain/
│   │   │   │   ├── data/              # Data layer - Repository, DAO, API
│   │   │   │   ├── domain/            # Domain layer - Use cases, Models
│   │   │   │   ├── di/                # Dependency Injection modules
│   │   │   │   └── presentation/      # UI layer - Screens, ViewModels
│   │   │   ├── res/                   # Resources (drawables, layouts, strings)
│   │   │   └── AndroidManifest.xml
│   │   ├── androidTest/               # Instrumented tests
│   │   └── test/                      # Unit tests
│   └── build.gradle.kts               # App-level build configuration
├── gradle/
│   └── libs.versions.toml              # Version catalog
├── build.gradle.kts                   # Project-level build configuration
├── settings.gradle.kts                # Settings and plugins
└── README.md                          # Project documentation

🏗️ Architecture

The project follows Clean Architecture with 4 main layers:

1. Presentation Layer (presentation/)

  • Jetpack Compose Screens
  • ViewModels with lifecycle awareness
  • State management using MutableState

2. Domain Layer (domain/)

  • Use Cases
  • Entity models
  • Business logic

3. Data Layer (data/)

  • Repository pattern
  • Room Database DAOs
  • Retrofit API services
  • Data mappers

4. DI Layer (di/)

  • Hilt modules
  • Dependency bindings

📱 Feature Details

Barcode Scanning

Using Google ML Kit for barcode scanning with high accuracy:

// Scanning integrated with CameraX
// Output: barcode data for processing

Thermal Printer

Support for various types of thermal printers with ESCPOS library:

  • Document formatting
  • Invoice layout design
  • Multiple paper sizes

Local Database

Room Database for storing offline data:

  • Transactions
  • Products
  • Customers
  • Orders

API Integration

Retrofit for backend communication:

  • RESTful endpoints
  • Request/Response serialization (Gson)
  • Error handling

🔧 Configuration

Build Variants

Project supports multiple build variants:

  • debug - Development build with logging
  • release - Production build with ProGuard

ProGuard Rules

ProGuard configuration available at:

app/proguard-rules.pro

📦 Dependencies Management

Dependencies are managed through Version Catalog at:

gradle/libs.versions.toml

To add a new dependency:

  1. Edit libs.versions.toml file
  2. Add to app/build.gradle.kts
  3. Sync Gradle

🧪 Testing

Unit Tests

./gradlew test

Instrumented Tests (Android Tests)

./gradlew connectedAndroidTest

Test files located at:

  • app/src/test/ - Unit tests
  • app/src/androidTest/ - Instrumented tests

🔐 Permissions

The application requires the following permissions:

  • CAMERA - For barcode scanning
  • INTERNET - For API calls
  • READ_EXTERNAL_STORAGE - For file access
  • WRITE_EXTERNAL_STORAGE - For data saving

Permissions are managed using Accompanist Permissions library.

📝 Logging & Debugging

Use Android Studio's Logcat to view logs:

./gradlew assembleDebug
adb logcat

🚢 Build & Release

Build Debug APK

./gradlew assembleDebug

Build Release APK

./gradlew assembleRelease

Output available at:

app/build/outputs/apk/

📚 Additional Documentation

🤝 Contributing

Contributions are very welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Create a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

👤 Author

KasirKain Development Team

  • Ahmad (Developer Lead)

🙏 Acknowledgments

  • Jetpack Compose Team
  • Google ML Kit Team
  • DantSu (ESCPOS Library)
  • All contributors who have helped

Made with ❤️ by KasirKain Team

About

A specialized Point of Sale (POS) system for fashion businesses.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages