A powerful, automated file organization system built on n8n workflows. This tool helps you organize your files intelligently with a user-friendly web interface.
- π Automated File Organization: Automatically sort files based on type, date, or custom rules
- π Web Interface: User-friendly dashboard to monitor and control file organization
- π n8n Integration: Leverage n8n workflows for powerful automation capabilities
- π οΈ Customizable Rules: Define your own organization rules and filters
- π± Cross-Platform: Works on macOS, Linux, and Windows
- π Secure: API key authentication and local-only deployment for privacy
- Node.js 16+ and npm
- Basic familiarity with terminal/command line
The easiest way to get started is with our setup script:
# Clone the repository
git clone https://github.com/rogu3bear/filesystem-anomaly-detection.git
cd FilesystemAnomalyDetection
# Run the setup script
./n8n-agent-hub/scripts/setup.sh
The setup script will:
- Install dependencies (Node.js, npm, etc.)
- Install n8n globally or locally
- Configure the application with defaults
- Launch the setup interface
If you prefer manual installation:
# Global installation (recommended)
npm install n8n -g
# OR local installation
npm install n8n --global --prefix ~/.npm
export PATH="$HOME/.npm/bin:$PATH"
cd FilesystemAnomalyDetection/n8n-agent-hub/backend
npm install
npm run build
cd ../frontend
npm install
npm run build
Create configuration file:
mkdir -p ~/.config/file_anomaly_detection
API_KEY=$(openssl rand -hex 24)
cat > ~/.config/file_anomaly_detection/config.json << EOL
{
"source_directory": "$HOME/Downloads",
"target_directory": "$HOME/Organized",
"organize_by": "extension",
"scan_interval": 300,
"api_key": "${API_KEY}",
"created_at": "$(date -u +"%Y-%m-%dT%H:%M:%SZ")",
"version": "1.0"
}
EOL
# Create target directories
mkdir -p ~/Organized/{Documents,Images,Videos,Audio,Archives,Applications,Other}
# Start n8n
n8n start &
# Start the application server
cd FilesystemAnomalyDetection/n8n-agent-hub/backend
npm run setup-server
You can also run the entire system using Docker:
cd FilesystemAnomalyDetection
docker-compose up -d
This will start n8n, the backend, and the frontend in separate containers.
After installation, access the web interface at:
- Setup interface: http://localhost:3000/setup
- Main dashboard: http://localhost:3000
- n8n interface: http://localhost:5678
The main configuration file is located at:
~/.config/file_anomaly_detection/config.json
Key configuration options:
Option | Description |
---|---|
source_directory |
Directory to monitor for files |
target_directory |
Directory where files are organized |
organize_by |
Organization method (extension , date , type , or size ) |
scan_interval |
How often to scan for new files (in seconds) |
api_key |
API key for secure access |
The system uses n8n workflows to process files. You can view and modify these workflows in the n8n interface at http://localhost:5678.
Default workflows:
- File Organization: Automatically organizes files by type
- Cleanup: Removes empty directories and temporary files
- Notification: Sends notifications when files are processed
You can modify the organization rules by editing the workflow in n8n:
- Open http://localhost:5678
- Go to the "File Organization" workflow
- Modify the "Switch" node to change the file classification rules
To add custom file type recognition:
- Edit the n8n workflow
- Add new file extensions to the appropriate categories
- Save and activate the workflow
You can customize when and how files are organized:
- In n8n, modify the "Timer" node in the workflow
- Change the execution schedule
- Save and activate the workflow
To contribute to development:
# Clone the repository
git clone https://github.com/rogu3bear/FilesystemAnomalyDetection.git
cd FilesystemAnomalyDetection
# Install dependencies
cd n8n-agent-hub/backend
npm install
npm run dev
# In another terminal
cd n8n-agent-hub/frontend
npm install
npm start
n8n-agent-hub/backend
: Express.js backend servern8n-agent-hub/frontend
: React frontend applicationn8n-agent-hub/scripts
: Helper scripts for installation and setupscripts
: System-level scripts for various platforms
# Check if n8n is in your PATH
which n8n
# Try starting manually
n8n start
# Check logs
cat ~/.n8n/logs/n8n.log
# Check if backend is running
curl http://localhost:3000/api/setup/status
# Check configuration file
cat ~/.config/file_anomaly_detection/config.json
Ensure your source and target directories have proper permissions:
chmod 755 ~/Downloads
chmod 755 ~/Organized
If you encounter issues:
- Check the logs at
~/.n8n/logs/n8n.log
- Open an issue on GitHub
- Check the troubleshooting section in documentation
This project is licensed under the MIT License - see the LICENSE file for details.
- n8n for the excellent workflow automation platform
- Contributors and maintainers of this project
Note: This is a personal project and is not affiliated with n8n GmbH.