Connect is a social networking platform designed to be a hub where users can share and showcase their side projects and ideas. Built on a robust technology stack and equipped with various services, Connect aims to foster a community of creative minds.
- Java Spring Boot
- MySQL
- Redis
- Elasticsearch, Kibana, Logstash
To run the Connect Social Networking Platform service, follow the steps below:
- Navigate to the docker-compose directory:
cd docker-compose
- Build and start the service using Docker Compose:
docker-compose up --build
This command will download the necessary Docker images, build the Connect service, and start the containers. - Once the service is up and running, you can interact with endpoints of the service through http://localhost:8080
Connect is organized around the following Entities:
- User
- Follow
- Star
- Project
- Post
- Comment
Parameter | Type | Description |
---|---|---|
UserStatus | Integer | 0 - PUBLIC, 1 - SEMI-PUBLIC, 2 - PRIVATE, 3 - DELETED |
UserRole | Integer | 0 - ESSENTIAL, 1 - PLUS, 2 - PREMIUM, 3 - ADMIN |
CodeStatus (Email Verification Code) | Integer | 0 - DELETED, 1 - PENDING, 2 - COMPLETED, 3 - EXPIRED |
FollowStatus | Integer | 0 - UNFOLLOW, 1 - PENDING, 2 - APPROVED, 3 - REJECTED |
StarTargetType | Integer | 0 - PROJECT, 1 - POST, 2 - COMMENT |
ProjectStatus, PostStatus, CommentStatus all follow the definition of UserStatus
Prefix: "/api/connect/v1"
All requests, except for public APIs, must indicate a JWT token , acquired through the sign-in endpoint, in the header Authorization.
- Endpoint:
/public/user/signup
- Method: POST
- Description: user needs to complete email verification process (Query Email Verification + Verify Email Verification) before requesting for signup
Payload:
Parameter | Type | Example |
---|---|---|
username | String | john_doe |
password | String | |
description | String | |
String | [email protected] | |
phone | String | 12345678 |
uid | String | acquired from the response of email verification |
- Endpoint:
/public/user/signin
- Method: POST
Payload:
Parameter | Type | Example |
---|---|---|
username | String | john_doe |
password | String |
- Endpoint:
/user/{username}
- Method: GET
PathVariable:
Parameter | Type | Example |
---|---|---|
username | String | john_doe |
- Endpoint:
/user
- Method: GET
Params:
Parameter | Type | Example |
---|---|---|
keyword | String | software |
pageIndex | Integer | 1 |
pageSize | Integer | 20 |
- Endpoint:
/user/me/info
- Method: PATCH
Payload:
Parameter | Type | Example |
---|---|---|
passowrd | String | |
status | Integer | 0 - public, 1 - semi, 2 - private |
String | ||
phone | String |
Note. TODO email should be verficiation again if getting updated
- Endpoint:
/user/me/profile
- Method: PATCH
Payload:
Parameter | Type | Example |
---|---|---|
username | String | john_doe |
description | String | john_doe's profile |
socialLinks | Map<String, String> | "socialLinks": {"github": "leduoyang", "instagram": "leduoyang"} |
- Endpoint:
/user/{username}
- Method: DELETE
PathVariable:
Parameter | Type | Example |
---|---|---|
username | String | john_doe |
- Endpoint:
/user/upload/profileImage
- Method: POST
Payload:
Parameter | Type | Example |
---|---|---|
profileImage | File | *.jpeg, *.jpg, *.png |
- Endpoint:
/user/me
- Method: GET
- Endpoint:
/user/me/starList
- Method: GET
- Description: projects, posts, and comments, of which users have given stars, are retrieved
- Endpoint:
/user/me/pendingList
- Method: GET
- Description: only users of semi-public can query pending list of requests for following
- Endpoint:
/user/me/followerList
- Method: GET
- Endpoint:
/user/me/followingList
- Method: GET
- Endpoint:
/public/verification/email
- Method: GET
PathVariable:
Parameter | Type | Example |
---|---|---|
String | [email protected] |
- Endpoint:
/public/verification/email
- Method: POST
Payload:
Parameter | Type | Example |
---|---|---|
String | [email protected] | |
code | String | abcd1234 |
- Endpoint:
/follow/{followingId}
- Method: POST
- Description: when following a public account, the request will be made instantly while when following a semi-public account, the user will be able to follow target user {followingId} after {followingId} approves the request
PathVariable:
Parameter | Type | Example |
---|---|---|
followingId (target username to follow ) | String | john_doe |
- Endpoint:
/follow/{following}
- Method: DELETE
PathVariable:
Parameter | Type | Example |
---|---|---|
following (target username to unfollow ) | String | john_doe |
- Endpoint:
/follow/isFollowing/{following}
- Method: GET
- Description: check if the current user is following user {following}
PathVariable:
Parameter | Type | Example |
---|---|---|
following | String | john_doe |
- Endpoint:
/follow/remove/{follower}
- Method: DELETE
- Description: remove a user {follower} from the follower list
PathVariable:
Parameter | Type | Example |
---|---|---|
follower (target username to remove from followers ) | String | john_doe |
- Endpoint:
/follow/approve/{follower}
- Method: POST
- Description: when the current user is a semi-public account, approve the follow request from user {followerId}
PathVariable:
Parameter | Type | Example |
---|---|---|
follower | String | john_doe |
- Endpoint:
/follow/reject/{follower}
- Method: POST
- Description: when the current user is a semi-public account, reject the follow request from user {followerId}
PathVariable:
Parameter | Type | Example |
---|---|---|
follower | String | john_doe |
- Endpoint:
/follow/approveAll
- Method: POST
- Description: when the current user is a semi-public account, approve all requests of following for other users in the pending list
Examples demonstrating the interactions to the service can be found and import to Postman in the postman_script.json
Access the API documentation through Swagger for more details: http://localhost:8080/swagger-ui.html