|
| 1 | +# Unicorn Store: A Spring Boot REST API for Managing Unicorns |
| 2 | + |
| 3 | +The Unicorn Store is a robust Spring Boot application that provides a RESTful API for managing unicorns. It offers CRUD operations for unicorn entities, integrates with AWS services, and uses PostgreSQL for data persistence. |
| 4 | + |
| 5 | +## Project Description |
| 6 | + |
| 7 | +The Unicorn Store is designed to showcase best practices in building a modern, cloud-native Spring Boot application. It leverages several key technologies and patterns: |
| 8 | + |
| 9 | +- **Spring Boot**: Provides the core framework for building the application, including dependency injection, web services, and data access. |
| 10 | +- **PostgreSQL**: Used as the primary database for storing unicorn information. |
| 11 | +- **AWS SDK**: Integrates with various AWS services, including EventBridge for event publishing, S3 for object storage, and DynamoDB for NoSQL data storage. |
| 12 | +- **Docker**: The application can be containerized for easy deployment and scaling. |
| 13 | +- **Testcontainers**: Enables integration testing with a real PostgreSQL database running in a container. |
| 14 | + |
| 15 | +Key features of the Unicorn Store include: |
| 16 | + |
| 17 | +- RESTful API for creating, reading, updating, and deleting unicorn entities |
| 18 | +- Event publishing to AWS EventBridge for each unicorn operation |
| 19 | +- Comprehensive integration tests using RestAssured and Testcontainers |
| 20 | +- Support for native compilation using GraalVM |
| 21 | +- Configurable deployment options, including Docker and Cloud Native Buildpacks |
| 22 | + |
| 23 | +The application demonstrates how to build a scalable, cloud-ready microservice that can be easily deployed and integrated into a larger ecosystem of services. |
| 24 | + |
| 25 | +## Infrastructure |
| 26 | + |
| 27 | +The Unicorn Store application uses the following key infrastructure components: |
| 28 | + |
| 29 | +1. PostgreSQL Container (for testing): |
| 30 | + - Type: PostgreSQLContainer |
| 31 | + - Image: postgres:16.4 |
| 32 | + - Database Name: unicorns |
| 33 | + - Username: postgres |
| 34 | + - Password: postgres |
| 35 | + |
| 36 | +This container is defined in the `ContainersConfig` class and is used for integration testing. It ensures that tests run against a real PostgreSQL instance, improving the reliability of the test suite. |
| 37 | + |
| 38 | +Note: In a production environment, you would typically use a managed PostgreSQL service or a dedicated PostgreSQL server instead of a container. |
0 commit comments