Skip to content

This project provides a RESTful API for managing users and user groups, built using Spring Boot.

Notifications You must be signed in to change notification settings

esa-kian/user-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

User and Group Management API

This project provides a RESTful API for managing users and user groups, built using Spring Boot.

Features

  • Manage users and groups
  • Associate users with groups
  • H2 in-memory database for persistence

Setup Instructions

  1. Clone the repository:

    git clone https://github.com/esa-kian/user-manager
    cd user-manager
    
  2. Ensure you have JDK 17+ and Maven installed.

  3. Build and run the application using Maven:

    mvn spring-boot:run
  4. Access the API at http://localhost:8080

API Endpoints

Users

  • GET /api/users: Fetch all users
  • GET /api/users/{id}: Get user by ID
  • POST /api/users: Create new user
  • DELETE /api/users/{id}: Delete user

Groups

  • POST /api/groups: Create new group
  • POST /api/groups/{groupId}/users/{userId}: Add user to group
  • DELETE /api/groups/{groupId}/users/{userId}: Remove user from group

Swagger UI

Swagger API documentation is available at http://localhost:8080/swagger-ui.html

Instructions for Docker Usage

  1. Build the Docker Image:
docker build -t user-management-rest .
# for ARM architecture (like M1/M2 Macs): 
docker build --platform linux/amd64 -t user-management-rest .
  1. Run the Container:
docker run -p 8000:8080 user-management-rest
  1. Stop the Container:
docker stop user-management-rest

Running Tests

To run unit tests for the application, run:

mvn test

License

This project is open-source and available under the MIT License.

About

This project provides a RESTful API for managing users and user groups, built using Spring Boot.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published