Back to projects

Spring Social Media Blog API
/ April 25, 2025
🌱 Spring Social Media Blog API
This is a backend-only micro-blogging API built in Java using the Spring framework. It follows a 3-layer architecture (Controller, Service, Repository) and provides core social media functionality including user registration, login, and message handling.
🔧 Tech Stack
- Java
- Spring Boot
- Spring MVC + Spring Data JPA
- SQL (H2 or MySQL)
- HTTP REST API
✅ Features
POST /register
– Register a new userPOST /login
– Login with username/passwordPOST /messages
– Create a new messageGET /messages
– View all messagesGET /messages/{messageId}
– View message by IDDELETE /messages/{messageId}
– Delete a messagePATCH /messages/{messageId}
– Edit message contentGET /accounts/{accountId}/messages
– View all messages by a specific user
🗂 Structure
- Controller – Handles HTTP endpoints using
@RestController
- Service – Contains business logic with
@Service
- Repository – Interfaces extending
JpaRepository
- Model – Entity classes for Account and Message
- Database – Auto-configured and initialized via Spring with SQL schema
✅ Spring Features Used
- Dependency injection with
@Autowired
- RESTful routing via Spring MVC
- Automatic DB handling with Spring Data JPA
- Exception handling and validation