How dilame/instagram-private-api works
Main Components
a. Core Components:
• IgApiClient (Central client class)
• State Management
• Request Handler
• Entity Factory
• Feed Factory
b. Feature Modules:
• Repositories
• Feeds
• Services
• Sticker Builder
• Error Handlers
Architectural Layers
┌─────────────────────────────────────────────────────────────┐
• Client Interface │
• (IgApiClient) │
• ┬─────────────┬──────────────┬─────────────────┤
• Repositories│ Feeds │ Services │ Sticker Builder │
• ┴─────────────┴──────────────┴─────────────────┤
• Core Components │
• ┬─────────────┬──────────────┬─────────────────┤
• State │ Request │ Entity │ Feed │
• Management │ Handler │ Factory │ Factory │
• ┴─────────────┴──────────────┴─────────────────┤
• Error Handling Layer │
• ┘
Component Relationships
• IgApiClient instantiates and manages all other components
• Repositories depend on Request Handler
• Feeds depend on Entity Factory
• Services orchestrate Repositories and Feeds
• State Management is accessed by all components
• Error Handling Layer intercepts all operations
Detailed Component Breakdown
a. Repositories (Show key ones):
Repositories
• Account
• Media
• Direct
• User
• Story
• Others (20+ more)
b. Feeds:
Feeds
• Timeline
• User
• Location
• Tag
• Others
c. Services:
Services
• Insights
• Publish
• Search
• Story
• Simulate
Data Flow Indicators
• Authentication flow
• Media upload flow
• Feed pagination flow
• Direct messaging flow
External Integration Points
Connections to:
• Instagram API endpoints
• Proxy support
• File system (for media uploads)
• Session storage
Additional Elements
Include:
• Version information
• Key dependencies
• Authentication states
• Error handling paths
Implementation Notes
Annotations for:
• TypeScript types and interfaces
• Observable patterns in feeds
• Entity relationships
• State persistence