🏛️ Smithsonian Black History "Figure of the Day" API A Spring Boot backend application that integrates with the Smithsonian Open Access API to deliver randomized historical artifacts and figures from the National Museum of African American History and Culture (NMAAHC).
🚀 Key Features Resilient Architecture: Implements the Circuit Breaker pattern using Resilience4j to ensure the application remains stable even if the Smithsonian API is slow or down.
Complex Data Mapping: Utilizes modern Java Records and Jackson to deserialize deeply nested EDAN (Electronic Data Archive Network) JSON structures into a clean, type-safe DTO model.
Intelligent Randomization: Features a custom controller logic that transforms a bulk search response into a single, randomized "Historical Item of the Day" to engage users.
🛠️ Tech Stack Java 21 (using Records for concise DTOs)
Spring Boot 3.x
Resilience4j (Circuit Breaker)
Spring RestTemplate & UriComponentsBuilder
🏗️ Project Structure The project follows a clean, package-based architecture to ensure separation of concerns:
controller: Handles incoming requests and randomization logic.
service: Manages the API contract and Circuit Breaker configuration.
dto: Contains nested Records that mirror the Smithsonian's "Envelope" response structure.
🔌 API Endpoints GET /api/history Fetches a randomized artifact from the NMAAHC collection.
Example Response:
JSON { "title": "Receipt spindle from Mae's Millinery Shop", "content": { "freetext": { "notes": [{"label": "Description", "content": "A metal receipt spindle..."}], "name": [{"label": "Owned by", "content": "Mae Reeves"}] } } } ⚙️ Setup & Environment API Key: Obtain an API key from api.data.gov.
Environment Variable: Set your key as SMITHSONIAN_API_KEY in your IDE or system environment.
Run: Execute the Spring Boot application and visit http://localhost:8080/api/history.
📈 Future Roadmap AI Integration: Use the Codesmith SWE & AI curriculum to generate summarized "Historical Stories" from artifact descriptions.
Frontend UI: Build a React interface to display the museum images provided in the online_media links.