A modern single-page application built with Angular 19 and Bootstrap 5 for the frontend, backed by Spring Boot 3.3 with Spring Security 6 for the API.
- Java 21 (LTS)
- Spring Boot 3.3 with Spring Security 6
- Stateless JWT-style token authentication
- HSQLDB in-memory database (for demo purposes)
- JPA/Hibernate for persistence
- JUnit 5 for testing
- Angular 19 with standalone components
- Bootstrap 5.3 for styling
- TypeScript 5.7
- Angular CLI for builds
The application is split into two modules:
- API - Spring Boot REST backend (stateless, token-based auth)
- Client - Angular SPA frontend
- Java 21 or higher
- Maven 3.8+
- Node.js 22 (optional - Maven downloads it automatically)
mvn clean packageThis builds both the API and client modules.
cd api
mvn spring-boot:runThe API will be available at http://localhost:8080/api
cd client
npm install
npm startThe client dev server runs at http://localhost:4200 with API proxy to http://localhost:8080.
The API uses stateless token-based authentication:
- Login with Basic Auth to
/api/auth/login - Receive a token in the
X-AUTH-TOKENresponse header - Include the token in subsequent requests via
X-AUTH-TOKENheader
| Username | Password |
|---|---|
| user@tester.com.au | password |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /api/auth/login |
Login (Basic Auth) | No |
| GET | /api/user |
Get current user | Yes |
| GET | /api/customer |
List all customers | Yes |
| GET | /api/customer/{id} |
Get customer by ID | Yes |
| POST | /api/customer |
Create customer | Yes |
| PUT | /api/customer/{id} |
Update customer | Yes |
| DELETE | /api/customer/{id} |
Delete customer | Yes |
cd api
mvn clean verify # Run tests
mvn spring-boot:run # Run with hot reloadcd client
npm install # Install dependencies
npm start # Dev server with hot reload
npm run build # Production build
npm run test # Run unit testsIntelliJ IDEA is recommended. Import the project as a Maven project.
For the frontend, ensure the Angular Language Service plugin is installed.
angular_bootstrap_spring/
├── api/ # Spring Boot backend
│ ├── src/main/java/
│ │ └── au/com/example/
│ │ ├── Application.java # Spring Boot entry point
│ │ ├── spring/ # Security & config
│ │ ├── controller/ # REST controllers
│ │ ├── service/ # Business logic
│ │ ├── repository/ # Data access
│ │ └── entity/ # JPA entities
│ └── src/main/resources/
│ ├── application.properties
│ └── data.sql # Sample data
├── client/ # Angular frontend
│ ├── src/app/
│ │ ├── components/ # Angular components
│ │ ├── services/ # HTTP services
│ │ ├── guards/ # Route guards
│ │ └── models/ # TypeScript interfaces
│ └── angular.json
└── pom.xml # Parent POM
Robert Leggett
If you find this project helpful, consider supporting further development:
