Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

43 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Petal icon

Petal

Your cycle, gently tracked β€” private, offline, and beautifully simple.

Version Platform Built with Flet Python Offline

Track your cycle with calm, clarity, and care.


✨ Overview

Petal is a private, offline-first period and cycle tracker. Log your periods, symptoms and moods, and see your current phase, fertile window and next-period prediction at a glance β€” wrapped in a soft, Flo-inspired design with six pastel themes.

No accounts. No servers. No tracking. Your data lives on your device.

🌸 Built with care to be a calm, everyday companion.


πŸ“Έ Screenshots

Today Calendar Insights Log period

πŸš€ Features

🌸 Today at a Glance

  • Cycle ring β€” current cycle day with a live "period in N days" countdown.
  • Personal greeting β€” a casual, time-of-day hello that reads your profile name.
  • Phase & fertility card β€” current phase chip plus ovulation, fertile window and next-period dates.
  • Current phase card β€” Menstrual / Follicular / Ovulation / Luteal, with a rotating hormone fun-fact (FSH, estrogen, LH, progesterone).
  • Quick stats β€” average cycle length, average period length, cycles logged.

πŸ“… Calendar

  • Month grid with colour-coded dots: logged period, predicted period, fertile window and ovulation.
  • Month-to-month navigation and a clear legend.

πŸ“ˆ Insights

  • Averages and totals at a glance, plus your full, editable history.

πŸ“ Logging

  • Log start/end dates, flow, mood, symptoms (themed chips) and notes.
  • Edit or delete any entry; predictions, phases and the fertile window are all derived automatically.

πŸ—‘οΈ Trash (30-day retention)

  • Deleting an entry moves it to Trash (with a confirmation) β€” restore it or delete it forever.
  • Auto-purged after 30 days.

🎨 Theming

  • Six pastel palettes β€” Lavender, Coral, Teal, Baby blue, Storm and Pale.
  • Themes re-tint everything: primary colour, gradients, the gradient + button, nav highlight and fields.

πŸ“± Responsive & Animated

  • Mobile-first scaling β€” text, icons and controls scale with the viewport (phones β†’ tablets) and re-flow on resize.
  • Cross-fading nav highlight, smooth screen transitions, and a docked gradient action button.

πŸ”’ Private & Secure

  • PIN app-lock β€” set a PIN and Petal shows a lock screen on launch. PINs are salted + SHA-256 hashed, never stored in plaintext.
  • Local-first β€” all data stays on-device.

πŸ”„ Up to Date

  • In-app update checker β€” checks the GitHub repo for a newer release and offers a one-tap Update button that opens the download page.

πŸ› οΈ Tech Stack

Language Python 3.13
UI Flet 0.85 (Flutter under the hood)
Storage SQLite β€” period_tracker.db (entries + settings)
Networking httpx (update check only)
Tooling uv for env & builds
Packaging src/ layout + Hatchling

🏁 Getting Started (development)

# 1. Install uv (https://github.com/astral-sh/uv), then sync deps
uv sync

# 2. Run on desktop for quick iteration
uv run flet run main.py

# 3. Optional: load a few sample cycles
uv run python -m petal.seed

# 4. Build a signed Android APK (see Release workflow below)
uv run flet build apk

Note: runtime deps stay lean β€” only flet is bundled into the APK. The Flet CLI, web/desktop server and the websockets fix live in the dev dependency group (installed by uv, never shipped to the device).


πŸ“¦ Release Workflow

Two helper scripts (build-release.ps1 is git-ignored β€” it holds the keystore path) make releases a two-step affair:

# Build a signed APK β€” prompts for the keystore password, auto-increments versionCode
.\build-release.ps1

# Commit, tag (vX.Y.Z), push, and publish the GitHub release
.\create-release.ps1            # prompts once for a message used as commit + release notes
.\create-release.ps1 -Build     # chain both: build then release

Signing uses a local release keystore (petal-release.jks, git-ignored). Releases are published to the app repo, where the in-app update checker looks for them.

πŸ“₯ Download the latest APK: github.com/3th4n-J/petal-app/releases


πŸ—‚οΈ Project Structure

PT/
β”œβ”€ main.py                 # entry point for `flet run` / `flet build`
β”œβ”€ pyproject.toml          # uv project (runtime: flet Β· dev: flet[all] + websockets)
β”œβ”€ assets/
β”‚  └─ icon.png             # app / launcher icon
└─ src/petal/
   β”œβ”€ __init__.py          # version
   β”œβ”€ __main__.py          # `python -m petal` / `uv run petal`
   β”œβ”€ models.py            # PeriodEntry dataclass + option lists
   β”œβ”€ db.py                # SQLite data layer (CRUD, settings, trash, PIN)
   β”œβ”€ cycle_stats.py       # predictions, phases, fertile window, calendar map
   β”œβ”€ theme.py             # 6 pastel palettes, responsive scaling, cards/pills
   β”œβ”€ widgets.py           # canvas cycle ring, stat tiles, calendar grid
   β”œβ”€ ui.py                # nav shell + Today/Calendar/Insights/Settings + lock + updates
   └─ seed.py              # sample data loader

πŸ” Privacy

Petal is offline-first and account-free. Your entries, symptoms and settings never leave your device. The only network request is an optional check to GitHub for app updates.


πŸ™ Author

Made with love by Ethan Johnston.

Built for my angel ❀️ β€” may it be a small, gentle help every day.


Β© 2026 Ethan Johnston Β· Petal

About

🌸Petal β€” a calm, private period tracker: log cycles, symptoms & moods, see phase and next-period predictions. Offline-first.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors