Guides development of a full-stack Spring Data showcase application with Spring Boot backend and Angular frontend, featuring comprehensive repository patterns, REST APIs, and Material UI.
Guide development of a full-stack Spring Data showcase application demonstrating Spring Data JPA features with a Spring Boot backend and Angular Material frontend.
This is a full-stack Spring Data showcase with two main components:
**Backend (`backend/`):**
**Frontend (`frontend/`):**
When working with the Spring Boot backend:
```bash
cd backend && mvn spring-boot:run
mvn test
mvn clean package
```
When working with the Angular frontend:
```bash
cd frontend && ng serve
npm install
ng build
ng test
ng generate component components/component-name
```
The ProductRepository demonstrates various Spring Data query method patterns:
The backend implements these endpoint patterns:
| Method | Endpoint | Purpose |
|--------|----------|---------|
| GET | `/api/products` | Get all products |
| GET | `/api/products/paged` | Paginated products with sorting |
| GET | `/api/products/{id}` | Get product by ID |
| POST | `/api/products` | Create new product |
| PUT | `/api/products/{id}` | Update product |
| DELETE | `/api/products/{id}` | Delete product |
| GET | `/api/products/category/{category}` | Filter by category |
| GET | `/api/products/search?name=` | Search by name |
| GET | `/api/products/search/keyword?keyword=` | Search by keyword |
| GET | `/api/products/price-range?minPrice=&maxPrice=` | Filter by price range |
The Angular frontend demonstrates:
1. **Repository Layer**: Add query methods following Spring Data naming conventions
2. **Service Layer**: Keep business logic separate from controllers
3. **Controller Layer**: Use proper HTTP methods and status codes
4. **Error Handling**: Implement proper validation and exception handling
5. **Testing**: Write unit tests for repositories and integration tests for endpoints
1. **Components**: Keep components focused and reusable
2. **Services**: Centralize API calls in services
3. **Material UI**: Use Angular Material components consistently
4. **Forms**: Use reactive forms with proper validation
5. **State Management**: Keep component state minimal and focused
```
backend/
├── src/main/java/
│ └── com/example/showcase/
│ ├── model/ # JPA entities
│ ├── repository/ # Spring Data repositories
│ ├── service/ # Business logic
│ └── controller/ # REST endpoints
└── src/main/resources/
└── application.properties # Configuration
frontend/
├── src/app/
│ ├── components/ # Angular components
│ ├── services/ # HTTP services
│ └── models/ # TypeScript interfaces
└── angular.json # Angular configuration
```
**Backend:**
**Frontend:**
When extending this showcase:
1. Add more complex query examples (Specifications, QueryDSL)
2. Implement additional Spring Data features (Projections, Auditing)
3. Add authentication/authorization examples
4. Demonstrate caching strategies
5. Show performance optimization techniques
6. Add GraphQL endpoint examples
7. Implement real-time updates with WebSockets
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/spring-data-jpa-showcase-development/raw