A comprehensive full-stack application featuring a Spring Boot backend with H2 in-memory database and Hibernate Search integration, paired with a React TypeScript frontend for user management with advanced search, filtering, and sorting capabilities.
- RESTful API with comprehensive Swagger/OpenAPI documentation
- H2 In-Memory Database for fast development and testing
- Hibernate Search with Lucene for advanced full-text search
- Resilient Data Loading with retry mechanisms and error handling
- Comprehensive Validation and exception handling
- External API Integration with DummyJSON for data loading
- High Test Coverage with unit and integration tests
- Clean Architecture with proper separation of concerns
- Modern React UI with TypeScript and Material-UI
- Real-time Search with debouncing and autocomplete
- Client-side Sorting by age, name (ascending/descending)
- Advanced Filtering by user roles
- Responsive Design that works on all device sizes
- Loading States and error handling with user feedback
- Lazy Loading techniques for optimal performance
- Single Page Application with smooth user experience
vicky/
βββ backend/ # Spring Boot Application
β βββ src/main/java/
β β βββ com/example/usermanagement/
β β βββ controller/ # REST Controllers
β β βββ service/ # Business Logic
β β βββ repository/ # Data Access Layer
β β βββ entity/ # JPA Entities
β β βββ dto/ # Data Transfer Objects
β β βββ config/ # Configuration Classes
β β βββ exception/ # Exception Handling
β βββ src/test/ # Unit Tests
β βββ pom.xml # Maven Dependencies
βββ frontend/ # React TypeScript Application
βββ src/
β βββ components/ # React Components
β βββ services/ # API Services
β βββ types/ # TypeScript Types
β βββ utils/ # Utility Functions
β βββ __tests__/ # Unit Tests
βββ package.json # NPM Dependencies
- Java 17 - Programming Language
- Spring Boot 3.2.0 - Application Framework
- Spring Data JPA - Data Access
- H2 Database - In-Memory Database
- Hibernate Search 7.0 - Full-Text Search
- Swagger/OpenAPI - API Documentation
- Spring Retry - Resilience Patterns
- JUnit 5 - Testing Framework
- Mockito - Mocking Framework
- JaCoCo - Code Coverage
- React 18 - UI Library
- TypeScript - Type Safety
- Material-UI (MUI) - Component Library
- Axios - HTTP Client
- React Testing Library - Testing
- Jest - Testing Framework
- Java 17 or higher
- Node.js 16 or higher
- Maven 3.6 or higher
- NPM or Yarn
-
Navigate to backend directory:
cd backend
-
Run the application:
mvn spring-boot:run
-
Access API Documentation:
- Swagger UI: http://localhost:8084/swagger-ui.html
- H2 Console: http://localhost:8084/h2-console
- API Docs: http://localhost:8084/api-docs
-
Navigate to frontend directory:
cd frontend
-
Install dependencies:
npm install
-
Start development server:
npm start
-
Access the application:
- Frontend: http://localhost:3000
GET /api/users
- Get all usersGET /api/users/{id}
- Get user by IDGET /api/users/email/{email}
- Get user by emailGET /api/users/search?q={searchTerm}
- Search users by name, lastName, or SSN
POST /api/data/load
- Load users from external DummyJSON APIGET /api/data/status
- Get data loading status
The application supports multiple search modes:
-
Full-Text Search (3+ characters):
- Uses Hibernate Search with Lucene indexing
- Searches across firstName, lastName, and SSN fields
- Supports wildcard matching and partial terms
-
Basic Search (1-2 characters):
- Uses JPA repository queries
- Case-insensitive LIKE queries
- Immediate results for short terms
-
Advanced Filtering:
- Client-side role-based filtering
- Dynamic filter combinations
- Real-time result updates
cd backend
mvn test # Run unit tests
mvn jacoco:report # Generate coverage report
Coverage reports are available at: target/site/jacoco/index.html
cd frontend
npm test # Run unit tests
npm run test:coverage # Run tests with coverage
Key configuration properties in application.yml
:
spring:
datasource:
url: jdbc:h2:mem:testdb
username: name
password: dfghjkl
jpa:
hibernate:
ddl-auto: create-drop
properties:
hibernate:
search:
backend:
type: lucene
api:
external:
dummyjson:
base-url: https://dummyjson.com
retry:
max-attempts: 3
delay: 1000
Environment variables in .env
:
REACT_APP_API_URL=http://localhost:8084/api
- Connection Pooling with HikariCP
- Lazy Loading for JPA entities
- Retry Mechanisms for external API calls
- Indexed Search with Lucene
- Pagination Support (ready for implementation)
- Debounced Search (300ms delay)
- Memoized Components for optimal re-renders
- Lazy Loading components
- Client-side Caching of search results
- Responsive Design with CSS-in-JS
-
Build the JAR file:
mvn clean package
-
Run the application:
java -jar target/user-management-api-0.0.1-SNAPSHOT.jar
-
Build the production bundle:
npm run build
-
Deploy the
build/
directory to your web server.
- Fork the repository
- Create a feature branch:
git checkout -b feature-name
- Commit your changes:
git commit -am 'Add feature'
- Push to the branch:
git push origin feature-name
- Submit a pull request
- Follow Clean Code principles
- Use SOLID design patterns
- Write comprehensive tests (aim for 80%+ coverage)
- Add proper logging for debugging
- Handle exceptions gracefully
- Validate all inputs
- Follow Atomic Design principles
- Use TypeScript for type safety
- Write unit tests for components
- Implement responsive design
- Handle loading states and errors
- Use semantic HTML for accessibility
- User authentication and authorization
- Real database integration (PostgreSQL/MySQL)
- Caching with Redis
- Microservices architecture
- GraphQL API
- Advanced search filters
- User profile management
- Audit logging
- Performance monitoring
- Docker containerization
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue in the repository
- Contact the development team
- Check the API documentation at http://localhost:8084/swagger-ui.html
Built with using Spring Boot and React