Skip to content

Repository files navigation

Employee Console ManagerVersion: 1.0.0The Employee Console Manager is a command-line utility designed to simplify the management of your local Nyambene Employee Console PHP application server. It provides a user-friendly interface to start, stop, restart, and monitor your Employee Console server, as well as assist with initial setup like super admin creation.Table of ContentsFeaturesPrerequisitesInstallationUsageBuilding the ExecutableConfigurationRemote AuthorizationTroubleshootingContributingLicenseFeaturesServer Management: Start, stop, and restart the PHP development server for the Employee Console.Server Monitoring: Automatically detects if the server stops unexpectedly and offers to restart it.First-Time Setup Assistance: Guides you through detecting the Employee Console installation path and setting up the initial super admin user.Remote Authorization: Checks with a remote service for device authorization before proceeding.Debug Mode: Toggle verbose logging for troubleshooting.Cross-Platform: Designed to work on Windows (and potentially other OS with PHP installed).PrerequisitesIMPORTANT: This application manages an existing PHP-based Employee Console installation. It does not bundle PHP or the Employee Console application itself. You must have the following installed and configured on your system:PHP: PHP must be installed and accessible in your system's PATH. This is typically achieved by installing a local web server stack.Local Web Server Stack (e.g., XAMPP, WAMP, Laragon): These provide PHP, MySQL, and Apache/Nginx, which are necessary for the Employee Console application.Nyambene Employee Console Application: The actual PHP application (e.g., a Kimai 2 fork) must be installed in a location accessible by your web server stack (e.g., htdocs for XAMPP, www for WAMP/Laragon). The manager will attempt to auto-detect common installation paths.InstallationClone the Repository:git clone https://github.com/[your-github-username]/[your-repo-name].git cd [your-repo-name] Install Python Dependencies:It's recommended to use a virtual environment.python -m venv venv

On Windows:

venv\Scripts\activate

On macOS/Linux:

source venv/bin/activate

pip install colorama requests Ensure PHP Employee Console is Installed:Make sure your "Nyambene Employee Console" PHP application is correctly installed and configured with your local web server stack (XAMPP, WAMP, Laragon, etc.). The manager will look for it in common locations.UsageRunning Directly from PythonAfter installation, you can run the script from your terminal:# Activate your virtual environment first (if you created one)

On Windows: venv\Scripts\activate

On macOS/Linux: source venv/bin/activate

python employee_console_manager.py You can also enable debug mode:python employee_console_manager.py --debug Running the ExecutableIf you have built the executable (see Building the Executable), simply run the generated .exe file:./dist/EmployeeConsoleManager.exe First-Time SetupOn the first run, the application will:Prompt for Company Name: You'll be asked to enter your company's name.Check Remote Authorization: It will connect to https://embloyee-management-remote.vercel.app/api/auth to verify device authorization.Detect Employee Console Path: It will attempt to find your Employee Console installation. If not found, it will prompt you to enter the path manually.Super Admin Setup: It will ask if a super admin has already been set up. If not, it will guide you through creating one (requiring name, email, and a password of at least 10 characters). This uses the PHP bin/console command of your Employee Console.Interactive MenuOnce the server is running, an interactive menu will be displayed:1. Restart Server: Stops and then restarts the PHP development server.2. Stop Server: Stops the currently running PHP development server.3. View Server Status: Checks and reports if the server is currently running.4. Toggle Debug Mode: Enables or disables verbose debug logging.5. Exit: Stops the server and exits the application.Building the ExecutableTo create a standalone executable using PyInstaller:Install PyInstaller:pip install pyinstaller Build the Executable:Navigate to the root of your project (where employee_console_manager.py is located) and run:pyinstaller --onefile --name "EmployeeConsoleManager" --clean --icon "path/to/your/icon.ico" employee_console_manager.py Replace "path/to/your/icon.ico" with the actual path to your .ico file.The executable will be generated in the dist/ directory.ConfigurationThe application stores its configuration (like the Employee Console installation path, company name, and setup status) in a file named console_config.json in the same directory as the executable.Remote AuthorizationThe application includes a check with a remote service (https://embloyee-management-remote.vercel.app/api/auth) to ensure the device is authorized to run the application. If authorization is denied, the application will terminate. If the remote service is unreachable, the application will proceed with a warning.Troubleshooting"PHP not found" or "php is not recognized": Ensure PHP is correctly installed and its executable path is added to your system's environment variables (PATH)."Employee Console not found": Verify that the "Nyambene Employee Console" application is installed at one of the common paths checked by the manager, or manually provide the correct path when prompted."Access has not yet been granted": Contact the developer of the Employee Console Manager to authorize your machine ID.Server fails to start: Check if port 8001 is already in use by another application. Ensure the public directory exists within your Employee Console installation.[Upstash Redis] The 'url' property is missing... warnings: These are from your Next.js backend, not this Python script. Ensure your Next.js project has the REDIS_URL and REDIS_TOKEN environment variables correctly configured on Vercel and in your local .env.local file.ContributingFeel free to open issues or submit pull requests if you have suggestions or improvements.LicenseThis project is open-source and available under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages