In the fast-paced world of software development, setting up a Spring Boot project from scratch can be time-consuming. Configuring database connections, JWT authentication, email services, and AOP (Aspect-Oriented Programming) often feels repetitive.
That's where the Spring Boot Advanced Starter Pack comes inโ-โan all-in-one pre-configured boilerplate designed to save time and let you focus on building your application's core features.
๐ GitHub Repository: Spring Boot Advanced Starter Pack
๐ Portfolio: aligorithm.dev
๐ What is Spring Boot Advanced Starter Pack?
This repository serves as an advanced starting point for Spring Boot projects, featuring pre-built configurations for:
โ
Database Integration (PostgreSQL and SQL Server)
โ
Spring Security with JWT & Refresh Token Mechanism
โ
Email Services Integration (Gmail SMTP or any other email service)
โ
CORS Configuration for Development and Production
โ
Aspect-Oriented Programming (AOP) for Logging
โ
Global Exception Handling
It eliminates boilerplate code and repetitive configuration, empowering developers to kickstart projects faster and more efficiently.
๐ ๏ธ Getting Started
๐ 1. Prerequisites
- Ensure the following are installed on your system:
- Java 17
- Gradle (recommended version: 8.10.2)
- PostgreSQL or SQL Server
- Gmail Account(or use any email provider, including your organization's email) for email integration
๐ 2. Clone the Repository
git clone https://github.com/Aligorithm-97/SpringBootAdvancedStarterPack.git
cd SpringBootAdvancedStarterPack
๐ก๏ธ 3. Database Setup
๐ PostgreSQL Configuration
- Install PostgreSQL and create a database using pgAdmin.
- Update application-dev.properties:
spring.datasource.url=jdbc:postgresql://<host>:<port>/<database>
spring.datasource.username=<your-username>
spring.datasource.password=<your-password>
๐๏ธ SQL Server Configuration
- Update application-dev.properties:
spring.datasource.url=jdbc:sqlserver://<your-sql-server-url>:<port>;databaseName=<database>
spring.datasource.username=<your-username>
spring.datasource.password=<your-password>
๐ง 4. Email Integration
- Generate an App Password in your Gmail account (or use any email provider, including your organization's email).
- Update the following in application-dev.properties:
spring.mail.mailUsername=<your-email>
spring.mail.mailPassword=<app-password>
- Add the frontend activation URL:
application.mailing.frontend.activation-url=http://<your-ui-url>/activate
๐ 5. CORS Configuration
- By default, CORS allows all origins during development.
- For production, specify allowed origins in BeansConfig:
configuration.setAllowedOrigins(Arrays.asList(<your-domain-or-ip>));
๐ ๏ธ 6. Troubleshooting Common Issues
- Ensure Lombok is installed and enabled in your IDE.
- For IntelliJ IDEA: Go to File > Settings > Plugins โ Install Lombok if not already installed.
- Enable Annotation Processing under: File > Settings > Build, Execution, Deployment > Compiler > Annotation Processors
๐ฆ Key Features
๐ 1. Database Integration
- Pre-configured support for both PostgreSQL and SQL Server.
- Simple configuration updates for environment-specific setups.
๐ 2. Spring Security with JWT
- Implements JWT (JSON Web Token) authentication for secure API endpoints.
- Refresh Token Mechanism: Automatically renew tokens without requiring re-authentication.
- Well-structured endpoints for token management.
๐ 3. CORS Configuration
- Flexible CORS settings for development and production.
- Customize BeansConfig for domain-specific rules.
๐ง 4. Email Integration
- Seamless integration with Gmail's SMTP server.
- Suitable for sending account activation emails and notifications.
๐ 5. Aspect-Oriented Programming (AOP)
- Built-in logging with AOP for cross-cutting concerns.
- Tracks application behavior effectively.
๐ฆ 6. Global Exception Handling
- Centralized error handling for better consistency.
- Ensures clear and structured error responses.
๐ ๏ธ 7. Environment Support
- Developed using Java 17.
- Managed via Gradle for optimized dependency control and builds.
๐ค Contribution Guide
Your contributions are welcome! Whether it's fixing bugs, improving documentation, or suggesting new features:
Fork the repository.
Create a new branch: git checkout -b feature-branch.
Submit a pull request with your changes.
๐ฃ Feedback & Support
Have questions, feedback, or suggestions? Open an issue on the GitHub Repository.
๐ฏ Final Thoughts & Future Plans
The Spring Boot Advanced Starter Pack is more than just a boilerplateโ-โit's a robust foundation for building scalable, secure, and efficient Spring Boot applications. Start your next project with confidence and save countless hours on repetitive configurations.
In 2025, this project will be officially published as a Spring Boot Starter Dependency, enabling seamless integration with a single dependency declaration in your build.gradle or pom.xml file.
For updates, improvements, and more open-source projects like this, make sure to:
โญ Follow me on GitHub: aligorithm
๐ Explore my portfolio: aligorithm.dev
Thank you for your support, and happy coding! ๐โจ
Top comments (0)