Spring Boot ile gelistirilmis kutuphane otomasyon API projesidir. Projede kitap, yazar, yayinci, kategori, odunc alma ve kullanici islemleri icin REST endpointleri bulunur. PostgreSQL veritabani, Redis cache, JWT tabanli kimlik dogrulama ve Swagger UI destegi kullanilir.
- 1) N+1 Problem
- 2) Redis Cache
- 3) Role Based Authentication (RBAC)
-
- Method Security
-
- Exception Management
-
- JWT and Security
- Java 17
- Spring Boot 4.0.6
- Spring Web MVC
- Spring Data JPA
- Spring Security
- JWT
- PostgreSQL
- Redis
- Spring Cache
- Lombok
- ModelMapper
- Springdoc OpenAPI / Swagger UI
- Docker Compose
- Java 17
- Maven veya proje icindeki Maven Wrapper
- Docker Desktop
Projedeki docker-compose.yml dosyasi PostgreSQL, pgAdmin ve Redis servislerini calistirir.
docker compose up -dServisler:
| Servis | Port | Bilgi |
|---|---|---|
| PostgreSQL | 5432 |
Kullanici: postgres, sifre: gizlisifrem |
| pgAdmin | 5050 |
Email: admin@admin.com, sifre: admin |
| Redis | 6379 |
Cache servisi |
pgAdmin adresi:
http://localhost:5050
Temel ayarlar src/main/resources/application.properties dosyasindadir.
spring.datasource.url=jdbc:postgresql://localhost:5432/postgres
spring.datasource.username=postgres
spring.datasource.password=gizlisifrem
spring.data.redis.host=localhost
spring.data.redis.port=6379
spring.cache.type=redisHibernate varsayilan schema olarak kutuphaneotomasyon kullanir ve ddl-auto=update ile tablolar otomatik guncellenir.
Once Docker servislerini baslatin:
docker compose up -dArdindan uygulamayi calistirin:
./mvnw spring-boot:runWindows icin:
mvnw.cmd spring-boot:runUygulama varsayilan olarak su adreste calisir:
http://localhost:8080
API dokumantasyonuna su adresten ulasilabilir:
http://localhost:8080/swagger-ui/index.html
## Kimlik Dogrulama Endpointleri
| Method | Endpoint | Aciklama |
| --- | --- | --- |
| POST | `/register` | Yeni kullanici kaydi |
| POST | `/authenticate` | Giris yapma, access token ve refresh token alma |
| POST | `/refreshToken` | Refresh token ile yeni access token alma |
## Kitap Endpointleri
Base path:
```text
/rest/api/Book
| Method | Endpoint | Aciklama |
|---|---|---|
| POST | /save |
Kitap ekleme |
| PUT | /update/{id} |
Kitap guncelleme |
| DELETE | /delete/{id} |
Kitap silme |
| GET | /listAll |
Tum kitaplari listeleme |
| GET | /list/{id} |
ID ile kitap getirme |
| GET | /search?keyword=... |
Kitap adina gore arama |
| GET | /system/status |
Sistem kitap durum ozeti |
Kitap ekleme ve guncelleme endpointleri JSON body ile DtoBookIU alanlarini bekler.
Base path:
/rest/api/Author
| Method | Endpoint | Aciklama |
|---|---|---|
| POST | /save |
Yazar ekleme |
| GET | /listAllAuthors |
Tum yazarlari listeleme |
| GET | /list/{id} |
ID ile yazar getirme |
| PUT | /update/{id} |
Yazar guncelleme |
| DELETE | /delete/{id} |
Yazar silme |
| GET | /{authorId}/books |
Yazara ait kitaplari listeleme |
Base path:
/rest/api/Category
| Method | Endpoint | Aciklama |
|---|---|---|
| POST | /save |
Kategori ekleme |
| GET | /listAllCategories |
Tum kategorileri listeleme |
| GET | /list/{id} |
ID ile kategori getirme |
| PUT | /update/{id} |
Kategori guncelleme |
| DELETE | /delete/{id} |
Kategori silme |
| GET | /{categoryId}/books |
Kategoriye ait kitaplari listeleme |
Base path:
/rest/api/Publisher
| Method | Endpoint | Aciklama |
|---|---|---|
| POST | /save |
Yayinci ekleme |
| GET | /listAllPublishers |
Tum yayincilari listeleme |
| GET | /list/{id} |
ID ile yayinci getirme |
| PUT | /update/{id} |
Yayinci guncelleme |
| DELETE | /delete/{id} |
Yayinci silme |
| GET | /{publisherId}/books |
Yayinciya ait kitaplari listeleme |
Base path:
/api/loans
| Method | Endpoint | Aciklama |
|---|---|---|
| POST | /save |
Odunc kaydi olusturma |
| GET | /getAll |
Tum odunc kayitlarini listeleme |
| GET | /getLoan/{id} |
ID ile odunc kaydi getirme |
| PUT | /update/{id} |
Odunc kaydi guncelleme |
| DELETE | /delete/{id} |
Odunc kaydi silme |
Base path:
/users
| Method | Endpoint | Aciklama |
|---|---|---|
| GET | /me |
Giris yapan kullaniciyi getirir |
| GET | / |
Tum kullanicilari listeler |
| GET | /find-By-Id?id=... |
ID ile kullanici getirir |
| PUT | /update/{id} |
Kullanici gunceller |
| DELETE | /delete/{id} |
Kullanici siler |