A modern, full-stack photo portfolio sharing platform that enables photographers to upload, organize, and share their work through secure, expiring share links.
Viewport is a web application designed for photographers to:
- π€ Upload and organize photos into galleries
- π Generate shareable links with customizable expiration dates
- π₯ Share galleries publicly without requiring authentication
- β¬οΈ Allow guests to download individual photos or entire galleries as ZIP files
- π Track views and downloads with built-in metrics
- Runtime: Python 3.13+
- Framework: FastAPI (async, high-performance)
- Database: PostgreSQL with SQLAlchemy ORM
- Migrations: Alembic
- Storage: S3-compatible (AWS S3 / rustfs)
- Queue: Celery with Redis
- Authentication: JWT (Python-JWT)
- API Documentation: OpenAPI/Swagger
- Framework: React 19+ with TypeScript
- Build Tool: Vite
- Routing: React Router v7
- State Management: Zustand
- Styling: Tailwind CSS v4
- HTTP Client: Axios
- Testing: Vitest + React Testing Library
- Containerization: Docker & Docker Compose
- Reverse Proxy: Nginx
- Cache: Redis
- Monitoring: Prometheus (optional)
- Docker & Docker Compose (recommended)
- Or: Python 3.13+, Node.js 18+, PostgreSQL, Redis, rustfs
git clone https://github.com/SamuraJey/viewport.git
cd viewport
docker-compose up -dThe application will be available at:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/docs
Backend:
cd /viewport
python -m venv venv
source venv/bin/activate # or `venv\Scripts\activate` on Windows
pip install -e .
uvicorn viewport.main:app --reloadFrontend:
cd frontend
npm install
npm run devSee Development Setup Guide for detailed instructions.
Complete documentation is organized into the following sections:
π Getting Started
π API Documentation
- API Reference - Complete endpoint documentation
- Authentication
- Error Handling
- Examples & Workflows
π¨ Frontend Guide
βοΈ Backend Guide
π³ Deployment
π§ Development
viewport/
βββ docs/ # Complete project documentation
β βββ api/ # API reference and examples
β βββ backend/ # Backend architecture & guides
β βββ frontend/ # Frontend architecture & guides
β βββ deployment/ # Deployment & infrastructure
β βββ development/ # Development guides
β βββ ARCHITECTURE.md # Overall system architecture
β
βββ src/viewport/ # Backend source code
β βββ api/ # FastAPI route handlers
β β βββ auth.py # Authentication endpoints
β β βββ gallery.py # Gallery management
β β βββ photo.py # Photo upload & management
β β βββ sharelink.py # Share link generation
β β βββ public.py # Public gallery access
β βββ models/ # SQLAlchemy ORM models
β βββ schemas/ # Pydantic request/response schemas
β βββ repositories/ # Data access layer
β βββ alembic/ # Database migrations
β βββ main.py # FastAPI application entry point
β βββ auth_utils.py # JWT & password utilities
β βββ db.py # Database configuration
β βββ rustfs_utils.py # S3/rustfs utilities
β βββ cache_utils.py # Redis caching utilities
β βββ metrics.py # Prometheus metrics
β βββ logger.py # Logging configuration
β
βββ frontend/ # Frontend React application
β βββ src/
β β βββ components/ # Reusable React components
β β βββ pages/ # Page components
β β βββ hooks/ # Custom React hooks
β β βββ stores/ # Zustand state stores
β β βββ services/ # API client services
β β βββ styles/ # Global styles
β β βββ types/ # TypeScript type definitions
β β βββ utils/ # Utility functions
β β βββ App.tsx # Main App component
β β βββ main.tsx # Application entry point
β βββ public/ # Static assets
β βββ package.json # Frontend dependencies
β βββ tsconfig.json # TypeScript configuration
β βββ vite.config.ts # Vite build configuration
β βββ tailwind.config.js # Tailwind CSS configuration
β βββ vitest.config.ts # Vitest testing configuration
β
βββ tests/ # Backend test suite
β βββ unit/ # Unit tests
β βββ integration/ # Integration tests
β βββ fixtures/ # Test fixtures & mocks
β βββ conftest.py # Pytest configuration
β
βββ config/ # Configuration files
βββ scripts/ # Utility scripts
βββ alembic.ini # Alembic configuration
βββ docker-compose.yml # Docker Compose services
βββ Dockerfile.backend # Backend Docker image
βββ Dockerfile.frontend # Frontend Docker image
βββ Makefile # Development commands
βββ pyproject.toml # Python project configuration
- β Secure user authentication with JWT
- β Organize photos into galleries
- β Generate unique share links with optional expiration
- β View analytics (views, downloads)
- β Bulk and individual file downloads
- β View galleries without authentication
- β Responsive gallery grid (desktop/tablet/mobile)
- β Lightbox image viewer
- β Download individual photos or entire galleries
- β Auto-expiring links for time-limited access
- β Well-documented RESTful API
- β Comprehensive test coverage
- β Docker containerization for easy deployment
- β Database migrations with Alembic
- β Type-safe code with TypeScript/Pydantic
The application uses PostgreSQL with the following main entities:
Users
βββ Galleries (one-to-many)
β βββ Photos (one-to-many)
β βββ ShareLinks (one-to-many)
βββ Auth tokens (one-to-many)
See Database Models Documentation for detailed schema.
pytest # Run all tests
pytest -v # Verbose output
pytest --cov=src/viewport # With coverage report
pytest -k "test_upload" # Run specific testsnpm test # Run tests in watch mode
npm run test:run # Run tests once
npm run test:coverage # Generate coverage report
npm run test:ui # Open interactive UISee Testing Guide for details.
docker-compose -f docker-compose.yml up -dSee Production Deployment Guide for:
- Environment configuration
- SSL/TLS setup
- Database backups
- Monitoring & logging
- Performance optimization
- β JWT-based authentication with refresh tokens
- β Password hashing with bcrypt
- β File type validation (magic byte checking)
- β CORS configuration
- β Rate limiting (via Nginx)
- β HTTPS/TLS support
See Security Considerations for details.
We welcome contributions! Please see Contributing Guide for:
- Development workflow
- Code standards
- Testing requirements
- Pull request process
[Add your license here]
- π§ Email: [contact info]
- π Issues: [GitHub Issues Link]
- π‘ Discussions: [GitHub Discussions Link]
- Product Requirements Document - Backend
- Product Requirements Document - Frontend
- Backend Overview
- Development Tasks
Last Updated: November 2025 Current Version: 0.1.0 Status: Active Development