Skip to content

nthnfng/dear-diary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dear Diary - Memory Keeper

A beautiful, interactive digital diary application for preserving memories of important people in your life.

Features

  • Memory Pages: Create and manage pages for each important person in your life
  • Editable Content: Click any field to edit names, relationships, birthdays, ages, and memories
  • Image Upload: Upload photos for each person (supports JPEG, PNG, GIF, WebP up to 5MB)
  • Face Recognition: Automatic face detection and recognition using uploaded images
  • Memory Categories:
    • Important Info: Key facts about the person
    • Core Memories: Significant shared experiences
    • Recent Memories: Latest interactions and updates
  • Beautiful UI: Vintage diary aesthetic with smooth page-turning animations
  • Data Persistence: All data is stored securely in Supabase

Image Upload Feature

The application includes a robust image upload system:

How to Upload Images:

  1. Navigate to any person's page (must be saved first)
  2. Click the "📷 Upload Photo" button below their image
  3. Select an image file from your device
  4. The image will be automatically uploaded and displayed

Supported Formats:

  • JPEG (.jpg, .jpeg)
  • PNG (.png)
  • GIF (.gif)
  • WebP (.webp)

File Size Limit:

  • Maximum 5MB per image

Technical Details:

  • Images are stored in Supabase Storage
  • Each person's image is named using their sanitized name
  • Images are served via secure URLs
  • Automatic validation ensures only image files are accepted

Face Recognition Feature

The application includes advanced face recognition capabilities:

How Face Recognition Works:

  1. Image Storage: All uploaded images are stored in Supabase Storage
  2. Face Encoding: When images are uploaded, faces are automatically detected and encoded
  3. Real-time Recognition: The camera can recognize faces in real-time using the stored encodings
  4. Automatic Updates: Face recognition cache is automatically updated when new images are uploaded

Face Recognition Endpoints:

  • GET /api/faces/status - Check current face recognition status
  • POST /api/faces/reload - Manually reload faces from storage
  • GET /api/faces/images - List all images in storage
  • POST /api/faces/clear-cache - Clear and rebuild face recognition cache

Testing Face Recognition:

Run the test script to verify Supabase integration:

cd server
python test_supabase_faces.py

Setup

Prerequisites

  • Node.js (v16 or higher)
  • Python (v3.8 or higher)
  • Supabase account and project

Backend Setup

  1. Navigate to the server directory:

    cd server
  2. Create a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Create a .env file with your Supabase credentials:

    SUPABASE_URL=your_supabase_url
    SUPABASE_KEY=your_supabase_anon_key
    
  5. Start the backend server:

    python main.py

Frontend Setup

  1. Navigate to the client directory:

    cd client
  2. Install dependencies:

    npm install
  3. Start the development server:

    npm run dev

Usage

  1. Creating New Entries: Click the "New Entry" button to create a new person page
  2. Editing Content: Click any text field to edit it inline
  3. Saving Changes: Press Ctrl+Enter (or Cmd+Enter on Mac) to save, or click the ✅ button
  4. Uploading Images: Use the upload button below the person's photo
  5. Navigation: Use the page indicators or click the edges of the diary to navigate
  6. Deleting Entries: Use the delete button for saved entries

Technical Stack

  • Frontend: React, Vite, Tailwind CSS
  • Backend: Flask, Python
  • Database: Supabase (PostgreSQL)
  • Storage: Supabase Storage
  • Styling: Custom CSS with vintage diary aesthetic

API Endpoints

  • GET /api/people - Fetch all people
  • POST /api/people - Create a new person
  • PATCH /api/people/<name> - Update a person's information
  • DELETE /api/people/<name> - Delete a person
  • POST /api/upload-image/<name> - Upload an image for a person
  • GET /api/faces/status - Get face recognition status
  • POST /api/faces/reload - Manually reload faces from storage
  • GET /api/faces/images - Get list of images in storage
  • POST /api/faces/clear-cache - Clear face recognition cache

Contributing

Feel free to submit issues and enhancement requests!

License

This project is open source and available under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors