How busradev/music-social-network works
This is a command-line music social network: users manage friendships and listening activity, and the system recommends popular songs into a primary user’s library. The main workflow enters through the terminal, parses commands, checks social distance for listens, tracks song popularity, then transfers top hits into the primary library. The graph and indexes are grounded in the excerpts and SOURCE INDEX; unsampled behavior is omitted where call ownership is not established.
Main entry points: Terminal.cpp Command terminal · System.cpp Song system · BST.cpp Song tree · Song.cpp Song and listens
Components 13
Command interface
- Command terminal
Terminal.cpp - Command parser
Parser.h
Social network
- User seed list
users.txt - Friend graph
Graph.cpp - User tree
UBST.cpp - User record
User.cpp
Music and recommendations
- Song seed list
songs.txt - Song system
System.cpp - Song tree
BST.cpp - Song and listens
Song.cpp - Top-hit heap
Heap.cpp - Primary library
PrimaryUser.cpp
Other components
- CLI user
Connections 15
- CLI user → Command terminal: enters commands
Terminal.cpp - Command terminal → Command parser: parses commands
Terminal.cpp - Command terminal → Song system: manages songs and hits
Terminal.cpp - Command terminal → Friend graph: manages users and checks radius
Terminal.cpp - Command terminal → Primary library: updates library
Terminal.cpp - Command terminal → Song seed list: loads songs
Terminal.cpp - Command terminal → User seed list: loads users
Terminal.cpp - Friend graph → User tree: indexes users
- User tree → User record: stores records
- Song system → Song tree: indexes catalog
- Song system → Top-hit heap: ranks top hits
- Song tree → Song and listens: indexes songs
- Top-hit heap → Song and listens: ranks song counts
Heap.cpp - Primary library → Song tree: uses song tree
- Command terminal → Song and listens: updates listen counts
Terminal.cpp