Dec-04-2017, 08:55 PM
When it comes to largish projects (like this), I always start with a database model (because I've found that's how I think best). Once I know how the data is organized and stored, writing a front end to it is almost simple.
For a social network, you have a few obvious tables: Person, PersonFriendship, PersonComment.
A PersonComment would have a parent PersonComment, which would be a comment that that comment is a reply for. Any PersonComment without a parent, would be a post to that person's Wall.
A little more fleshed out:
Person
- id
- NameFirst
- NameLast
PersonFriendship
- person_id1
- person_id2
- timestamp
PersonComment
- id
- person_id
- parent_personComment_id
- timestamp
- Contents
And really, that's very close to the entire thing. Adding a chat system could be added afterward, as could groups, notifications, etc. Remember, when facebook first started, it was incredibly basic.
For a social network, you have a few obvious tables: Person, PersonFriendship, PersonComment.
A PersonComment would have a parent PersonComment, which would be a comment that that comment is a reply for. Any PersonComment without a parent, would be a post to that person's Wall.
A little more fleshed out:
Person
- id
- NameFirst
- NameLast
PersonFriendship
- person_id1
- person_id2
- timestamp
PersonComment
- id
- person_id
- parent_personComment_id
- timestamp
- Contents
And really, that's very close to the entire thing. Adding a chat system could be added afterward, as could groups, notifications, etc. Remember, when facebook first started, it was incredibly basic.