A simple backend application for user management in an Instagram-like application, built using Spring Boot and MySQL.
- User registration.
- Secure user authentication.
- CRUD operations on user data.
HTTP Method | Endpoint | Description | Request Body |
---|---|---|---|
GET |
/users |
Get all users | None |
GET |
/users/{username} |
Find a user by their username | None |
PUT |
/users |
Update user details | JSON object of User |
DELETE |
/users/{id} |
Delete a user by their ID | None |
Request:
GET /users
Response:
[
{
"id": 1,
"userName": "john_doe",
"email": "[email protected]",
"gender": "Male",
"bio": "Hello, this is John!",
"profileImagePath": "/images/john.jpg"
},
{
"id": 2,
"userName": "jane_doe",
"email": "[email protected]",
"gender": "Female",
"bio": "Hello, this is Jane!",
"profileImagePath": "/images/jane.jpg"
}
]
Request:
GET /users/john_doe
Response:
{
"id": 1,
"userName": "john_doe",
"email": "[email protected]",
"gender": "Male",
"bio": "Hello, this is John!",
"profileImagePath": "/images/john.jpg"
}
Request:
PUT /users
Content-Type: application/json
Request Body:
{
"id": 1,
"userName": "john_doe",
"email": "[email protected]",
"passwordHash": "new_password",
"gender": "Male",
"bio": "Updated bio for John",
"profileImagePath": "/images/john_updated.jpg"
}
Response:
{
"id": 1,
"userName": "john_doe",
"email": "[email protected]",
"gender": "Male",
"bio": "Updated bio for John",
"profileImagePath": "/images/john_updated.jpg"
}
Request:
DELETE /users/1
Response:
"User deleted successfully."
- Java 17+
- Spring Boot
- MySQL Database
- Maven or Gradle for dependency management.
- Clone the repository:
git clone https://github.com/vermamanav005/insta_clone_v_manav_verma
- Update
application.properties
with your MySQL credentials:spring.datasource.url=jdbc:mysql://localhost:3306/instaclone spring.datasource.username=root spring.datasource.password=yourpassword spring.jpa.hibernate.ddl-auto=update
- Build the project:
mvn clean install
- Run the application:
mvn spring-boot:run
- Spring Boot: For creating the APIs.
- MySQL: As the relational database.
- Maven: For dependency management.