This is a simple API application built as a homework project for Istanbul Tech API Development and Integration Bootcamp. The service provides user profile management functionality with address management capabilities.
- Spring Boot
- MongoDB
- Docker Compose
- Swagger UI
- JWT Authentication
To run this application, you need to have the following installed:
- Docker and Docker Compose
- Java 17 or higher
- Maven
- Clone the repository
- Navigate to the project directory
- Start the MongoDB and Mongo Express containers:
docker-compose up -d- Run the Spring Boot application:
./mvnw spring-boot:run- MongoDB Express (Database UI): http://localhost:8081/db/homework/address
- Swagger UI (API Documentation): http://localhost:8080/swagger-ui/index.html#
- POST
/api/users/register - Creates a new user account
- Request body example:
{
"name": "ismail",
"surname": "kattan",
"email": "example@email.com",
"phone": "+905314326118",
"password": "user123",
"username": "sml-kttn"
}- POST
/api/users/login - Authenticates user and returns JWT token
- Request body example:
{
"username": "sml-kttn",
"password": "user123"
}- GET
/api/users/user/{username} - Retrieves user profile information
- Requires JWT Authentication
- PUT
/api/users/user/{username} - Updates user profile information
- Requires JWT Authentication
- Note: Cannot update address in this endpoint
- POST
/api/addresses/create - Creates a new address for the user
- Requires JWT Authentication
- GET
/api/addresses/user/{username} - Retrieves all addresses for a specific user
- Requires JWT Authentication
- GET
/api/addresses/address/{addressId} - Retrieves a specific address by ID
- Requires JWT Authentication
- PUT
/api/addresses/address/{addressId} - Updates a specific address
- Requires JWT Authentication
- DELETE
/api/addresses/address/{addressId} - Deletes a specific address
- Requires JWT Authentication
The API uses JWT (JSON Web Token) for authentication. Include the JWT token in the Authorization header as follows:
Authorization: Bearer <your-jwt-token>
Feel free to submit issues and pull requests.
This project is open-source and available under the MIT License.