Skip to content

rohitarodi/pyNas

Repository files navigation

PyNAS Photo Server

A personal NAS (Network Attached Storage) solution for photo management with automatic metadata extraction, face detection, and web-based interface.

Features

  • 📤 Photo Upload: Drag & drop or click to upload multiple photos
  • 📊 Metadata Extraction: Automatic EXIF data extraction (date, location, camera info)
  • 👤 Face Detection: AI-powered face detection using OpenCV
  • 📱 Mobile Friendly: Responsive web interface that works on phones and tablets
  • 🗂️ Organization: View photos with detailed metadata
  • 🖼️ Thumbnails: Automatic thumbnail generation for fast browsing
  • 📍 GPS Support: Location data extraction and Google Maps integration

Quick Start

Prerequisites

  • Python 3.8+
  • Node.js 16+

Backend Setup

  1. Install Python dependencies:
pip install -r requirements.txt
  1. Run the FastAPI server:
python main.py

The API server will be available at http://localhost:8000

Frontend Setup

  1. Navigate to the frontend directory:
cd frontend
  1. Install dependencies:
npm install
  1. Start the development server:
npm run dev

The frontend will be available at http://localhost:3000

Production Build

To build the frontend for production:

cd frontend
npm run build

API Endpoints

  • POST /upload - Upload photos (supports multiple files)
  • GET /photos - Get list of photos with pagination
  • GET /photo/{photo_id} - Get detailed photo information
  • GET /uploads/photos/{filename} - Access full-size photos
  • GET /uploads/thumbnails/{filename} - Access photo thumbnails

Project Structure

pyNas/
├── main.py              # FastAPI application
├── models.py            # Database models
├── photo_service.py     # Photo processing service
├── requirements.txt     # Python dependencies
├── uploads/            # Photo storage directory
│   ├── photos/         # Full-size photos
│   └── thumbnails/     # Generated thumbnails
└── frontend/           # React frontend
    ├── src/
    │   ├── components/ # React components
    │   ├── App.jsx     # Main app component
    │   └── main.jsx    # Entry point
    ├── package.json
    └── vite.config.js

Technology Stack

Backend:

  • FastAPI (Python web framework)
  • SQLAlchemy (Database ORM)
  • Pillow (Image processing)
  • OpenCV (Face detection)
  • ExifRead (Metadata extraction)

Frontend:

  • React 18
  • Vite (Build tool)
  • React Dropzone (File upload)
  • CSS3 with responsive design

Configuration

The application uses SQLite by default for simplicity. You can modify models.py to use PostgreSQL or other databases for production use.

Mobile Access

The web interface is fully responsive and optimized for mobile devices. You can access your NAS from your phone by navigating to your server's IP address.

Future Enhancements

  • Photo organization by date/location
  • Album creation
  • Photo search functionality
  • User authentication
  • Backup and sync features
  • Advanced face recognition
  • Memory/moment recommendations"# pyNas"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors