Library Management System is a Spring Boot-based application used to manage a library's book collection, including book CRUD features and user management with different roles.
- Ensure Docker and Docker Compose are installed.
- Open a terminal and navigate to the project root.
- Run the following command:
docker-compose up --build
- The application will be available at http://localhost:8080, and the PostgreSQL database at localhost:5432.
- Ensure Java 17, Maven, and PostgreSQL are installed.
- Create a new database in PostgreSQL named
library_db. - Configure
application.propertiesorapplication.ymlwith the appropriate PostgreSQL credentials. - Run the following command:
mvn clean spring-boot:run
- The application can be accessed at http://localhost:8080.
- Open Postman.
- Click Import at the top left corner.
- Select Upload Files and choose the collection file provided in the project.
- Once imported successfully, the API collection is ready for use.
| Role | Create Articles | Edit Other Users' Articles | Delete Articles | Manage Users |
|---|---|---|---|---|
| SUPER_ADMIN | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes (CRUD User & Role) |
| ADMIN | ✅ Yes | ✅ Yes | ✅ Yes | ❌ Cannot manage users |
| EDITOR | ✅ Yes | ✅ Yes (only their own) | ❌ Cannot delete | ❌ Cannot manage users |
| CONTRIBUTOR | ✅ Yes | ❌ Cannot edit | ❌ Cannot delete | ❌ Cannot manage users |
| VIEWER | ❌ Cannot create | ❌ Cannot edit | ❌ Cannot delete | ❌ Cannot manage users |
- SUPER_ADMIN → Can perform all actions, including managing users & their roles.
- ADMIN → Same as SUPER_ADMIN but cannot manage users.
- EDITOR → Can create & edit only their own articles but cannot delete them.
- CONTRIBUTOR → Can create articles but cannot edit or delete them.
- VIEWER → Can only read articles (default role upon registration).
By default, newly registered users are assigned the VIEWER role.
To set a user as SUPER_ADMIN, you must manually update their role in the database.