Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
3f7ef6f
refactor: use platformdirs for data storage and allow setup mode
karan-vk Feb 12, 2026
371c446
ci: add github actions build workflow
karan-vk Feb 12, 2026
38c3446
chore: update gitignore for test and tool artifacts
karan-vk Feb 12, 2026
72decff
feat: implement setup api endpoint for credentials upload
karan-vk Feb 12, 2026
ca2cd94
feat: add frontend setup view for missing credentials
karan-vk Feb 12, 2026
9a5a0e8
docs: add agent documentation and analysis files
karan-vk Feb 12, 2026
518c4e1
ci: remove macos-13 runner due to configuration error
karan-vk Feb 12, 2026
58adc1f
ci: add auto-release on tag push
karan-vk Feb 12, 2026
2dac02c
docs: update README with standalone app capabilities
karan-vk Feb 12, 2026
6fafb57
ci: optimize build workflow and update release action
karan-vk Feb 12, 2026
68fa67b
docs: fix formatting and language identifiers in local AGENTS.md guides
karan-vk Feb 12, 2026
aa9dc1c
docs: update main AGENTS.md with platformdirs and setup route
karan-vk Feb 12, 2026
3bd2214
refactor: sort API router exports alphabetically
karan-vk Feb 12, 2026
ecedcf4
fix(backend): security improvements and robust setup logic
karan-vk Feb 12, 2026
f319145
fix(build): enhance cross-platform packaging
karan-vk Feb 12, 2026
0eaa416
fix(frontend): improve file upload UX and validation
karan-vk Feb 12, 2026
497f57a
docs: update README based on CodeRabbit feedback
karan-vk Feb 12, 2026
0499370
docs: add community governance and improve documentation
karan-vk Feb 12, 2026
7590827
chore: remove AGENTS.md from git tracking
karan-vk Feb 12, 2026
735ccbc
feat(ui): redesign setup flow with multi-step wizard
karan-vk Feb 12, 2026
bb87e8f
feat(core): add custom exception hierarchy and error handling utilities
karan-vk Feb 12, 2026
7202818
feat(config): add performance settings for large inbox optimization
karan-vk Feb 12, 2026
1e05128
feat(scan): implement streaming mode for large inbox support
karan-vk Feb 12, 2026
a27f36c
refactor(gmail): integrate error handling decorators across services
karan-vk Feb 12, 2026
f97fbd1
refactor(api): improve error responses with structured error codes
karan-vk Feb 12, 2026
e0e1d82
feat(ui): add toast notification system for user feedback
karan-vk Feb 12, 2026
2371c45
refactor(ui): integrate notifications into existing UI components
karan-vk Feb 12, 2026
7559984
test(integration): add comprehensive integration test suite
karan-vk Feb 12, 2026
321a2ce
docs(roadmap): mark in-progress items as completed
karan-vk Feb 12, 2026
33cec6b
docs(readme): update release artifact filenames to match CI output
karan-vk Feb 13, 2026
66f53ac
chore: move GMAIL_SERVICES_ANALYSIS.md to .github/agent/reference/
karan-vk Feb 13, 2026
79922a0
fix(build): correct python_multipart module name in hiddenimports
karan-vk Feb 13, 2026
e00e186
feat(ui): improve setup wizard with missing credential steps
karan-vk Feb 13, 2026
3327cf2
docs(ui): add setup video tutorial link to wizard
karan-vk Feb 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
blank_issues_enabled: true
contact_links:
- name: Security Vulnerability
url: https://github.com/Gururagavendra/gmail-cleaner/security/policy
about: Please report security vulnerabilities through our security policy
- name: Feature Request
url: https://github.com/Gururagavendra/gmail-cleaner/issues/new?template=feature_request.yml
about: Suggest a new feature or improvement
- name: Questions & Discussions
url: https://github.com/Gururagavendra/gmail-cleaner/discussions
about: Ask questions and discuss with the community
45 changes: 41 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,49 @@
## Description

<!-- What does this PR do? -->
<!-- What does this PR do? Provide a clear, concise description. -->

## Type of Change

- [ ] 🐛 Bug fix (non-breaking change that fixes an issue)
- [ ] ✨ New feature (non-breaking change that adds functionality)
- [ ] 💥 Breaking change (fix or feature that would cause existing functionality to change)
- [ ] 📚 Documentation update
- [ ] 🔧 Refactor (code improvement without functional changes)
- [ ] ✅ Test update

## How Has This Been Tested?

<!-- Describe the tests you ran to verify your changes. -->

- [ ] Unit tests pass locally
- [ ] Integration tests pass (if applicable)
- [ ] Manual testing performed

**Test Configuration:**
- Python version:
- OS:

## Checklist

- [ ] I have tested my changes locally
- [ ] Docker build works (if modified)
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published

## Screenshots (if applicable)

<!-- Add screenshots to help explain your changes. -->

## Related Issues

<!-- Fixes #123 -->
<!-- Link any related issues here. Use "Fixes #123" to auto-close issues when merged. -->

Fixes #

## Additional Notes

<!-- Add any other context about the PR here. -->
38 changes: 38 additions & 0 deletions .github/agent/reference/GMAIL_SERVICES_ANALYSIS.md

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this abvoe specc and anaysis file are created by agents to make changes right and yes they will be useful can we move to specific folder so lets keep these under

.gituhb/agent/reference

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Deep Dive Analysis: `app/services/gmail`

