A sophisticated image management and memory preservation application that combines FastAPI backend with React frontend, featuring AI-powered image analysis, tagging, and search capabilities by taking data from a snapchat spectacle.
This application allows users to:
- Upload and manage image collections
- Automatically generate AI-powered tags and descriptions for images
- Search images using natural language queries with AI-powered semantic search
- View image locations on interactive maps
- Transcribe audio recordings for memory context
- Generate embeddings for semantic image search
- Framework: FastAPI with async/await support
- Database: SQLite with SQLAlchemy ORM (async)
- AI Services: Google Gemini API for image analysis and transcription
- Image Processing: PIL for image handling
- Audio Processing: SoundDevice for recording, Gemini for transcription
- Framework: React 18 with TypeScript
- Build Tool: Vite
- Styling: Tailwind CSS with Radix UI components
- Maps: Leaflet for interactive map display
- State Management: React hooks (useState, useEffect, useMemo)
HTN-2025/
βββ backend/ # FastAPI backend application
β βββ app/
β β βββ models/ # Pydantic models for API
β β βββ repository/ # Database access layer
β β βββ routers/ # API route handlers
β β βββ utils/ # Utility functions
β β βββ config.py # Configuration and Supabase setup
β βββ database/ # Database models and connection
β βββ images/ # Static image storage
β βββ main.py # FastAPI application entry point
βββ frontend/ # React frontend application
β βββ src/
β β βββ components/ # React components
β β βββ hooks/ # Custom React hooks
β β βββ lib/ # Type definitions and utilities
β β βββ utils/ # API utilities and mock data
β βββ package.json # Frontend dependencies
βββ README.md # This file
- Python 3.11+
- Node.js 18+
- Google API Key (for Gemini AI services)
- Supabase account (optional, for cloud storage)
-
Navigate to backend directory:
cd backend -
Install dependencies:
uv sync
-
Activate virtual environment:
- Windows:
.venv/scripts/activate.ps1 - macOS/Linux:
.venv/bin/activate
- Windows:
-
Set up environment variables: Create a
.envfile in the root directory:GOOGLE_API_KEY=your_google_api_key_here SUPABASE_URL=your_supabase_url SUPABASE_KEY=your_supabase_key
-
Run the development server:
uv run fastapi dev
The backend will be available at http://localhost:8000
-
Navigate to frontend directory:
cd frontend -
Install dependencies:
npm install
-
Start development server:
npm run dev
The frontend will be available at http://localhost:3000
POST /api/images/- Create new image recordGET /api/images/- Get all images (with pagination and filtering)GET /api/images/{image_id}- Get specific image by IDPUT /api/images/{image_id}- Update image metadataDELETE /api/images/{image_id}- Delete image record
GET /api/images/search/by-tags- Search images by tagsGET /api/images/images_by_audio- Search images using audio description
GET /api/images/stats/counts- Get image statistics (total, tagged, untagged)GET /api/images/stats/locations- Get image location data for mapping
- Automatic Tagging: Uses Google Gemini to generate descriptive tags
- Object Detection: Identifies objects and their locations in images
- Scene Classification: Categorizes images by scene type (indoor, outdoor, etc.)
- Color Analysis: Extracts dominant colors from images
- Description Generation: Creates natural language descriptions
- Voice Recording: 3-second audio recording capability
- Speech Transcription: Converts audio to text using Gemini
- Audio Search: Search images using spoken descriptions
- Multi-modal Embeddings: Generate embeddings for images and text
- Semantic Search: Find similar images based on content understanding
- Vector Storage: Store embeddings for fast similarity searches
- MemoryGallery: Main application container
- MemoryGrid: Grid layout for image display
- MemoryCard: Individual image card with metadata
- MemorySearch: Search interface with filtering
- Map: Interactive map showing image locations
- useMemories: Manages image data fetching and state
- useMemorySearch: Handles search functionality and filtering
GOOGLE_API_KEY: Required for Gemini AI servicesSUPABASE_URL: Optional cloud storage URLSUPABASE_KEY: Optional cloud storage API key
The backend is configured to accept requests from http://localhost:3000 for development.
This project was created for HTN 2025. Please refer to the hackathon guidelines for usage rights.