diff --git a/backend/app/routers/photos.py b/backend/app/routers/photos.py
index 282538d..2e54427 100644
--- a/backend/app/routers/photos.py
+++ b/backend/app/routers/photos.py
@@ -352,6 +352,74 @@ async def list_photos_with_gps(
]
+@router.get("/memories")
+async def get_memories(
+ db: AsyncSession = Depends(get_db),
+ current_user: User = Depends(get_current_user),
+):
+ """'On this day' — photos taken on this date in previous years.
+
+ Returns groups keyed by year, each with up to 12 photos. Only
+ considers non-discarded, non-hidden photos with an EXIF-sourced
+ taken_at (no filesystem-guessed dates to avoid false matches).
+ """
+ from sqlalchemy import extract
+
+ today = datetime.now().date()
+
+ result = await db.execute(
+ select(
+ Photo.id,
+ Photo.filename,
+ Photo.taken_at,
+ Photo.thumb_small,
+ Photo.thumb_medium,
+ Photo.media_type,
+ Photo.width,
+ Photo.height,
+ Photo.rating,
+ )
+ .where(
+ Photo.user_id == current_user.id,
+ Photo.is_discarded.is_(False),
+ Photo.is_hidden.is_(False),
+ Photo.taken_at.is_not(None),
+ Photo.taken_at_source == "exif",
+ extract("month", Photo.taken_at) == today.month,
+ extract("day", Photo.taken_at) == today.day,
+ extract("year", Photo.taken_at) < today.year,
+ )
+ .order_by(Photo.taken_at.desc())
+ )
+ rows = result.all()
+
+ # Group by year
+ years: dict[int, list] = {}
+ for row in rows:
+ year = row.taken_at.year
+ group = years.setdefault(year, [])
+ if len(group) >= 12:
+ continue
+ group.append({
+ "id": row.id,
+ "filename": row.filename,
+ "taken_at": row.taken_at.isoformat(),
+ "thumb_small": row.thumb_small,
+ "thumb_medium": row.thumb_medium,
+ "media_type": row.media_type,
+ "width": row.width,
+ "height": row.height,
+ "rating": row.rating,
+ })
+
+ memories = [
+ {"year": year, "years_ago": today.year - year, "photos": photos}
+ for year, photos in sorted(years.items())
+ ]
+
+ return {"date": today.isoformat(), "memories": memories}
+
+
@router.get("/{photo_id}")
async def get_photo(
photo_id: str,
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx
index 58bb4cd..646cd66 100644
--- a/frontend/src/App.tsx
+++ b/frontend/src/App.tsx
@@ -2,6 +2,7 @@ import { useState } from 'react'
import { Timeline } from './components/timeline/Timeline'
import { DuplicatesView } from './components/duplicates/DuplicatesView'
import { MapView } from './components/map/MapView'
+import { MemoriesView } from './components/memories/MemoriesView'
import { PeopleView } from './components/people/PeopleView'
import { TagsView } from './components/tags/TagsView'
import { ColorsView } from './components/colors/ColorsView'
@@ -87,6 +88,8 @@ function MainApp() {
No memories for today
+Photos taken on this date in previous years will appear here.
+{photo.filename}
+