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.
- The Core Concept
- Architecture Overview
- Data Models
- API Layer
- Key Features
- Tech Stack
- Getting Started
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) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 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) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
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 |
Event โ Top-level container
Event
โโโ name, description, date, location
โโโ cover_image
โโโ coordinator โ ForeignKey(User) # Only coordinators can own eventsAlbum โ 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_cntLike
โโโ 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_atUses 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| 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 |
# 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 tagsCelery 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| 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 |
| 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 |
| 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 |
- Node.js 18+ & npm
- Python 3.8+
- Redis (for Celery)
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 runservercelery -A config worker -l infocd frontend
npm install
npm run devVisit http://localhost:5173 ๐
- Real-Time Notifications (WebSocket + JWT)
- TypeScript Migration
- Material UI Dialog Components
- AWS S3 Cloud Storage
- share albums/photos
MIT License - see LICENSE for details.