Skip to content

claudiopaccone/Taskly

Repository files navigation

Taskly - Task Management Android App

A modern Android task management application built with Jetpack Compose, following Clean Architecture principles and the MVI (Model-View-Intent) pattern.

Architecture Overview

MVI Pattern (Model-View-Intent)

This project implements the MVI (Model-View-Intent) architectural pattern, which provides a unidirectional data flow and predictable state management.

Key Components:

1. Intent (HomepageViewIntent)

  • Represents user actions and system events
  • Examples: CreateTask, EditTask, DeleteTask, ChangeFilter, ChangeSort

2. Model/State (HomepageViewState)

  • Single source of truth for UI state
  • Immutable data class
  • Contains: tasks list, filters, loading state, bottom sheet state, etc.

3. Side Effects (HomepageSideEffect)

  • One-time events (not state)
  • Examples: showing snackbar, navigation events
  • Consumed by the view

4. View (HomepageScreen)

  • Observes state and renders UI
  • Emits intents in response to user interactions
  • No business logic

5. ViewModel (HomepageViewModel)

  • Handles all business logic
  • Processes intents and updates state
  • Manages data layer interactions
  • Emits side effects (e.g., showing snackbars)

Module Structure

The project follows Clean Architecture with clear separation of concerns across three layers:

Layer Responsibilities

1. Domain Layer (homepage:domain)

Purpose: Contains business logic, use cases, and domain models

  • Models: Task, TaskStatus, TaskFilter, TaskSortBy
  • Repository Interface: TaskRepository (abstraction)
  • ViewModel: HomepageViewModel (orchestrates business logic)
  • MVI Contract: HomepageViewIntent, HomepageViewState, HomepageSideEffect

Key Features:

  • Framework-independent business logic
  • Defines contracts for data access
  • No Android framework dependencies (except ViewModel and lifecycle)
  • Highly testable with MockK

2. Data Layer (homepage:data)

Purpose: Handles data operations and persistence

  • Database: Room Database with TaskEntity
  • DAO: TaskDao for database operations
  • Repository Implementation: TaskRepositoryImpl
  • Mappers: Convert between Task (domain) ↔ TaskEntity (data)
  • Dependency Injection: DatabaseModule (Hilt)

Key Features:

  • Offline-first with Room database
  • Reactive data streams with Flow
  • Clean separation from domain models

3. UI Layer (homepage:ui)

Purpose: Handles UI rendering and user interactions

  • Screens: HomepageScreen (main screen)
  • Components: TaskBottomSheet, TaskList, TaskItem, FilterAndSortSection
  • No Business Logic: Pure presentation components

Key Features:

  • Declarative UI with Jetpack Compose

Core Features

1. CRUD Operations

  • Create: Add new task with title, description, and initial status
  • Read: Load all tasks from local database
  • Update: Modify task properties or change status
  • Delete: Remove task from database

2. Filtering

  • Filter by status: ALL, TODO, PROGRESS, DONE
  • Real-time filtering without network calls

3. Sorting

  • Sort by newest date
  • Sort by oldest date
  • Sort by status

4. State Management

  • Loading states during data operations
  • Error handling with snackbar messages
  • Bottom sheet for create/edit operations

Technology Stack

Core

  • Kotlin - Modern programming language for Android
  • Jetpack Compose - Declarative UI framework
  • Material Design 3 - Latest Material Design components
  • Coroutines - Asynchronous programming
  • Flow - Reactive streams

Architecture

  • Hilt - Dependency injection
  • ViewModel - Lifecycle-aware state management
  • Room - Local database
  • Clean Architecture - Separation of concerns

Testing

  • JUnit - Unit testing framework
  • MockK - Mocking library
  • Turbine - Flow testing
  • Coroutines Test - Testing coroutines
  • Compose Test - UI testing

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages