Production ready Spring Boot login system with email verification, PostgreSQL persistence, Docker native builds, and Azure deployment
- A Spring Boot project focusing on secure login, email verification, and role based access control.
- Runs on a PostgreSQL database (deployed on Azure) and uses GraalVM native images for performance.
- GitHub Actions handles the CI/CD pipeline, automatically building and deploying Docker images to Azure.
- CI/CD automation: Built a GitHub Actions pipeline to compile GraalVM native images and deploy Docker containers to Docker Hub and Azure App Service
- Spring Security: Managed authentication, password encryption (BCrypt), and role based access control
- Native Image Builds: Leveraged GraalVM & Spring AOT for significantly optimized runtime performance
- Database Integration: Connection to PostgreSQL on Azure using Spring Data JPA
- Email SMTP: Asynchronous sending of account confirmation links
I built this project to get hands-on experience with a production grade Java stack used in real world backend systems
You can try the live version of this app here:
https://login.hossainsafwan.com
- Demonstrates a secure, production ready setup
- Configured for real world cloud environments with proper handling of secrets via environment variables
- Built to scale, with features like login, email confirmation, and performance focused native builds
To run the app locally:
# Clone the repo
git clone https://github.com/Safwan-Hossain/Spring-Login-Service.git
# Enter the directory
cd Spring-Login-Service
# Run with Maven (ensure port 8080 is free)
./mvnw spring-boot:run
Once the app is running, go to http://localhost:8080/login to access the login page.
Configuration settings are organized across these property files:
File | Purpose |
---|---|
application.properties |
Shared default properties |
application-local.properties |
Uses H2 Database and disables email sending |
application-prod.properties |
For Production (PostgreSQL on Azure + Email Service) |
By default, when you run the app locally:
- The
local
profile is active - The app uses H2 database (in memory)
- Email sending is disabled
Update the following files:
Key configuration options include:
spring.datasource.*
-> PostgreSQL connection settingsemail.enabled
->true
to enable email confirmationspring.mail.*
-> SMTP server credentialsemail.from
-> The sender email address for outgoing mail
Planned improvements for future:
- OAuth2 Login: Support Google login alongside email/password
- Unit Testing: Add JUnit tests using Jacoco for code coverage
- Error Pages: Improve feedback with more custom error views