Self-hosted Google Drive and Google Photos alternative built from scratch with Python, HTML, PySide6, and Kotlin.
- File Storage: Google Drive alternative with folder navigation, file upload/download, and user quotas
- Photo Management: Google Photos alternative with AI face recognition and smart albums
- Multi-Platform: Web interface, Windows/Linux desktop client, and Android app
- User Management: Per-user storage quotas and authentication
- AI Features: Face detection, person identification, and photo search by person
- Backend: Python FastAPI server with SQLite database
- Web: HTML/CSS/JavaScript single-page application
- Desktop: PySide6 Qt application for Windows/Linux
- Mobile: Kotlin Android app with Material Design
- AI: Face recognition using face-recognition library
- Install Python 3.9+
- Install dependencies:
pip install -r requirements.txt- Run the server:
python -m backend.mainServer will start on http://localhost:8000
Default admin credentials:
- Username:
admin - Password:
admin123
Important: Change the default admin password after first login!
Access at: http://localhost:8000
- Install Python 3.9+
- Install dependencies:
cd desktop
pip install -r requirements.txt- Run the client:
python client.py- Open the
androiddirectory in Android Studio - Update the server IP in
ApiClient.kt(line 23) - Build and run on your device or emulator
Edit backend/config.py or set environment variables to customize:
HOST: Server host (default: 0.0.0.0)PORT: Server port (default: 8000)STORAGE_DIR: Base storage directoryDEFAULT_USER_QUOTA: Default storage quota per user (default: 100GB, set viaDEFAULT_USER_QUOTAenv var)MAX_PHOTO_SIZE: Maximum photo upload size (default: 50MB)SECRET_KEY: JWT signing key (change this in production!)
Note: The quota is a soft limit per user, not a requirement for physical storage. The system will work with any amount of available disk space - it just prevents users from storing more than their allocated quota.
storage/
├── files/ # User files
├── photos/ # Original photos
├── thumbnails/ # Photo thumbnails
data/
└── database.db # SQLite database
- Login: Use admin credentials or register a new account
- Files: Upload files, create folders, navigate directories
- Photos: Upload photos, view gallery, AI face recognition
- Quota: View storage usage in sidebar
- Login: Enter server URL and credentials
- Files Tab: Upload files, create folders, navigate directories
- Photos Tab: Upload photos, view gallery
- Storage: View quota information in toolbar
- Login: Enter username and password
- Files Tab: Upload files, create folders, navigate directories
- Photos Tab: Upload photos, view gallery
- Storage: View quota information
Photos are automatically processed for face detection when uploaded. To identify people:
- Create a person via API:
POST /api/peoplewithnameparameter - Train the person:
POST /api/people/{person_id}/trainwith training photos - Search photos by person:
GET /api/people/{person_id}/photos
Use curl or similar:
# Create person
curl -X POST http://localhost:8000/api/people \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "name=John Doe"
# Train with photos
curl -X POST http://localhost:8000/api/people/1/train \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "photos=@photo1.jpg" \
-F "photos=@photo2.jpg"
# Search photos
curl http://localhost:8000/api/people/1/photos \
-H "Authorization: Bearer YOUR_TOKEN"Register
POST /api/auth/register
Content-Type: application/json
{
"username": "user",
"email": "user@example.com",
"password": "password"
}
Login
POST /api/auth/login
Content-Type: application/json
{
"username": "user",
"password": "password"
}
Response:
{
"access_token": "token",
"token_type": "bearer"
}
List Files
GET /api/files?parent_id=123
Authorization: Bearer token
Upload File
POST /api/files
Authorization: Bearer token
Content-Type: multipart/form-data
file: <file>
parent_id: 123 (optional)
Create Folder
POST /api/files/directory
Authorization: Bearer token
Content-Type: application/json
{
"filename": "folder_name",
"parent_id": 123,
"is_directory": true
}
Download File
GET /api/files/{file_id}/download
Authorization: Bearer token
Delete File
DELETE /api/files/{file_id}
Authorization: Bearer token
List Photos
GET /api/photos?limit=100&offset=0
Authorization: Bearer token
Upload Photo
POST /api/photos
Authorization: Bearer token
Content-Type: multipart/form-data
file: <image file>
Get Photo
GET /api/photos/{photo_id}
Authorization: Bearer token
Get Thumbnail
GET /api/photos/{photo_id}/thumbnail
Authorization: Bearer token
Create Person
POST /api/people
Authorization: Bearer token
Content-Type: multipart/form-data
name: "Person Name"
List People
GET /api/people
Authorization: Bearer token
Train Person
POST /api/people/{person_id}/train
Authorization: Bearer token
Content-Type: multipart/form-data
photos: <training photos>
Get Photos by Person
GET /api/people/{person_id}/photos
Authorization: Bearer token
- Change default passwords: Update admin password immediately
- Use strong SECRET_KEY: Generate a random key for JWT signing
- Enable HTTPS: Use reverse proxy (nginx) with SSL for production
- Network isolation: Keep server on local network initially
- Regular backups: Backup
storage/anddata/database.dbregularly - Firewall: Configure Windows Firewall to restrict access
# Stop server
# Backup storage and database
robocopy "C:\path\to\storage" "Z:\backup\storage" /E
robocopy "C:\path\to\data" "Z:\backup\data" /E
# Restart server# SQLite backup
copy data\database.db backup\database.db- Check Python version (3.9+ required)
- Verify all dependencies installed:
pip install -r requirements.txt - Check port 8000 is not in use
- Check Windows Firewall allows port 8000
- Verify server IP address
- Ensure both devices on same network
- Install dlib:
pip install dlib(may require CMake and Visual Studio) - For Windows, precompiled binaries may be needed
- Face recognition is optional - server works without it
- Verify server is running
- Check server URL in client
- Ensure network connectivity
- Update server IP in
ApiClient.kt - For emulator, use
10.0.2.2(localhost mapping) - For real device, use computer's local IP
- Ensure device and server on same network
- Cloudflare Tunnel integration for remote access
- End-to-end encryption
- Video support
- Advanced AI features (object detection, scene recognition)
- Sharing and collaboration features
- Mobile app background sync
- WebDAV support
- Calendar and contacts (Nextcloud-style)
MIT License - Feel free to use and modify for your personal use.
For issues and questions, check the troubleshooting section or review the API documentation.