The "Check for Updates" feature has been added to the Admin panel. This feature allows administrators to check for updates from the GitHub repository and install them with a single click.
- Shows current commit SHA (short format)
- Displays current branch
- Shows last update date
- Displays the last commit message
- Connects to GitHub API to check for new commits
- Compares local version with remote repository
- Shows notification if update is available
- Confirms if you're running the latest version
- One-click update installation
- Real-time progress indicator with percentage
- Step-by-step progress messages:
- Fetching latest changes from GitHub
- Saving local changes
- Pulling latest changes
- Checking for dependency updates
- Installing backend dependencies (if needed)
- Installing frontend dependencies (if needed)
- Rebuilding Docker containers (if needed)
- Restarting services
- Shows detailed comparison between current and new versions
- Displays commit information for both versions
- Warning about application restart
- Progress bar during update
- Clear completion message
- Notifies user when update is complete
- Instructs user to perform a hard refresh (SHIFT + Refresh)
- Ensures new frontend assets are loaded
-
Access the Admin Panel
- Log in with an admin account
- Navigate to the Admin page
-
Check for Updates
- Click the "🔍 Check for Updates" button
- Wait for the system to check the GitHub repository
- If an update is available, a modal will appear
- If no update is available, you'll see a success message
-
Install Updates
- Review the update information in the modal
- Click "✅ Install Update" to proceed
- Watch the progress bar as the update installs
- Wait for the "Update completed" message
-
Load New Version
- Hold down the SHIFT key
- Click the browser refresh button (or press CTRL+SHIFT+R / CMD+SHIFT+R)
- This performs a hard refresh and loads the new version
- Auth Required: Yes (Admin only)
- Description: Checks for updates from GitHub
- Response:
{
"updateAvailable": true,
"current": {
"sha": "abc1234",
"message": "Previous commit message",
"date": "2025-10-13T10:00:00Z",
"author": "Developer"
},
"latest": {
"sha": "def5678",
"message": "New commit message",
"date": "2025-10-13T12:00:00Z",
"author": "Developer"
}
}- Auth Required: Yes (Admin only)
- Description: Performs the update
- Response: Server-Sent Events (SSE) stream with progress updates
- Auth Required: Yes (Admin only)
- Description: Gets current version information
- Response:
{
"sha": "abc1234",
"message": "Current commit message",
"date": "2025-10-13T10:00:00Z",
"author": "Developer",
"branch": "main"
}Location: Admin.jsx (Lines 284-321)
- Displays version information
- Check for updates button
- Status messages
Location: Admin.jsx (Lines 664-751)
- Version comparison display
- Progress bar
- Update controls
-
Fetch Changes
- Connects to GitHub and fetches latest commits
- Uses
git fetch origin main
-
Stash Local Changes
- Saves any uncommitted local changes
- Uses
git stash
-
Pull Updates
- Pulls latest changes from GitHub
- Uses
git pull origin main
-
Check for Dependency Updates
- Compares package.json files
- Determines if npm install is needed
-
Install Dependencies
- Runs
npm installin backend if needed - Runs
npm installin frontend if needed
- Runs
-
Rebuild Docker Containers
- Rebuilds containers if dependencies changed
- Uses
docker-compose build
-
Restart Services
- Restarts Docker containers
- Uses
docker-compose restart
- Git must be installed and the repository must be a git clone
- Docker and docker-compose must be available
- The application must be running in Docker containers
- Admin privileges in the application
- Internet connection to access GitHub
- Only admin users can access update features
- Authentication token required for all update endpoints
- Protected routes ensure only authorized access
- Only works with the main branch
- Requires Docker for container management
- May cause brief downtime during restart
- Requires hard refresh after update
- Check internet connection
- Verify Git repository is properly initialized
- Ensure Docker is running
- Check Docker logs:
docker-compose logs - Verify sufficient disk space
- Check for merge conflicts
- Perform a hard refresh (SHIFT + Refresh)
- Clear browser cache
- Check browser console for errors
- Manually restart:
docker-compose restart - Check Docker status:
docker-compose ps - Review logs:
docker-compose logs
backend/src/controllers/updateController.js- Update logicbackend/src/routes/updateRoutes.js- Update routes
backend/src/server.js- Added update routesfrontend/src/services/api.js- Added update API functionsfrontend/src/pages/Admin.jsx- Added update UI
Potential improvements for future versions:
- Support for multiple branches
- Rollback functionality
- Scheduled automatic updates
- Update notifications
- Changelog display
- Backup before update
- Update history log