Skip to content

Commit 78e21f4

Browse files
author
Yuriy Bezsonov
committed
initial java25 version of unicorn-store-spring
1 parent 93e883a commit 78e21f4

36 files changed

Lines changed: 4120 additions & 0 deletions
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM public.ecr.aws/docker/library/maven:3-amazoncorretto-25-al2023 AS builder
2+
3+
RUN yum install -y shadow-utils
4+
5+
COPY store-spring.jar store-spring.jar
6+
7+
RUN groupadd --system spring -g 1000
8+
RUN adduser spring -u 1000 -g 1000
9+
10+
USER 1000:1000
11+
12+
EXPOSE 8080
13+
ENTRYPOINT ["java","-jar","-Dserver.port=8080","/store-spring.jar"]
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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

Comments
 (0)