Hoossayn / maids

assessment task for maids.cc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

maids

you can view a live demo from here

Welcome to the Maids.cc Test App! This Android mobile application is a demonstration project by Maids.cc, utilizing a fake API (dummyjson) to simulate interactions with a real server. The app functions as a task manager, allowing users to log in, authenticate, and manage tasks. This README provides a comprehensive guide to understanding, using, and exploring the app.

Table of Contents

  1. Features
  2. Getting Started
  3. Usage
  4. Design Decisions
  5. Challenges Faced
  6. Technical Details
  7. Best Practices Followed
  8. Unit Testing

Features

  • User Authentication: Users can log in using credentials registered with the fake API server. Authentication is managed using access tokens and refresh tokens.
  • Task Management: Users can view all tasks, add new tasks, edit existing tasks, and delete tasks. Changes are stored in local storage due to the limitations of the fake API.
  • Local Storage: Tokens and tasks are stored locally, allowing users to view and manage tasks even offline.
  • Pagination: Tasks are fetched 10 at a time for efficient data handling and improved performance.
  • State Management: The app utilizes the Provider package for state management.
  • Unit Testing: Multiple services in the app are covered by unit tests to ensure functionality and reliability.

Getting Started

Prerequisites

  • Flutter SDK
  • Android Studio or VS Code with Flutter extension
  • A device or emulator running Android

Installation

  1. Clone the repository:
    git clone https://github.com/Hoossayn/maids.git
  2. Navigate to the project directory:
    cd maids
  3. Get the dependencies:
    flutter pub get
  4. Run the app:
    flutter run

Usage

  1. Login: Enter your credentials to log in. The app uses the fake API to authenticate the user.
  2. View Tasks: Once logged in, you can view a list of tasks. Tasks are fetched in batches of 10.
  3. Manage Tasks:
    • Add Task: Add a new task using the provided form.
    • Edit Task: Edit an existing task by selecting it from the list.
    • Delete Task: Delete a task by selecting the delete option.
  4. Local Storage: Tasks and tokens are stored locally. You can view saved tasks even if offline.

Design Decisions

The app follows a basic design commonly seen in to-do applications, focusing on simplicity and usability:

  • User Interface: A clean and straightforward UI design that allows users to focus on task management without distractions.
  • Navigation: Simple navigation structure with a home screen for tasks, a login screen, a page to view each task and a drawer to view user info, see information about the app, open a page to manage stored tasks and a button to logout.
  • State Management: Provider is used for efficient state management, ensuring that the app remains responsive and performs well.

Challenges Faced

While the app was relatively simple to develop, handling CRUD operations with a fake API presented some challenges:

  • Fake API Limitations: Since the dummyjson API doesn't persist changes, all CRUD operations only affect the local state or local storage. This required additional logic to manage local changes without expecting a real server response.
  • Token Management: Implementing seamless token refresh to handle the short-lived access tokens was a bit tricky but essential for smooth user experience.

Technical Details

  • State Management: Provider package is used to manage the app's state.
  • Local Storage: Tasks and tokens are stored using Flutter's local storage solutions.
  • API Integration: The app interacts with the dummyjson API for authentication and task data.
  • Pagination: Fetching tasks in batches of 10 to optimize performance and reduce load times.
  • Unit Testing: Comprehensive unit tests are implemented to ensure the app's services function correctly.

Best Practices Followed

The development of this app adhered to Flutter best practices and coding standards, focusing on:

  • State Management: Effective use of Provider for state management.
  • Performance: Optimized for smooth UI interactions and efficient data handling.
  • Local Storage: Proper handling of data persistence using local storage.
  • Unit Testing: High coverage and quality of unit tests to validate app functionality.

Unit Testing

Unit tests are implemented for various services in the app to ensure their validity and reliability. The tests cover:

  • Authentication services
  • Task management services
  • Local storage interactions
  • remote server interactions

By following rigorous testing practices, the app aims to maintain a high standard of quality and performance.

Improvement that can be made

  • A comprehensive styling can be made to keep app style and feel constant across all screen , like found here
  • Implement app localization like see here
  • Add confirmation dialogs where necessary

About

assessment task for maids.cc


Languages

Language:Dart 62.3%Language:C++ 17.4%Language:CMake 14.2%Language:Ruby 2.1%Language:Swift 1.4%Language:HTML 1.4%Language:C 1.1%Language:Kotlin 0.1%Language:Objective-C 0.0%