Skip to content

chetanupare/priva_shots

Repository files navigation

PrivaShots πŸ“Έ

PrivaShots Logo

Your Private, Secure Photo Server

PHP Version MySQL License Contributions Welcome

A modern, self-hosted photo server with Google Photos-like experience


πŸ“¦ Version

Current Version: v1.0.0

Release Date: January 2025

Latest Features:

  • Complete photo server with modern UI
  • JWT authentication and secure file handling
  • Timeline view with floating navigation
  • Album management and analytics
  • EXIF data extraction and search
  • Responsive design with glass morphism
  • Database backup included for easy setup

✨ Features

🎯 Core Features

  • πŸ” Secure Authentication - JWT-based authentication with password hashing
  • πŸ“€ Smart Media Upload - Support for 50+ image/video formats including RAW files
  • πŸ“… Timeline View - Browse photos by date with floating year navigation
  • πŸ“ Album Management - Create, organize, and manage photo albums
  • πŸ“Š Analytics Dashboard - Storage usage, upload trends, and media statistics
  • πŸ“± Responsive Design - Modern UI that works perfectly on all devices
  • πŸ” Advanced Search - Find photos by date, type, camera, or EXIF data
  • πŸ’Ύ EXIF Data Extraction - Camera info, GPS coordinates, shooting parameters

πŸš€ Advanced Features

  • πŸ”„ Duplicate Detection - Prevents uploading duplicate photos
  • ⚑ WebP Optimization - Automatic WebP conversion for better performance
  • πŸ“₯ Secure Downloads - Protected file downloads with authentication
  • πŸ’Ώ Storage Management - Per-user storage limits and usage tracking
  • πŸ“ Activity Logging - Track user actions and system events
  • 🎨 Modern UI - Glass morphism design with smooth animations
  • βš™οΈ Auto-Organization - Automatic date-based folder structure

πŸ› οΈ Technology Stack

  • Backend: PHP 7.4+, MySQL 5.7+
  • Frontend: Vanilla JavaScript, Tailwind CSS, Alpine.js
  • Authentication: JWT (JSON Web Tokens)
  • Image Processing: GD Library, EXIF extraction
  • UI/UX: Modern responsive design with glass morphism

πŸš€ Quick Start

Prerequisites

  • PHP 7.4+ with extensions: mysqli, gd, exif, zip
  • MySQL 5.7+ or MariaDB 10.2+
  • Web server (Apache/Nginx)
  • At least 1GB RAM and 10GB storage

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/privashots.git
    cd privashots
  2. Set up the database

    CREATE DATABASE cloudphoto_db;
    CREATE USER 'cloudphoto_user'@'localhost' IDENTIFIED BY 'your_secure_password';
    GRANT ALL PRIVILEGES ON cloudphoto_db.* TO 'cloudphoto_user'@'localhost';
    FLUSH PRIVILEGES;
  3. Configure the application

    cp config/database.php config/database.php.backup
    nano config/database.php

    Update the configuration:

    define('DB_HOST', 'localhost');
    define('DB_NAME', 'cloudphoto_db');
    define('DB_USER', 'cloudphoto_user');
    define('DB_PASS', 'your_secure_password');
    define('JWT_SECRET', 'your_very_long_random_secret_key');
    define('BASE_URL', 'https://your-domain.com/Cloudphoto');
  4. Run the setup script

    php setup.php

    Alternative: Use the provided database backup

    # Import the pre-configured database
    mysql -u cloudphoto_user -p cloudphoto_db < setup/cloudphoto_db.sql
  5. Set proper permissions

    chmod 755 media/
    chmod 644 config/database.php
    mkdir -p logs && chmod 755 logs/
  6. Access the application

    • Navigate to http://your-domain.com/Cloudphoto
    • Default login: admin@cloudphoto.local / admin123
    • ⚠️ Important: Change the default password immediately!

πŸ“ Project Structure

Cloudphoto/
β”œβ”€β”€ πŸ“ api/                    # API endpoints
β”‚   β”œβ”€β”€ index.php             # API entry point
β”‚   └── router.php            # Request routing
β”œβ”€β”€ πŸ“ assets/                # Static assets
β”‚   β”œβ”€β”€ css/                  # Stylesheets
β”‚   β”œβ”€β”€ js/                   # JavaScript files
β”‚   └── images/               # Images and icons
β”œβ”€β”€ πŸ“ classes/               # PHP classes
β”‚   β”œβ”€β”€ Auth.php              # Authentication
β”‚   β”œβ”€β”€ MediaManager.php      # Media handling
β”‚   β”œβ”€β”€ AlbumManager.php      # Album management
β”‚   β”œβ”€β”€ ExifManager.php       # EXIF data extraction
β”‚   β”œβ”€β”€ ImageProcessor.php    # Image processing
β”‚   └── TimelineManager.php   # Timeline management
β”œβ”€β”€ πŸ“ config/                # Configuration files
β”‚   β”œβ”€β”€ database.php          # Database and app config
β”‚   └── production.php        # Production settings
β”œβ”€β”€ πŸ“ media/                 # Uploaded media files
β”œβ”€β”€ πŸ“ setup/                 # Setup scripts
β”‚   └── cloudphoto_db.sql     # Database backup with sample data
β”œβ”€β”€ dashboard.php             # Main dashboard
β”œβ”€β”€ timeline.php              # Timeline view
β”œβ”€β”€ albums.php                # Albums management
β”œβ”€β”€ analytics.php             # Analytics dashboard
β”œβ”€β”€ login.php                 # Login page
└── README.md                 # This file

