How msdeep14/systemdesign-from-scratch works
PhotoZ is an educational photo-sharing social platform that evolves from an MVP into a more scalable application. Its central user journey is to publish photos and then see relevant photos in a personalized feed; the feed combines followed-user and community content with celebrity content. The sampled sources show feed assembly, Redis caching, photo and user data models, and asynchronous fan-out and notification work. Several web handlers, configuration details, and integrations are unsampled, so those links are left unverified rather than inferred as definite calls.
Main entry points: services.py Feed assembly · urls.py Request routing · notifications/tasks.py Notification tasks · newsfeed/tasks.py Feed fan-out
Components 22
Web entry
- Request routing
photoz/bses/urls.py - Photo actions
photoz/photos/views.py - Feed requests
photoz/newsfeed/views.py - Account actions
photoz/users/views.py - Community actions
photoz/communities/views.py - Notification views
photoz/notifications/views.py
Social features
- Photo services
photoz/photos/services.py - Photo records
photoz/photos/models.py - Feed assembly
photoz/newsfeed/services.py - Follow services
photoz/users/services.py - Profiles and follows
photoz/users/models.py - Community services
photoz/communities/services.py - Community records
photoz/communities/models.py - Notification records
photoz/notifications/models.py
Background work
- Feed signals
photoz/newsfeed/signals.py - Feed fan-out
photoz/newsfeed/tasks.py - Notification signals
photoz/notifications/signals.py - Notification tasks
photoz/notifications/tasks.py - Task workers
photoz/bses/celery.py
Data and caching
- Application database
- Redis cache
Other components
- PhotoZ user
Connections 30
- PhotoZ user → Request routing: sends requests
- Request routing → Photo actions: routes to
- Request routing → Feed requests: routes to
- Request routing → Account actions: routes to
- Request routing → Community actions: routes to
- Request routing → Notification views: routes to
- Feed requests → Feed assembly: requests feed
- Photo actions → Photo services: uses photo operations
- Feed assembly → Follow services: gets followed users
photoz/newsfeed/services.py - Feed assembly → Community services: gets memberships
photoz/newsfeed/services.py - Feed assembly → Photo services: gets photo IDs
photoz/newsfeed/services.py - Feed assembly → Redis cache: reads and caches feeds
photoz/newsfeed/services.py - Photo services → Photo records: queries photos
photoz/photos/services.py - Photo services → Redis cache: caches photo data
photoz/photos/services.py - Follow services → Profiles and follows: queries follows
photoz/users/services.py - Community services → Community records: queries memberships
photoz/communities/services.py - Photo records → Application database: persists records
photoz/photos/models.py - Profiles and follows → Application database: persists records
photoz/users/models.py - Community records → Application database: persists records
photoz/communities/models.py - Notification records → Application database: persists records
photoz/notifications/models.py - Feed signals → Feed assembly: calls feed updates
photoz/newsfeed/signals.py - Feed signals → Feed fan-out: dispatches tasks
photoz/newsfeed/signals.py - Feed fan-out → Follow services: gets followers
photoz/newsfeed/tasks.py - Feed fan-out → Feed assembly: updates feed caches
photoz/newsfeed/tasks.py - Notification signals → Notification tasks: dispatches tasks
photoz/notifications/signals.py - Notification tasks → Notification records: creates notifications
photoz/notifications/tasks.py - Notification tasks → Photo records: loads photos
photoz/notifications/tasks.py - Notification tasks → Community records: loads memberships
photoz/notifications/tasks.py - Feed fan-out → Task workers: runs as tasks
photoz/newsfeed/tasks.py - Notification tasks → Task workers: runs as tasks
photoz/notifications/tasks.py