77[ ![ PostgreSQL] ( https://img.shields.io/badge/PostgreSQL-15-blue?logo=postgresql )] ( https://www.postgresql.org/ )
88[ ![ License] ( https://img.shields.io/badge/License-MIT-yellow )] ( LICENSE )
99
10- A REST API built with Spring Boot that fetches random users from [ Random User API] ( https://randomuser.me/ ) and stores them in PostgreSQL.
10+ A REST API built with Spring Boot that fetches users from [ DummyJSON Users API] ( https://dummyjson.com/users ) and stores them in PostgreSQL.
1111
1212** [ Quick Start] ( #-quick-start ) • [ API Docs] ( #-api-documentation ) • [ Architecture] ( #-architecture ) **
1313
@@ -58,6 +58,14 @@ POSTGRES_DB=your_database
5858POSTGRES_PORT=5432
5959```
6060
61+ ### External API Configuration
62+
63+ ` application.properties ` uses:
64+
65+ ``` properties
66+ dummy.api.base-url =https://dummyjson.com/
67+ ```
68+
6169### Profiles
6270
6371- ** default** : PostgreSQL (production)
@@ -73,18 +81,18 @@ POSTGRES_PORT=5432
7381
7482### Endpoints
7583
76- | Method | Path | Description | Status |
77- | --------| ------| -------------| --------|
78- | ` GET ` | ` /random-users?count=500 ` | Fetch and save random users | ✅ |
79- | ` GET ` | ` /random-users/{id} ` | Get user by ID | ✅ |
80- | ` POST ` | ` /random-users ` | Create a new user | ✅ |
81- | ` PUT ` | ` /random-users/{id} ` | Update user | ✅ |
82- | ` DELETE ` | ` /random-users/{id} ` | Delete user | ✅ |
84+ | Method | Path | Description | Status |
85+ | --------| -------------------------- | -------------| --------|
86+ | ` GET ` | ` /random-users?count=30 ` | Fetch and save users from external API | ✅ |
87+ | ` GET ` | ` /random-users/{id} ` | Get user by ID | ✅ |
88+ | ` POST ` | ` /random-users ` | Create a new user | ✅ |
89+ | ` PUT ` | ` /random-users/{id} ` | Update user | ✅ |
90+ | ` DELETE ` | ` /random-users/{id} ` | Delete user | ✅ |
8391
8492### Example Request
8593
8694``` bash
87- # Fetch 10 random users
95+ # Fetch 10 users from external API and store them
8896curl -X GET " http://localhost:8080/random-users?count=10"
8997
9098# Get user by ID
@@ -168,6 +176,16 @@ curl -X PUT "http://localhost:8080/random-users/1" \
168176 PostgreSQL
169177```
170178
179+ ### Domain Service Ports
180+
181+ - ` LocalUserService ` : local persistence operations (save, read, delete) backed by PostgreSQL.
182+ - ` RemoteUserService ` : external user source contract used by use cases.
183+
184+ ### External Source Adapter
185+
186+ - ` DummyUserApi ` : Retrofit client contract for DummyJSON endpoints.
187+ - ` DummyUserServiceImpl ` : adapter that calls ` DummyUserApi ` , maps DTOs, and returns ` PaginatedUsers ` .
188+
171189### Project Structure
172190
173191```
@@ -327,14 +345,15 @@ error: release version 25 not supported
327345
328346## 🌐 External API
329347
330- This project integrates with ** Random User Generator API** :
348+ This project integrates with ** DummyJSON Users API** :
331349
332- - ** URL** : https://randomuser.me/api/
333- - ** Documentation** : https://randomuser.me/documentation
350+ - ** Base URL** : https://dummyjson.com/
351+ - ** Users Endpoint** : https://dummyjson.com/users
352+ - ** Documentation** : https://dummyjson.com/docs/users
334353- ** Features** :
335- - Generate random users
336- - Filter by nationality
337- - Customize response fields
354+ - Paginated user retrieval ( ` limit ` , ` skip ` )
355+ - Stable JSON schema for user fixtures
356+ - Fast sandbox API for development/testing
338357
339358---
340359
@@ -365,7 +384,7 @@ This project is licensed under the **MIT License** - see the [LICENSE](LICENSE)
365384## 🔗 Useful Links
366385
367386- [ Spring Boot Documentation] ( https://spring.io/projects/spring-boot )
368- - [ Random User API Docs] ( https://randomuser.me/documentation )
387+ - [ DummyJSON Users API Docs] ( https://dummyjson.com/docs/users )
369388- [ PostgreSQL Documentation] ( https://www.postgresql.org/docs/ )
370389- [ Docker Documentation] ( https://docs.docker.com/ )
371390- [ SonarQube Documentation] ( https://docs.sonarqube.org/ )
0 commit comments