Skip to content

Alphaspiderman/Laundry-Tracker

Repository files navigation

Clothes Tracker

Laundry Tracker is a user-friendly mobile application designed to simplify your laundry routine. This innovative app allows you to keep track of your clothes at various stages of the laundry process - whether they're fresh and ready to wear, in the laundry basket waiting to be washed, or currently in the wash.

With Laundry Tracker, you can categorize your clothes into different sections, making it easier to manage your wardrobe. Each entry in the app is accompanied by an image, providing a visual reference for each item of clothing. This feature not only helps you identify your clothes quickly but also makes the app more interactive and easy to use.

Whether you're a busy professional who needs to streamline your laundry process, a student living away from home for the first time, or anyone who wants to bring more organization to their laundry routine, Laundry Tracker is the perfect solution. Say goodbye to laundry confusion and hello to a more organized wardrobe with Laundry Tracker.

Built Using

Flutter

Database Schema

Version 1

This is the initial version of the database schema. It is a simple schema with 1 table that holds the state of the clothes.

Database Schema - Version 1

Version 2

The second version of the database schema is a richer schema with 3 tables. The first table holds the information of the clothes and the second table holds the names of the categories which are linked to the categories. The third table holds information regarding miscellaneous clothes like socks, undergarments, etc.

Database Schema - Version 2

Version 3

Why v3

Version 3 was primarily an internal migration to make all core table IDs AUTOINCREMENT. It also prompted smarter import and migration logic in DatabaseHelper, which made schema upgrades and cross-version imports more reliable.

What changed (v2 -> v3)

  • Recreated core tables through temp tables and renamed them back to their canonical names. This allowed safe column rearrangements and preserved stable primary key behavior.
  • No new user-visible columns were introduced: clothes in v3 contains id, name, state, image_path, and category_id; categories contains id and name; misc_clothes keeps its counts and a total with a CHECK constraint.

Why this matters

  • AUTOINCREMENT IDs ensure new records receive stable, non-reused keys and simplify later migration logic.
  • The improved import/migration logic in DatabaseHelper reduced upgrade risk and kept older data compatible across schema versions.

Diagram

Database Schema - Version 3

Version 4

Why v4

Version 4 introduces ordering and richer metadata to support improved UX (reorderable categories and items) and item-level metadata (brand & color). The migration was designed to be non-destructive and to backfill sensible defaults so older data remains usable.

What changed (v3 -> v4)

  • Added sort_order on categories and clothes so the UI can persist custom ordering and show deterministic lists.
  • Added brand_id and color_id on clothes and created brands and colors tables to hold optional metadata.
  • Seeded a default colors set (the code inserts "Multicolor", "Black", "White", "Red", "Blue", "Green", "Yellow", "Grey", "Brown" with sort_order values).
  • Migration backfills sort_order from existing id values to preserve prior ordering and updates SQLITE_SEQUENCE so autoincrement IDs remain consistent after imports.

Why this matters

  • sort_order enables reordering flows (drag-and-drop) with a stable persisted order rather than relying on insertion timestamps or IDs.
  • Separate brands and colors let the UI offer suggestions, reuse values across items, and keep item records compact (referencing IDs instead of duplicating text).
  • The seeding step ensures a consistent palette for fresh installs and helps the UI show useful defaults.

Diagram

Database Schema - Version 4

About

An app for tracking Laundry, developed mainly for personal use

Resources

Stars

Watchers

Forks

Contributors