## 1. Overview
The `app/services/gmail` directory is well-structured and modular. It follows a clear separation of concerns, with each file handling a specific aspect of Gmail operations (scanning, deleting, archiving, etc.). The `__init__.py` file acts as a clean facade, exposing necessary functions while hiding internal implementation details.

## 2. Pattern Consistency
The codebase demonstrates high consistency in the following areas:

* **State Management**: All modules consistently use the global `state` object from `app.core.state` to track progress, store results, and handle errors. This ensures a unified way of communicating status to the frontend.
* **Service Retrieval**: Every module retrieves the Gmail service using `get_gmail_service()` from `app.services.auth`, handling potential errors in a uniform way.
* **Batch Processing**: Operations like scanning and deleting consistently use Gmail API's batch capabilities (`new_batch_http_request` or `batchModify`) to optimize performance and respect rate limits.
* **Status Reporting**: Each module provides a `get_<operation>_status()` function that returns a copy of the relevant state, maintaining a consistent interface for status polling.
* **Error Handling**: `try-except` blocks are used consistently to catch exceptions, update the state with the error message, and mark the operation as done.

## 3. Shared Helpers
`app/services/gmail/helpers.py` is effectively used to share common logic, preventing code duplication. Key helpers include:
* `build_gmail_query`: Centralizes query construction logic.
* `get_sender_info` & `get_subject`: Standardizes header parsing.
* `get_unsubscribe_from_headers`: Encapsulates the logic for finding unsubscribe links.
* `validate_unsafe_url`: Provides shared security validation.

## 4. "God Objects" & Complexity
While most files are focused, a few areas show signs of high complexity:

* **`app/services/auth.py` (External to `gmail` dir but critical)**: This file is a "God Object" candidate (685 lines). The `get_gmail_service` function contains a massive nested `run_oauth` function that handles the entire OAuth flow, including starting a local HTTP server. This logic should ideally be extracted into a separate `OAuthManager` class or module.
* **`app/services/gmail/delete.py`**: This file (439 lines) handles both the *scanning* of senders for deletion and the *actual deletion* (both single sender and bulk). Splitting this into `delete_scan.py` and `delete_action.py` would improve maintainability and separation of concerns.

## 5. Circular Dependencies
**Status: Clean.**
No circular dependencies were found. The dependency graph is unidirectional and healthy:
* `app/services/gmail/*` imports `app.core.state`, `app.services.auth`, and `app.services.gmail.helpers`.
* `app/services/auth` imports `app.core.state` and `app.core.settings`.
* `app/core/state` has no internal dependencies.
* `app/services/gmail/__init__.py` imports from submodules but submodules do not import back from `__init__`.

## 6. Recommendations
1. **Refactor `app/services/auth.py`**: Extract the OAuth flow logic into a dedicated handler to reduce the size and complexity of the auth service.
2. **Split `app/services/gmail/delete.py`**: Separate the scanning logic (`scan_senders_for_delete`) from the deletion logic (`delete_emails_by_sender`, `delete_emails_bulk`) to align with the single-responsibility principle.
45 changes: 45 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
version: 2

updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "06:00"
timezone: "America/New_York"
open-pull-requests-limit: 5
groups:
production-dependencies:
dependency-type: "production"
development-dependencies:
dependency-type: "development"
labels:
- "dependencies"
- "python"
commit-message:
prefix: "deps"
include: "scope"
reviewers:
- "Gururagavendra"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "06:00"
timezone: "America/New_York"
open-pull-requests-limit: 3
labels:
- "dependencies"
- "github-actions"
commit-message:
prefix: "ci"
include: "scope"
reviewers:
- "Gururagavendra"
groups:
github-actions:
patterns:
- "*"
62 changes: 62 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build

on:
push:
branches: [ main ]
tags: [ 'v*' ]
pull_request:
branches: [ main ]

jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
permissions:
contents: write
strategy:
fail-fast: false
matrix:
# macos-13 is the last Intel runner
# macos-14 is Apple Silicon (M1)
os: [ubuntu-latest, windows-latest, macos-14]

steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Set up Python
run: uv python install 3.12

- name: Install dependencies
run: uv sync

- name: Build with PyInstaller
run: uv run python build_app.py

- name: Zip Build Output (Unix)
if: runner.os != 'Windows'
run: |
cd dist
zip -r ../gmail-cleaner-${{ matrix.os }}.zip gmail-cleaner/

- name: Zip Build Output (Windows)
if: runner.os == 'Windows'
run: |
Compress-Archive -Path dist/gmail-cleaner -DestinationPath gmail-cleaner-${{ matrix.os }}.zip

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: gmail-cleaner-${{ matrix.os }}
path: gmail-cleaner-${{ matrix.os }}.zip
if-no-files-found: error
retention-days: 30

- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: gmail-cleaner-${{ matrix.os }}.zip
Comment thread
coderabbitai[bot] marked this conversation as resolved.

8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,16 @@ Thumbs.db

# Personal notes (not committed)
IMPROVEMENTS.md
AGENTS.md

**/AGENTS.md

# Test/Coverage artifacts
.coverage
.pytest_cache/
htmlcov/
coverage.xml

# GitHub Copilot instructions (user specific)
.github/copilot-instructions.md
# PyInstaller
build/
dist/
133 changes: 133 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
guruvelu85@gmail.com.

All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of
actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the
community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
Loading
Loading