πŸ”Œ API Endpoints

Authentication

  • POST /api/router.php?action=login - User login
  • POST /api/router.php?action=register - User registration

Media Management

  • POST /api/router.php?action=upload-media - Upload media
  • POST /api/router.php?action=getMedia - Get media list
  • POST /api/router.php?action=getRecentPhotos - Get recent photos
  • POST /api/router.php?action=delete-media - Delete media

Albums

  • POST /api/router.php?action=create-album - Create album
  • POST /api/router.php?action=list-albums - List albums
  • POST /api/router.php?action=add-to-album - Add media to album
  • POST /api/router.php?action=remove-from-album - Remove media from album

Analytics

  • POST /api/router.php?action=getDashboardStats - Get dashboard stats
  • POST /api/router.php?action=exif-data - Get EXIF data

🎯 Roadmap & Feature Requests

🚧 Planned Features

  • πŸ”— Sharing & Collaboration - Share albums with other users
  • πŸ“± Mobile App - Native iOS/Android applications
  • ☁️ Cloud Sync - Sync with Google Drive, Dropbox, etc.
  • πŸ€– AI Features - Face recognition, object detection
  • 🎨 Photo Editing - Basic editing tools (crop, filter, adjust)
  • πŸ“Ή Video Processing - Video thumbnails and metadata
  • 🌐 Multi-language - Internationalization support
  • πŸ“Š Advanced Analytics - Usage patterns and insights
  • πŸ”’ End-to-End Encryption - Client-side encryption
  • πŸ“± Progressive Web App - Offline functionality

πŸ’‘ Feature Requests

We welcome feature requests! Please:

  1. Check existing Issues first
  2. Create a new issue with the enhancement label
  3. Describe the feature and its use case
  4. Add screenshots/mockups if applicable

🀝 Contributing

We love contributions! Here's how you can help:

πŸ› Bug Reports

  1. Check existing Issues first
  2. Create a new issue with the bug label
  3. Include steps to reproduce, expected vs actual behavior
  4. Add screenshots if applicable

πŸ’» Code Contributions

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ Development Guidelines

  • Follow PSR-12 coding standards for PHP
  • Use meaningful commit messages
  • Add comments for complex logic
  • Test your changes thoroughly
  • Update documentation if needed

🎨 UI/UX Contributions

  • Follow the existing design system
  • Ensure responsive design
  • Test on different devices
  • Maintain accessibility standards

πŸ”§ Configuration

Production Settings

For production deployment, use the production configuration:

cp config/production.php config/database.php

Key production settings:

  • Strong JWT secret (minimum 32 characters)
  • Secure database credentials
  • Your domain URL
  • Error logging enabled
  • Security headers configured

Security Best Practices

  1. πŸ” Change default credentials immediately after installation
  2. πŸ”’ Use HTTPS with valid SSL certificates
  3. πŸ“ Set proper file permissions (755 for directories, 644 for files)
  4. πŸ›‘οΈ Configure firewall to allow only necessary ports
  5. πŸ’Ύ Regular backups of database and media files
  6. πŸ“Š Monitor logs for suspicious activity

Performance Optimization

  1. ⚑ Enable OPcache for PHP
  2. πŸ—„οΈ Optimize MySQL configuration
  3. 🌐 Use CDN for static assets
  4. πŸ—œοΈ Enable gzip compression
  5. πŸ’Ύ Set up caching headers for images

πŸ“Š Monitoring & Maintenance

Regular Tasks

  • πŸ’Ύ Database backups (daily)
  • πŸ“ Media file backups (weekly)
  • πŸ“ Log rotation (weekly)
  • πŸ”’ Security updates (monthly)
  • πŸ“ˆ Performance monitoring (ongoing)

Troubleshooting

Common Issues:

  1. πŸ“€ Upload fails: Check file permissions and PHP upload limits
  2. πŸ–ΌοΈ Images not displaying: Verify file paths and database entries
  3. πŸ” Authentication errors: Check JWT secret and token expiration
  4. ⚑ Performance issues: Enable caching and optimize database queries

Logs to check:

  • /logs/error.log - PHP errors
  • /logs/access.log - API access logs
  • /logs/upload.log - Upload activity

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support

πŸ™ Acknowledgments

  • Icons: Font Awesome
  • CSS Framework: Tailwind CSS
  • JavaScript Framework: Alpine.js
  • Design Inspiration: Google Photos, Apple Photos

πŸ“ˆ Project Stats

GitHub stars GitHub forks GitHub issues GitHub pull requests GitHub contributors


**Made with ❀️ by the PrivaShots Community**

⭐ Star this repo | πŸ› Report a bug | πŸ’‘ Request a feature

About

Your Private, Secure Photo Server

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors