Skip to content

APT-KK/MemoRise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

190 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“ธ Memorise: Smart Event Gallery

Project Status License Python Django React TypeScript

Memorise is a full-stack "Smart Gallery" platform built for photographers and event coordinators to organize, manage, and showcase large photo collections with AI-powered tagging and real-time notifications.

๐Ÿ’ก Think Google Photos meets Flickr, but structured specifically for Events with role-based access control.


๐Ÿ“– Table of Contents


๐Ÿง  The Core Concept

Instead of dumping thousands of photos into one big pile, Memorise uses a structured, two-tier hierarchy:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    EVENT                                โ”‚
โ”‚              (e.g., "John's Wedding")                   โ”‚
โ”‚                                                         โ”‚
โ”‚   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”‚
โ”‚   โ”‚   ALBUM     โ”‚  โ”‚   ALBUM     โ”‚  โ”‚   ALBUM     โ”‚     โ”‚
โ”‚   โ”‚  Ceremony   โ”‚  โ”‚  Reception  โ”‚  โ”‚  After Partyโ”‚     โ”‚
โ”‚   โ”‚   ๐Ÿ“ธ๐Ÿ“ธ     โ”‚  โ”‚   ๐Ÿ“ธ๐Ÿ“ธ     โ”‚  |   ๐Ÿ“ธ๐Ÿ“ธ     โ”‚     |
โ”‚   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ”‚
โ”‚                                                         โ”‚
โ”‚   ๐Ÿ“ธ ๐Ÿ“ธ ๐Ÿ“ธ ๐Ÿ“ธ  (Loose Photos - Event-level stream)    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ— Architecture Overview

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                         FRONTEND                               โ”‚
โ”‚                    React 19 + TypeScript                       โ”‚
โ”‚          Material UI + Tailwind CSS + Vite                     โ”‚
โ”‚                                                                โ”‚
โ”‚   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”        โ”‚
โ”‚   โ”‚  Pages   โ”‚  โ”‚Componentsโ”‚  โ”‚ Context  โ”‚  โ”‚   API   โ”‚        โ”‚ 
โ”‚   โ”‚ (Routes) โ”‚  โ”‚ (UI/MUI) โ”‚  โ”‚(WebSocketโ”‚  โ”‚ (Axios) |        โ”‚
โ”‚   โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚             โ”‚             โ”‚             โ”‚
         โ–ผ             โ–ผ             โ–ผ             โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                     REST API + WebSocket                       โ”‚
โ”‚                    JWT Authentication                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚                                         โ”‚
         โ–ผ                                         โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚       DJANGO REST API       โ”‚    โ”‚     DJANGO CHANNELS         โ”‚
โ”‚        (DRF ViewSets)       โ”‚    โ”‚   (WebSocket Consumers)     โ”‚
โ”‚                             โ”‚    โ”‚                             โ”‚
โ”‚  โ€ข EventViewSet             โ”‚    โ”‚  โ€ข NotificationConsumer     โ”‚
โ”‚  โ€ข AlbumViewSet             โ”‚    โ”‚  โ€ข JWT Token Auth           โ”‚
โ”‚  โ€ข PhotoViewSet             โ”‚    โ”‚  โ€ข User-specific Groups     โ”‚
โ”‚  โ€ข LikeViewSet              โ”‚    โ”‚                             โ”‚
โ”‚  โ€ข CommentViewSet           โ”‚    โ”‚                             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
               โ”‚                                   โ”‚
               โ–ผ                                   โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚         MODELS              โ”‚    โ”‚       CELERY TASKS          โ”‚
โ”‚   (PostgreSQL/SQLite)       โ”‚    โ”‚     (Redis Broker)          โ”‚
โ”‚                             โ”‚    โ”‚                             โ”‚
โ”‚  โ€ข CustomUser (5 roles)     โ”‚    โ”‚  โ€ข process_photo()          โ”‚
โ”‚  โ€ข Event โ†’ Album โ†’ Photo    โ”‚    โ”‚    - Thumbnail generation   โ”‚
โ”‚  โ€ข Like, Comment            โ”‚    โ”‚    - Watermark overlay      โ”‚
โ”‚  โ€ข Notification (Generic)   โ”‚    โ”‚    - EXIF extraction        โ”‚
โ”‚                             โ”‚    โ”‚  โ€ข AI Tagging (ResNet50)    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“Š Data Models

User Model (users/models.py)

Custom user with email-based auth and role-based permissions:

Field Type Description
email EmailField Primary identifier (replaces username)
full_name CharField Display name
role Choice Admin / Coordinator / Photographer / Member / Guest
profile_picture ImageField Avatar
email_otp CharField PyOTP secret for email verification
is_verified Boolean Email verification status

Gallery Models (gallery/models.py)

Event โ€” Top-level container

Event
โ”œโ”€โ”€ name, description, date, location
โ”œโ”€โ”€ cover_image
โ””โ”€โ”€ coordinator โ†’ ForeignKey(User)  # Only coordinators can own events

Album โ€” Sub-collection within an event

Album
โ”œโ”€โ”€ name, description, cover_image
โ”œโ”€โ”€ event โ†’ ForeignKey(Event)
โ””โ”€โ”€ owner โ†’ ForeignKey(User)

Photo โ€” The core asset

Photo
โ”œโ”€โ”€ image, thumbnail (generated)
โ”œโ”€โ”€ is_processed (Celery flag)
โ”œโ”€โ”€ exif_data (JSONField - extracted metadata)
โ”œโ”€โ”€ auto_tags (AI-generated via ResNet50)
โ”œโ”€โ”€ tagged_users โ†’ ManyToMany(User)
โ”œโ”€โ”€ photographer โ†’ ForeignKey(User)
โ”œโ”€โ”€ album โ†’ ForeignKey(Album)
โ”œโ”€โ”€ event โ†’ ForeignKey(Event)
โ””โ”€โ”€ likes_cnt, download_cnt

Interaction Models (interactions/models.py)

Like
โ”œโ”€โ”€ user โ†’ ForeignKey(User)
โ”œโ”€โ”€ photo โ†’ ForeignKey(Photo)
โ””โ”€โ”€ unique_together = ('user', 'photo')  # One like per user

Comment
โ”œโ”€โ”€ user โ†’ ForeignKey(User)
โ”œโ”€โ”€ photo โ†’ ForeignKey(Photo)
โ”œโ”€โ”€ content (TextField)
โ”œโ”€โ”€ parent โ†’ ForeignKey(self)  # Nested replies support
โ””โ”€โ”€ created_at

Notification Model (notifications/models.py)

Uses Django's GenericForeignKey for polymorphic notifications:

Notification
โ”œโ”€โ”€ recipient โ†’ ForeignKey(User)
โ”œโ”€โ”€ actor โ†’ ForeignKey(User)
โ”œโ”€โ”€ verb (CharField)  # "liked your photo", "commented on"
โ”œโ”€โ”€ content_type โ†’ ForeignKey(ContentType)  # Generic relation
โ”œโ”€โ”€ object_id (PositiveIntegerField)
โ”œโ”€โ”€ content_object (GenericForeignKey)
โ””โ”€โ”€ is_read, created_at

๐Ÿ”Œ API Layer (Views & Serializers)

ViewSets (gallery/views.py)

ViewSet Endpoint Features
PhotoViewSet /api/gallery/photos/ CRUD, filtering, ordering, download action
AlbumViewSet /api/gallery/albums/ CRUD, filter by event/owner, search
EventViewSet /api/gallery/events/ CRUD, auto-assigns coordinator
UserSearchView /api/gallery/search/ Debounced user search for tagging

Key Serializer Patterns (gallery/serializers.py)

# Dual-field pattern for user tagging:
tagged_users_details = UserTagSerializer(read_only=True)   # GET: Full user objects
tagged_user_ids = PrimaryKeyRelatedField(write_only=True)  # POST/PATCH: Just IDs

# Computed fields:
is_liked = SerializerMethodField()      # Check if current user liked
likes_count = SerializerMethodField()   # Dynamic count
auto_tags = SerializerMethodField()     # AI-generated tags

Background Processing (gallery/tasks.py)

Celery tasks triggered on photo upload via signals:

@shared_task
def process_photo(photo_id):
    # 1. Generate 500x500 thumbnail
    # 2. Apply watermark overlay ("ยฉ MemoRise")
    # 3. Extract EXIF metadata
    # 4. Set is_processed = True

๐Ÿš€ Key Features

Feature Implementation
Real-Time Notifications Django Channels + WebSocket + JWT auth
AI Photo Tagging ResNet50 deep learning model
EXIF Extraction Pillow/exifread on upload
Async Processing Celery + Redis for thumbnails/watermarks
User Tagging ManyToMany with debounced search
Nested Comments Self-referential ForeignKey (parent)
Role-Based Access 5 user roles with limit_choices_to
MUI Dialog Components Modal forms for Create Event/Album/Tagging

๐Ÿ›  Tech Stack

Backend

Technology Purpose
Python 3.8+ Language
Django 5.x Web framework
Django REST Framework API layer
Django Channels WebSocket support
Celery + Redis Async task queue
PostgreSQL/SQLite Database
ResNet50 (TensorFlow) AI image tagging
PyOTP Email OTP verification

Frontend

Technology Purpose
React 19 UI library
TypeScript 5.x Type safety
Vite 7.x Build tool
Material UI 7.x Component library
Tailwind CSS Utility styling
Axios HTTP client
react-hot-toast Notifications
Lucide React Icons

โšก Getting Started

Prerequisites

  • Node.js 18+ & npm
  • Python 3.8+
  • Redis (for Celery)

1. Clone & Setup Backend

git clone https://github.com/yourusername/memorise-gallery.git
cd memorise-gallery/backend

python -m venv venv
venv\Scripts\activate        # Windows
source venv/bin/activate     # macOS/Linux

pip install -r requirements.txt
python manage.py migrate
python manage.py runserver

2. Start Celery Worker

celery -A config worker -l info

3. Setup Frontend

cd frontend
npm install
npm run dev

Visit http://localhost:5173 ๐Ÿš€


๐Ÿ”ฎ Roadmap

  • Real-Time Notifications (WebSocket + JWT)
  • TypeScript Migration
  • Material UI Dialog Components
  • AWS S3 Cloud Storage
  • share albums/photos

๐Ÿ“„ License

MIT License - see LICENSE for details.

About

basically an event photo management platform

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published