Skip to content

gerulla/photosorter

Repository files navigation

Photo Sorter

A Laravel-based web application for organizing and managing your image collections. Upload, categorize, and archive your photos with an intuitive folder-based system.

Features

  • Folder Management: Create and organize unlimited folders for your images
  • Image Upload: Upload multiple images (up to 1GB each) with preview functionality
  • Image Gallery: View all images in a responsive grid layout
  • Archive Creation: Select multiple folders and download them as a ZIP archive
  • Image Deletion: Remove individual images or entire folders
  • User Authentication: Secure user accounts with Laravel Fortify
  • Dark Mode: Built-in dark mode support
  • Mobile Responsive: Fully responsive design that works on all devices

Requirements

  • PHP 8.1 or higher
  • Composer
  • MySQL/MariaDB or PostgreSQL
  • Node.js & NPM (for frontend assets)
  • ZipArchive PHP extension (usually enabled by default)

Installation & Deployment

1. Clone the Repository

git clone <repository-url>
cd photosorter

2. Install Dependencies

# Install PHP dependencies
composer install

# Install Node dependencies
npm install

3. Environment Configuration

# Copy the example environment file
cp .env.example .env

# Generate application key
php artisan key:generate

Edit the .env file and configure your database connection:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=photosorter
DB_USERNAME=your_username
DB_PASSWORD=your_password

4. Database Setup

# Run migrations to create database tables
php artisan migrate

# (Optional) Seed the database with sample data
php artisan db:seed

The seeder will create:

  • Admin user with email: admin@example.com and password: 123456789
  • 10 sample folders

5. Storage Configuration

# Create symbolic link for public storage
php artisan storage:link

6. PHP Configuration

For large image uploads (up to 1GB), update your php.ini:

upload_max_filesize = 1024M
post_max_size = 1024M
max_execution_time = 300
memory_limit = 512M

7. Build Frontend Assets

# Development
npm run dev

# Production
npm run build

8. Start the Application

For Development:

php artisan serve

Visit http://localhost:8000

For Production:

Configure your web server (Apache/Nginx) to point to the public directory.

Example Nginx configuration:

server {
    listen 80;
    server_name your-domain.com;
    root /path/to/photosorter/public;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-Content-Type-Options "nosniff";

    index index.php;

    charset utf-8;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    error_page 404 /index.php;

    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ /\.(?!well-known).* {
        deny all;
    }
}

9. Set Permissions (Linux/Mac)

chmod -R 755 storage bootstrap/cache
chown -R www-data:www-data storage bootstrap/cache

Usage

Creating an Account

  1. Visit the application URL
  2. Click "Register" to create a new account
  3. Fill in your name, email, and password
  4. Log in with your credentials

Managing Folders

  • Click "New Folder" in the sidebar to create a folder
  • Click on a folder name to view its contents
  • Delete folders from the dashboard table

Uploading Images

  1. Navigate to a folder
  2. Click "Upload Images"
  3. Select one or multiple images
  4. Preview your selections
  5. Click "Upload" to save

Creating Archives

  1. Go to the Dashboard
  2. Click "Make Archive"
  3. Select the folders you want to include
  4. Click "Download Archive"
  5. A ZIP file containing all selected folders and images will be downloaded

Deleting Images

  • Click the trash icon on any image card
  • Confirm the deletion in the modal

Tech Stack

  • Backend: Laravel 11
  • Frontend: Livewire 3, Flux UI Components
  • Styling: Tailwind CSS
  • Authentication: Laravel Fortify with 2FA support
  • Database: MySQL/PostgreSQL

Project Structure

app/
├── Http/Controllers/
│   └── FolderController.php    # Handles folder and image operations
├── Models/
│   ├── User.php                # User model with folder relationship
│   ├── Folder.php              # Folder model with images relationship
│   └── Image.php               # Image model
database/
├── migrations/                 # Database structure
├── factories/                  # Model factories for testing
└── seeders/                    # Database seeders
resources/
├── views/
│   ├── dashboard.blade.php     # Dashboard with folder table
│   ├── folders/
│   │   └── show.blade.php      # Folder detail view
│   └── layouts/
│       └── app/
│           └── sidebar.blade.php # Main layout with sidebar
routes/
└── web.php                     # Application routes

License

This project is open-sourced software licensed under the MIT license.

Support

For issues, questions, or contributions, please open an issue in the repository.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages