{"id":27112503,"url":"https://github.com/clinton-mwachia/python-desktop-app-template","last_synced_at":"2026-02-18T18:32:10.345Z","repository":{"id":253084160,"uuid":"835142177","full_name":"clinton-mwachia/python-desktop-app-template","owner":"clinton-mwachia","description":"A template for making dektop applications using python, tkinter and mongoDB","archived":false,"fork":false,"pushed_at":"2025-04-04T13:34:21.000Z","size":71,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T14:28:56.908Z","etag":null,"topics":["desktop-app","desktop-application","gui","python","tkinter"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clinton-mwachia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-29T08:44:34.000Z","updated_at":"2025-04-04T13:34:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"a8bf76b5-d3a5-44d7-ba10-b4e102ab7b1d","html_url":"https://github.com/clinton-mwachia/python-desktop-app-template","commit_stats":null,"previous_names":["clinton-mwachia/desktop-app-template"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/clinton-mwachia/python-desktop-app-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clinton-mwachia%2Fpython-desktop-app-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clinton-mwachia%2Fpython-desktop-app-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clinton-mwachia%2Fpython-desktop-app-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clinton-mwachia%2Fpython-desktop-app-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clinton-mwachia","download_url":"https://codeload.github.com/clinton-mwachia/python-desktop-app-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clinton-mwachia%2Fpython-desktop-app-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29589512,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T16:55:40.614Z","status":"ssl_error","status_checked_at":"2026-02-18T16:55:37.558Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["desktop-app","desktop-application","gui","python","tkinter"],"created_at":"2025-04-07T01:59:41.123Z","updated_at":"2026-02-18T18:32:10.332Z","avatar_url":"https://github.com/clinton-mwachia.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Desktop Application Template\n\nThis is a Python-based desktop application template using Tkinter for the GUI and MongoDB for data storage. The application includes user authentication, a dashboard, and features to manage tasks (todos) and users.\n\n## Features\n\n- User Authentication: Register, login, and manage user sessions securely.\n- Dashboard: A user-friendly dashboard displaying tasks and user information.\n- Task Management: Create, view, edit, and delete tasks. Tasks are associated with users, ensuring each user sees only their own tasks.\n- User Profile: View and update user profiles, including the ability to change the password with confirmation of the old password.\n- Notifications: The GUI is designed to be display notifications to the user when CRUD operations are done to the tasks.\n- Settings: The GUI provides a section for updating settings of the app.\n\n## Project Structure\n\n```\n├── auth/\n│   ├── auth.py          # Handles user authentication (login, registration, etc.)\n├── utils/\n│   ├── database.py      # MongoDB connection and operations\n│   └── logger.py        # Logger setup for the\n├── models/\n|   |── todo.py          # Todo models\n|   └── user.py          # User models\n├── views/\n│   ├── login.py         # Login view\n│   ├── register.py      # Register view\n│   ├── dashboard.py     # Dashboard view\n│   ├── todo.py          # Todo view\n│   ├── user.py          # User view\n│   ├── notification.py  # Notification view\n│   ├── logs.py          # logs view\n│   └── profile.py       # User profile view\n├── main.py              # Entry point for the application\n└── README.md            # This file\n\n```\n\n## Installation\n\n### Prerequisites\n\n- Python 3.13.2\n- MongoDB\n\n### Setup\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/clinton-mwachia/desktop-app-template.git\ncd desktop-app-template\n```\n\n## NOTE\n\n- If you are running the code using cmd on vscode, use _py_ followed by other commands.\n- Use _python_ follwed by other commands on CMD.\n\n2. Install the required packages:\n\n```bash\npy pip install -r requirements.txt\n```\n\n3. Start the MongoDB server (if not already running).\n\n4. Run the application:\n\n```bash\npy main.py\n```\n\n## Compiling to an Executable\n\nYou can compile the Python application into a standalone executable using `PyInstaller`. This allows the app to run on machines without Python installed.\n\n### Steps to Compile\n\n1. Navigate to the project directory and run the following command to create a standalone executable:\n\n```bash\npy -m pyInstaller --onefile --windowed main.py\n```\n\n- `--onefile`: Packages the application into a single executable file.\n- `--windowed`: Suppresses the console window (useful for GUI applications).\n\n3. After running the command, you’ll find the executable in the `dist` folder inside your project directory.\n\n### Additional Tips\n\n- You can customize the executable by adding an icon with the `--icon` option:\n\n```bash\npy -m pyInstaller --onefile --windowed --icon=path_to_icon.ico main.py\n```\n\n- If your application requires external files (e.g., images, configuration files), you may need to adjust the `PyInstaller` spec file or manually copy these files to the appropriate directory after building the executable.\n\n# Make the app installable on windows\n\n## Step 1: Prepare Your Application\n\nMake sure your application is working correctly and all dependencies are working\n\n## Step 2: Use PyInstaller to Create an Executable\n\n### 1. Install PyInstaller\n\nFirst, you need to install PyInstaller if you haven't already:\n\n```bash\npy -m pip install pyinstaller\n```\n\n### 2. Create a PyInstaller Spec File\n\nPyInstaller uses a spec file to know how to build your executable. You can customize this file to include additional files or directories.\n\nRun PyInstaller to generate an initial spec file and executable:\n\n```bash\npy -m pyinstaller --onefile --noconsole main.py\n```\n\nThis will generate the following files and folders:\n\n- dist/: Contains the final executable.\n- build/: Contains build files used by PyInstaller.\n- main.spec: The spec file describing the build.\n\nYou might want to customize the `.spec` file if you need to include extra data files, icons, or need special startup scripts.\n\n### 3. Customize the Spec File\n\nHere is custom `main.spec`\n\n```\n# -*- mode: python ; coding: utf-8 -*-\n\n\na = Analysis(\n    ['main.py'],\n    pathex=[],\n    binaries=[],\n    datas=[],\n    hiddenimports=[],\n    hookspath=[],\n    hooksconfig={},\n    runtime_hooks=[],\n    excludes=[],\n    noarchive=False,\n    optimize=0,\n)\npyz = PYZ(a.pure)\n\nexe = EXE(\n    pyz,\n    a.scripts,\n    a.binaries,\n    a.datas,\n    [],\n    name='main',\n    debug=False,\n    bootloader_ignore_signals=False,\n    strip=False,\n    upx=True,\n    upx_exclude=[],\n    runtime_tmpdir=None,\n    console=False,\n    disable_windowed_traceback=False,\n    argv_emulation=False,\n    target_arch=None,\n    codesign_identity=None,\n    entitlements_file=None,\n)\n```\n\nTo add additional data files like images, themes, or text files, you can modify the `datas` section:\n\n```python\ndatas=[\n    ('position.txt', '.'),  # Include position.txt file\n    ('themes/', 'themes/'),  # Include a themes folder\n]\n```\n\n### 4. Run PyInstaller with Spec File\n\nAfter customizing your `.spec` file, run PyInstaller again:\n\n```bash\npy -m pyinstaller main.spec\n```\n\nThis will create the executable in the `dist/main.exe` folder.\n\n## Create a Windows Installer with Inno Setup\n\nInno Setup is a free installer for Windows programs. It’s easy to use and widely supported.\n\n### 1. Download and Install Inno Setup\n\nYou can download Inno Setup from the official website: [Inno Setup](https://jrsoftware.org/isinfo.php)\n\n### 2. Create an Inno Setup Script\n\nCreate a new script file (`main.iss`) for your installer with the following content:\n\n```ini\n; Script generated by the Inno Setup Script Wizard.\n; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!\n\n#define MyAppName \"main\"\n#define MyAppVersion \"1.0\"\n#define MyAppPublisher \"Clinton Moshe\"\n#define MyAppURL \"http://example.com\"\n#define MyAppExeName \"main.exe\"\n\n[Setup]\n; NOTE: The value of AppId uniquely identifies this application.\n; Do not use the same AppId value in installers for other applications.\n; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)\nAppId={{8B5D708F-9E7B-4C53-AC1A-9C83AFAF7B5D}\nAppName={#MyAppName}\nAppVersion={#MyAppVersion}\n;AppVerName={#MyAppName} {#MyAppVersion}\nAppPublisher={#MyAppPublisher}\nAppPublisherURL={#MyAppURL}\nAppSupportURL={#MyAppURL}\nAppUpdatesURL={#MyAppURL}\nDefaultDirName={autopf}\\{#MyAppName}\nDefaultGroupName={#MyAppName}\nOutputDir=Output\nOutputBaseFilename=mainSetup\nCompression=lzma\nSolidCompression=yes\nWizardStyle=modern\n\n[Languages]\nName: \"english\"; MessagesFile: \"compiler:Default.isl\"\n\n[Tasks]\nName: \"desktopicon\"; Description: \"{cm:CreateDesktopIcon}\"; GroupDescription: \"{cm:AdditionalIcons}\"; Flags: unchecked\n\n[Files]\nSource: \"dist\\*\"; DestDir: \"{app}\"; Flags: ignoreversion recursesubdirs createallsubdirs\nSource: \"icon.ico\"; DestDir: \"{app}\"; Flags: ignoreversion\n\n[Icons]\nName: \"{group}\\{#MyAppName}\"; Filename: \"{app}\\{#MyAppExeName}\"\nName: \"{commondesktop}\\{#MyAppName}\"; Filename: \"{app}\\{#MyAppExeName}\"; Tasks: desktopicon\n\n[Run]\nFilename: \"{app}\\{#MyAppExeName}\"; Description: \"{cm:LaunchProgram, {#MyAppName}}\"; Flags: nowait postinstall skipifsilent\n```\n\n### 3. Customize the Script\n\nYou can customize the script to suit your application’s needs:\n\n- AppName: Set to the name of your application.\n- AppVersion: Set to your application's version.\n- AppPublisher: Your name or organization.\n- AppExeName: The name of the executable file (`main.exe`).\n- OutputBaseFilename: The name of the setup file.\n\n### 4. Compile the Installer\n\n1. Open Inno Setup and load your script (`main.iss`).\n2. Click the Compile button (or press F9).\n\nThis will generate a `mainSetup.exe` file in the `Output` directory specified in the script. This setup file is the installer for your application.\n\n## Step 4: Test the Installer\n\n1. Run the Installer: Double-click the `mainSetup.exe` file to run the installer.\n2. Follow the Setup Wizard: Follow the steps in the wizard to install your application.\n3. Verify Installation: After installation, ensure that your application launches correctly and the shortcuts are created as expected.\n\n## Advanced Features\n\nInno Setup allows you to add advanced features such as:\n\n- Custom Icons: Use custom icons for your installer and shortcuts.\n- Registry Entries: Modify or add registry entries.\n- Auto-Start: Automatically start the application after installation.\n- Uninstaller: Include an uninstaller to remove the application.\n- License Agreement: Display a license agreement during installation.\n\n### how you can add a license agreement:\n\n```ini\n[License]\nLicenseFile=license.txt\n```\n\n## Usage\n\n### Registering a User\n\nUpon starting the application, the user will be prompted to register. After successful registration, the application will automatically transition to the login view.\n\n### Logging In\n\nExisting users can log in using their credentials. Upon successful login, the application will display the dashboard.\n\n### Managing Tasks\n\nFrom the dashboard, users can create, view, edit, and delete their tasks. The tasks are displayed in a table, with the most recent tasks appearing at the top.\n\n### Profile Management\n\nUsers can view their profile, update details, and change their password. The profile view is centered, with the user’s image on the left and details on the right.\n\n## Customization\n\n- Database Configuration: Modify the `utils/database.py` file to configure MongoDB settings.\n- UI Adjustments: Adjust the Tkinter UI components in the `views/` directory to match your design preferences.\n\n## Contributing\n\nContributions are welcome! Please fork the repository and submit a pull request with your changes.\n\n## License\n\nThis project is licensed under the Appache License. See the `LICENSE` file for more details.\n\n_Happy coding!_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclinton-mwachia%2Fpython-desktop-app-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclinton-mwachia%2Fpython-desktop-app-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclinton-mwachia%2Fpython-desktop-app-template/lists"}