A web-based local network application to display images in a smooth tile format with embedded face recognition capabilities to search and group images by people.
- Gallery View: Smooth masonry grid layout.
- Face Recognition: Automatically detects and groups faces.
- People Search: Filter images by recognized persons.
- Local Network Access: accessible from any device on the home network.
- Backend: Python, FastAPI, PostgreSQL, SQLModel, Face Recognition (
dlib). - Frontend: React, Vite, Styled Components (CSS Modules/Variables).
- Tools:
uv(Python Package Manager),npm.
- Python 3.10+
- Node.js 18+
- PostgreSQL
- C++ Build Tools (for compiling
dlibon Windows/Linux)
git clone <repository-url>
cd <repository-folder>We use uv for fast python package management.
-
Install uv (if not installed):
pip install uv # or curl -LsSf https://astral.sh/uv/install.sh | sh
-
Create Virtual Environment & Install Dependencies:
cd backend uv venv uv pip install -r requirements.txt -
Database Configuration:
- Ensure PostgreSQL is running and you have created a database (e.g.,
photoviewer). - Copy
.env.exampleto.env:cp ../.env.example ../.env
- Edit
.envwith your PostgreSQL credentials:POSTGRES_USER=postgres POSTGRES_PASSWORD=password POSTGRES_SERVER=localhost POSTGRES_PORT=5432 POSTGRES_DB=photoviewer
- Ensure PostgreSQL is running and you have created a database (e.g.,
-
Run the Backend:
# Windows .venv\Scripts\activate uvicorn main:app --reload
-
Install Dependencies:
cd frontend npm install
-
Run Development Server:
npm run dev
- Open
http://localhost:5173to view the app. - To scan images:
- Ensure
PHOTOS_DIRis set in.env. - Trigger the scan via API (you can use
curlor a browser):curl -X POST http://localhost:8000/scan
- Ensure
- dlib installation fails: Ensure you have CMake and C++ build tools installed.