This project represents a basic design for the backend of an Instagram-like application. It provides functionality for user authentication and managing user posts.
- Endpoint:
POST /api/user/signin - Description: Sign in with a registered user account.
- Request Body:
{ "email": "user@example.com", "password": "your_password" }
- Endpoint: POST /api/user/signup
- Description: Create a new user account.
- Request Body:
"firstName": "John", "lastName": "Doe", "email": "newuser@example.com", "password": "your_password", "age": 25, "phoneNumber": "123-456-7890"
}
- Endpoint: PUT /api/user/{userId}
- Description: Update user details.
- Request Body:
"firstName": "UpdatedFirstName", "lastName": "UpdatedLastName", "age": 30, "phoneNumber": "987-654-3210"
}
- Post Controller
- Save Post
- Request Body:
"postData": "Your post content here"
}
- Returns the created post.
- Get Post
- Endpoint: GET /api/post/{postId}
- Description: Retrieve a post by its ID.
- Returns the requested post.
- Start the application.
- Use an API testing tool such as Postman to interact with the API.
- Sign in, sign up, create posts, and retrieve posts using the provided endpoints.
- Clone the repository.
- Set up a database and configure the database connection in the application properties.
- Build and run the application.
- Dependencies
- Java
- Spring Boot
- Spring Data JPA
- Spring Security
- H2 Database (for testing, you can replace it with your preferred database)