An enterprise-grade, relational backend engine built with Java and Spring Boot, engineered to power modern social networking features. The platform exposes robust RESTful APIs for stateless JWT authentication, social graph operations (follow/unfollow), media post publishing, threaded discussions, stories, reels, and peer-to-peer chat sessions.
- 🔐 Spring Security & JWT: Configured custom security filter chains with stateless session management and JWT authentication tokens.
- 📊 Relational Social Graph: Optimized PostgreSQL schemas with foreign-key constraints and indexing strategies designed for bi-directional graph traversals (followers, following, liked posts).
- 🏗️ Domain-Driven Layering: Clean separation of concerns across Data Transfer Objects (DTOs), JPA Entities, Repository layers, business Services, and REST Controllers.
- 💬 Real-Time Messaging & Chat: Integrated chat and direct message endpoints supporting threaded message persistence.
- 📱 Multimedia Feeds: Dedicated subsystems for standard image/video posts, 24-hour stories, and algorithmic reels.
| Layer | Technologies |
|---|---|
| Language & Framework | Java 17+, Spring Boot (Spring Web, Spring Data JPA) |
| Security & Auth | Spring Security, JSON Web Tokens (JJWT), BCrypt Password Hashing |
| Database | PostgreSQL, Hibernate ORM |
| Build Tool | Apache Maven (mvnw wrapper included) |
| Client Frontend | React.js & Redux (Repository: Social-frontend) |
| Method | Endpoint | Description |
|---|---|---|
POST |
/auth/signup |
Register a new user account |
POST |
/auth/signin |
Authenticate credentials and receive JWT |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/users/profile |
Retrieve authenticated user profile |
GET |
/api/users/{userId} |
Fetch public profile by user ID |
PUT |
/api/users/update |
Update user metadata and bio |
PUT |
/api/users/follow/{userId2} |
Follow or unfollow a user |
GET |
/api/users/search?query=... |
Search users by name or username |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/posts/user/{userId} |
Create a new multimedia post |
GET |
/api/posts |
Retrieve global chronological post feed |
GET |
/api/posts/{postId} |
Fetch post by unique ID |
PUT |
/api/posts/like/{postId} |
Like or unlike a specific post |
PUT |
/api/posts/save/{postId} |
Bookmark post to saved collection |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/comments/post/{postId} |
Post a comment on a target post |
PUT |
/api/comments/like/{commentId} |
Like a specific comment |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/story |
Publish an ephemeral story |
GET |
/api/story/user/{userId} |
Fetch stories created by user |
POST |
/api/reels |
Publish short-form video reel |
GET |
/api/reels |
Retrieve reels stream |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/chats |
Create or initiate a conversation |
GET |
/api/chats/user |
Fetch active conversations for current user |
POST |
/api/messages/chat/{chatId} |
Send a direct message within a chat |
GET |
/api/messages/chat/{chatId} |
Retrieve chat message history |
- Java JDK:
17or higher (java -version) - PostgreSQL: Running locally or via Docker (
localhost:5432) - Maven: Bundled via
./mvnw
Ensure PostgreSQL is running and create the social database:
CREATE DATABASE social;Edit src/main/resources/application.properties (or copy from application.properties.example):
spring.application.name=social-app
server.port=8080
spring.datasource.url=jdbc:postgresql://localhost:5432/social
spring.datasource.username=postgres
spring.datasource.password=postgres
spring.datasource.driver-class-name=org.postgresql.Driver
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=trueUsing the included Maven wrapper:
# Clean and compile
./mvnw clean install -DskipTests
# Launch the Spring Boot application
./mvnw spring-boot:runThe server will initialize and begin listening for API requests on http://localhost:8080.
The companion client application built with React.js and Redux is available at: 👉 rishab2211/Social-frontend
This project is open-source under the MIT License.