================================ MAKLOON PROFIT TRACKER Installation Guide ================================ VERSION: 1.0.0 DATE: December 2024 ================================ SYSTEM REQUIREMENTS ================================ - Web Server: Apache/Nginx - PHP Version: 8.0 or higher - PHP Extensions Required: * PDO * PDO_SQLite * SQLite3 * JSON * MBString - Database: SQLite (no additional installation needed) - Browser: Modern browser with JavaScript enabled ================================ INSTALLATION STEPS ================================ 1. UPLOAD FILES - Upload all application files to your web server - Recommended directory: public_html or htdocs - Ensure all files maintain their directory structure 2. SET FILE PERMISSIONS - Set proper permissions for the database file: chmod 666 makloon.db - Set proper permissions for the directory: chmod 755 /path/to/public_html 3. VERIFY PHP CONFIGURATION - Check if PHP is installed: php -v - Check if SQLite extension is enabled: php -m | grep sqlite - Verify in php.ini: extension=pdo_sqlite extension=sqlite3 4. INITIALIZE DATABASE (if needed) - If database doesn't exist or needs reset: php init_db.php - This will create all necessary tables - Default PIN will be set to: 4474 5. CONFIGURE WEB SERVER For Apache (.htaccess already included): - Ensure mod_rewrite is enabled - Ensure AllowOverride is set to All - .htaccess file handles all security and routing For Nginx: Add to your server block: location ~ /\. { deny all; } location ~* \.(db|md)$ { deny all; } location / { try_files $uri $uri/ /index.php?$query_string; } 6. TEST INSTALLATION - Access the application URL in your browser - You should see the login page - Login with default PIN: 4474 - Check if dashboard loads correctly 7. OPTIONAL: ADD SAMPLE DATA - For testing purposes, run: php add_sample_data.php - This will populate the database with test data - You can delete this data later from the interface ================================ POST-INSTALLATION ================================ 1. CHANGE DEFAULT PIN - For security, change the default PIN - Use SQLite to update the database: sqlite3 makloon.db UPDATE settings SET setting_value = 'YOUR_NEW_PIN' WHERE setting_key = 'pin'; .quit 2. SETUP BACKUP ROUTINE - Use the built-in backup feature from the application - Or setup automated backups via cron: 0 2 * * * cp /path/to/makloon.db /path/to/backups/makloon_$(date +\%Y\%m\%d).db 3. CONFIGURE TIMEZONE (Optional) - Default timezone is Asia/Jakarta - To change, edit config.php: date_default_timezone_set('Your/Timezone'); 4. SECURITY RECOMMENDATIONS - Keep PHP updated - Use HTTPS if possible - Restrict database file access - Regular backups - Monitor error logs ================================ TROUBLESHOOTING ================================ ISSUE: "Database connection error" SOLUTION: - Check if makloon.db exists - Verify file permissions (666 for file, 755 for directory) - Ensure SQLite extension is enabled ISSUE: "Permission denied" SOLUTION: - Set correct file permissions: chmod 666 makloon.db chmod 755 /path/to/directory ISSUE: "Blank page or errors" SOLUTION: - Enable error display temporarily: Edit config.php: ini_set('display_errors', 1); - Check error.log file - Verify PHP version (must be 8.0+) ISSUE: "Login not working" SOLUTION: - Check if sessions are enabled in PHP - Verify session.save_path is writable - Clear browser cookies - Check database settings table ISSUE: "Autocomplete not working" SOLUTION: - Check if JavaScript is enabled in browser - Verify script.js is loading - Check browser console for errors ================================ FILE STRUCTURE ================================ public_html/ ├── index.php - Main application file ├── login.php - Login page ├── logout.php - Logout handler ├── auth.php - Authentication functions ├── config.php - Configuration settings ├── db.php - Database helper functions ├── calculations.php - Calculation engine ├── api.php - API endpoint for AJAX ├── backup.php - Backup utility ├── export_pdf.php - PDF export handler ├── style.css - Responsive stylesheet ├── script.js - JavaScript functions ├── .htaccess - Apache configuration ├── makloon.db - SQLite database ├── init_db.php - Database initialization ├── add_sample_data.php - Sample data generator ├── README.md - Application documentation ├── INSTALL.txt - This file └── pages/ - Application pages ├── dashboard.php ├── clients.php ├── projects.php ├── products.php ├── raw_materials.php ├── product_costs.php ├── project_costs.php ├── purchases.php ├── payments.php └── reports.php ================================ DEFAULT CREDENTIALS ================================ PIN: 4474 IMPORTANT: Change this PIN immediately after first login! ================================ UPDATING THE APPLICATION ================================ To update to a newer version: 1. Backup your makloon.db file 2. Replace all PHP/CSS/JS files 3. Do NOT replace makloon.db 4. Check CHANGELOG for database updates 5. Test thoroughly before production use ================================ SUPPORT & MAINTENANCE ================================ For technical support: - Check README.md for detailed documentation - Review error.log for error messages - Verify all system requirements are met Database Maintenance: - Regular backups (daily recommended) - Periodic vacuum: sqlite3 makloon.db "VACUUM;" - Monitor database file size Performance Tips: - Keep database file size under 100MB for best performance - Archive old projects periodically - Use proper indexes (already included) ================================ UNINSTALLATION ================================ To completely remove the application: 1. Delete all application files 2. Delete the database file (makloon.db) 3. Remove any backup files 4. Remove web server configuration ================================ LICENSE ================================ Internal Business Use Only Proprietary Application ================================ VERSION HISTORY ================================ v1.0.0 (December 2024) - Initial release - Full profit tracking system - Complete cost calculation engine - Reporting and PDF export - Responsive design - Database backup utility ================================ For more information, see README.md