Skip to content

๐Ÿ”’ Production ready Spring Boot login system with email verification, PostgreSQL persistence, Docker native builds, and Azure deployment

License

Notifications You must be signed in to change notification settings

Safwan-Hossain/Spring-Login-Service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

79 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Spring Login Service ๐Ÿ”’

Dockerized Azure Build Last Commit Spring Boot

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.

UI Demo

๐Ÿ“š Table of Contents

๐Ÿ’ผ Overview

  • 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

๐ŸŒ Live Demo

You can try the live version of this app here: ๐Ÿ‘‰ https://login.hossainsafwan.com

๐Ÿ“Œ Why It Matters

  • 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

๐Ÿ“ฆ Getting Started

Make sure Java 17+ and Maven are installed

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

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)

๐Ÿ”ง Default Behavior (Local)

By default, when you run the app locally:

  • The local profile is active
  • The app uses H2 database (in memory)
  • Email sending is disabled

๐Ÿ“ง To Enable PostgreSQL & Email

Update the following files:

Key configuration options include:

  • spring.datasource.* -> PostgreSQL connection settings
  • email.enabled -> true to enable email confirmation
  • spring.mail.* -> SMTP server credentials
  • email.from -> The sender email address for outgoing mail

๐Ÿ”ฎ Future Updates

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

Releases

No releases published

Packages

No packages published