A full-stack application for managing products, built with Spring Boot 3 and Angular 17. This application demonstrates best practices in modern web development, including security, performance optimization, and maintainable code structure.
- π Secure authentication with JWT
- π¦ Product management (CRUD operations)
- π€ File upload capabilities
- π Data validation and error handling
- π± Responsive design
- π Advanced search and filtering
- π Performance monitoring
- π§ͺ Comprehensive test coverage
- Spring Boot 3.2.3
- Spring Security with JWT
- Spring Data JPA
- PostgreSQL
- Maven
- JUnit 5
- Swagger/OpenAPI
- Angular 17
- Angular Material
- RxJS
- NgRx (State Management)
- Jest
- Cypress
- Docker and Docker Compose
- JDK 17
- Node.js 18+
- Maven 3.8+
- Git
- PostgreSQL (if running without Docker)
-
Clone the repository:
git clone https://github.com/yourusername/starter-kit-java-angular.git cd starter-kit-java-angular -
Create a
.envfile in the root directory:# Database Configuration DB_USER=postgres DB_PASSWORD=postgres DB_NAME=product_management DB_PORT=5432 # JWT Configuration JWT_SECRET=your-256-bit-secret JWT_EXPIRATION=86400000 # Application Configuration SPRING_PROFILES_ACTIVE=dev SERVER_PORT=8080
-
Start the application:
docker compose up -d
-
Access the application:
- Frontend: http://localhost:4200
- Backend API: http://localhost:8080/api
- Swagger UI: http://localhost:8080/swagger-ui.html
- Database: localhost:5432
-
Navigate to the backend directory:
cd backend -
Configure the database in
application.properties:spring.datasource.url=jdbc:postgresql://localhost:5432/product_management spring.datasource.username=${DB_USER} spring.datasource.password=${DB_PASSWORD}
-
Build and run the application:
./mvnw clean install ./mvnw spring-boot:run
-
Navigate to the frontend directory:
cd frontend -
Install dependencies:
npm install
-
Configure environment variables in
src/environments/environment.ts:export const environment = { production: false, apiUrl: 'http://localhost:8080/api' };
-
Start the development server:
npm start
- Backend follows Google Java Style Guide
- Frontend follows Angular Style Guide
- Use Prettier for code formatting
- ESLint for TypeScript/JavaScript linting
-
Create a feature branch from
develop:git checkout -b feature/your-feature-name
-
Make your changes and commit:
git commit -m "feat: add new feature" -
Push to remote:
git push origin feature/your-feature-name
-
Create a Pull Request to
develop
cd backend
./mvnw testcd frontend
npm testcd frontend
npm run e2eThe project uses GitHub Actions for continuous integration and deployment. The pipeline includes:
-
Build and Test
- Builds and tests the backend with Maven
- Builds and tests the frontend with npm
- Runs linting checks
- Generates code coverage reports
-
Security Scan
- Dependency vulnerability check
- Code security analysis
- Container security scan
-
Build and Push Docker Images
- Builds Docker images for both backend and frontend
- Pushes images to GitHub Container Registry
- Tags images with version and latest
-
Deployment
- Staging: Deploys to staging environment on merge to main
- Production: Deploys to production environment on tag creation
- Automated rollback on failure
DB_USER: Database usernameDB_PASSWORD: Database passwordJWT_SECRET: JWT signing keySTAGING_HOST: Staging server hostnameSTAGING_USER: Staging server usernameSTAGING_SSH_KEY: SSH private key for staging serverPROD_HOST: Production server hostnamePROD_USER: Production server usernamePROD_SSH_KEY: SSH private key for production server
.
βββ backend/ # Spring Boot application
β βββ src/
β β βββ main/
β β β βββ java/ # Java source code
β β β βββ resources/ # Configuration files
β β βββ test/ # Test files
β βββ Dockerfile # Backend Dockerfile
β βββ pom.xml # Maven configuration
βββ frontend/ # Angular application
β βββ src/
β β βββ app/ # Application code
β β βββ assets/ # Static assets
β β βββ environments/ # Environment configs
β βββ Dockerfile # Frontend Dockerfile
β βββ package.json # npm configuration
βββ .github/ # GitHub Actions workflows
βββ docker-compose.yml # Docker Compose configuration
βββ README.md # Project documentation
The API documentation is available through Swagger UI at http://localhost:8080/swagger-ui.html when running the application.
Key endpoints:
POST /api/auth/login: User authenticationGET /api/products: List all productsPOST /api/products: Create a new productPUT /api/products/{id}: Update a productDELETE /api/products/{id}: Delete a product
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
Please follow our Contributing Guidelines for more details.
Common issues and their solutions:
-
Database Connection Issues
- Check if PostgreSQL is running
- Verify database credentials in
.env - Ensure database exists
-
JWT Authentication Issues
- Verify JWT_SECRET in environment
- Check token expiration
- Ensure proper token format
-
Build Issues
- Clear Maven cache:
./mvnw clean - Clear npm cache:
npm cache clean --force - Delete node_modules:
rm -rf node_modules
- Clear Maven cache:
This project is licensed under the MIT License - see the LICENSE file for details.
For support, please:
- Check the documentation
- Search existing issues
- Create a new issue if needed
- Spring Boot Team
- Angular Team
- All contributors