How yourikka/feed works
Feed Flow is a short-video social application. The main journey is a viewer choosing a latest, hot, or follow feed; the frontend fetches IDs and then details, displays videos, and reports playback behavior. Users can also register, publish videos, interact with content, and manage profiles and relationships. The backend separates HTTP handling from feed, interaction, and user services, with Redis-backed ranking/caches and asynchronous RabbitMQ workers. The README documents several feed capabilities whose implementation details were not sampled; those are represented at the service or ranking level without inferring internal call sequences.
Main entry points: router.go API router · main.go Worker startup · hot.go Hot ranking · App.vue Vue application
Components 26
Web client
- Vue application
feed-flow-frontend/src/App.vue - Feed view
feed-flow-frontend/src/views/Feed.vue - Feed API client
feed-flow-frontend/src/api/feed.js - User views
feed-flow-frontend/src/views/Profile.vue - Publish view
feed-flow-frontend/src/views/Publish.vue - Interaction API
feed-flow-frontend/src/api/interaction.js - User API
feed-flow-frontend/src/api/user.js
HTTP API
- API router
feed-flow-backend/router/router.go - Feed handlers
feed-flow-backend/controller/feed.go - User handlers
feed-flow-backend/controller/user.go - Interaction handlers
feed-flow-backend/controller/interaction.go
Feed and ranking
- Feed service
feed-flow-backend/service/feed.go - Hot ranking
feed-flow-backend/ranking/hot.go - Ranking snapshots
feed-flow-backend/ranking/snapshot.go
Users and interactions
- User service
feed-flow-backend/service/user.go - Interaction service
feed-flow-backend/service/interaction.go - Behavior service
feed-flow-backend/service/behavior.go
Async processing
- Worker startup
feed-flow-backend/main.go - Video publish consumer
feed-flow-backend/mq/video_mq.go - Outbox publisher
feed-flow-backend/mq/outbox.go - Behavior worker
feed-flow-backend/service/behavior_async.go - Interaction worker
feed-flow-backend/service/interaction_async.go
Other components
- Viewer
- MySQL
- Redis
- RabbitMQ
Connections 40
- Viewer → Vue application: uses
- Vue application → Feed view: routes to
- Feed view → Feed API client: requests feed
- Feed view → Interaction API: sends actions
- Vue application → User views: routes to
- Vue application → Publish view: routes to
- User views → User API: requests profile
- Publish view → User API: submits publish
- Feed API client → API router: HTTP requests
- Interaction API → API router: HTTP requests
- User API → API router: HTTP requests
- API router → Feed handlers: dispatches feed
- API router → User handlers: dispatches users
- API router → Interaction handlers: dispatches actions
- Feed handlers → Feed service: calls feed logic
- User handlers → User service: calls user logic
- Interaction handlers → Interaction service: calls interaction logic
- Feed service → MySQL: reads feed data
- Feed service → Redis: reads and caches
- Feed service → Hot ranking: gets hot IDs
- Hot ranking → Redis: stores ranking
- Hot ranking → Ranking snapshots: builds cursors
- User service → MySQL: reads and writes
- Interaction service → MySQL: reads and writes
- Interaction service → RabbitMQ: publishes events
- Feed handlers → Behavior service: records behavior
- Behavior service → RabbitMQ: publishes events
- Worker startup → Video publish consumer: starts consumer
- Worker startup → Outbox publisher: starts publisher
- Worker startup → Behavior worker: starts worker
- Worker startup → Interaction worker: starts worker
- Worker startup → Hot ranking: starts refresh
- Video publish consumer → RabbitMQ: consumes publish queue
- Video publish consumer → Hot ranking: records publish score
- Outbox publisher → MySQL: reads pending events
- Outbox publisher → RabbitMQ: publishes messages
- Behavior worker → RabbitMQ: consumes events
- Behavior worker → Behavior service: processes behavior
- Interaction worker → RabbitMQ: consumes events
- Interaction worker → Interaction service: processes actions