# Website Checker — Desktop App A Tkinter-based desktop application for shift-based website monitoring, backed by a remote MySQL database. --- ## Project Structure ``` website_checker/ ├── app.py ← Entry point & main application shell ├── config.py ← DB config, connection pool, schema init ├── models.py ← All database access (CRUD + logging) ├── requirements.txt ├── utils/ │ └── ui_helpers.py ← Theme, colour constants, reusable widgets └── views/ ├── login_view.py ← Login screen ├── admin_users_view.py ← Admin: User Management ├── admin_websites_view.py ← Admin: Website Link Management ├── admin_log_view.py ← Admin: Activity Log └── user_dashboard_view.py ← User: Shift Checklist Dashboard ``` --- ## Prerequisites - Python 3.9 or newer (must include Tkinter — standard on Windows/macOS) - A remote MySQL 5.7+ / MariaDB 10.3+ server - The database and a user with CREATE / INSERT / UPDATE / DELETE privileges --- ## Setup Instructions ### 1. Install Python dependencies ```bash pip install -r requirements.txt ``` ### 2. Configure the database connection Open `config.py` and update the `DB_CONFIG` dictionary: ```python DB_CONFIG = { "host": "your-mysql-host", # ← change this "port": 3306, "database": "website_checker", # ← create this DB first "user": "your-db-user", # ← change this "password": "your-db-password", # ← change this } ``` > **Important:** Create the database on your MySQL server first: > ```sql > CREATE DATABASE website_checker CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; > ``` ### 3. Run the application ```bash python app.py ``` On first launch, the app automatically creates all required tables and seeds a default admin account: | Field | Value | |----------|------------| | Username | `admin` | | Password | `admin123` | **Change the admin password immediately after first login.** --- ## Feature Overview ### Admin Role | Feature | Description | |---|---| | User Management | Create, edit, deactivate, and delete users; assign admin or regular role | | Website Management | Add sites with name, URL, multiple login credentials, and notes | | Activity Log | View a chronological audit trail of all create/edit/delete/login events | | Shift Dashboard | Admins can also use the shift checklist like regular users | ### Regular User Role | Feature | Description | |---|---| | Login | Secure username/password login | | Shift Checklist | See all active websites; click URL to open in browser; check off each site | | Credentials Popup | Clicking a site shows its stored login credentials with a password reveal toggle | | Notes | Write or update a per-site note for each shift day | | Progress Bar | Visual indicator of how many sites have been checked this shift | --- ## Activity Logging Every significant action is recorded in the `activity_log` table: | Action | Trigger | |---|---| | `LOGIN` / `LOGOUT` | User authentication events | | `CREATE_USER` | Admin creates a new user | | `UPDATE_USER` | Admin edits a user | | `DELETE_USER` | Admin deletes a user | | `CREATE_WEBSITE` | Admin adds a website | | `UPDATE_WEBSITE` | Admin edits a website | | `DELETE_WEBSITE` | Admin soft-deletes a website | | `CHECK_WEBSITE` | User marks a website as checked | | `UPDATE_NOTE` | User updates their shift note | Logs are also written to `app.log` in the application directory. --- ## Database Schema (auto-created on first run) - `users` — application accounts with role-based access - `websites` — monitored sites - `website_credentials` — multiple username/password pairs per site - `shift_checks` — one record per user per site per day - `activity_log` — full audit trail --- ## Notes - Websites are **soft-deleted** (flagged inactive) to preserve historical check records. - Passwords are stored as **SHA-256 hashes**. For production, consider upgrading to `bcrypt`. - The connection pool size is set to 5; increase `pool_size` in `config.py` for larger teams.