An open API service indexing awesome lists of open source software.

https://github.com/sumitmadaan16/spring-security-demo

Spring Boot project with user registration, password encryption, and Basic Auth using Spring Security. Stateless session management, PostgreSQL integration, and clean layered architecture. Ideal for backend authentication demos.
https://github.com/sumitmadaan16/spring-security-demo

authentication backend backend-api java jwt jwt-authentication jwt-token postgresql rest-api restful-api spring-boot spring-mvc spring-security springboot

Last synced: about 2 months ago
JSON representation

Spring Boot project with user registration, password encryption, and Basic Auth using Spring Security. Stateless session management, PostgreSQL integration, and clean layered architecture. Ideal for backend authentication demos.

Awesome Lists containing this project

README

          

๐Ÿ“Œ GitHub Project Description

> ๐Ÿ” Spring Security Demo โ€” User Registration & Authentication
> A lightweight Spring Boot application showcasing secure user registration and Basic Authentication using Spring Security. Built with a PostgreSQL backend and designed for stateless session management,
> this project demonstrates how to encrypt passwords, authenticate users, and protect endpoints with minimal configuration.

๐Ÿš€ Features
- โœ… User registration with BCrypt password hashing
- ๐Ÿ” Basic Authentication for protected endpoints
- ๐Ÿงผ Stateless session management (`SessionCreationPolicy.STATELESS`)
- ๐Ÿ—ƒ๏ธ PostgreSQL integration via Spring Data JPA
- ๐Ÿง  Clean architecture with service, controller, and entity layers
- ๐Ÿงช Tested using Postman

๐Ÿ› ๏ธ Tech Stack
- Java 17
- Spring Boot 3.5
- Spring Security
- Spring Data JPA
- PostgreSQL
- Lombok

๐Ÿ“‚ Endpoints
| Method | Endpoint | Description | Auth Required |
|--------|--------------|----------------------------------|---------------|
| POST | `/register` | Register a new user | โŒ No |
| GET | `/greet` | Greet user by username | โœ… Yes |

โš™๏ธ Setup Instructions
1. Clone the repo
2. Create `application.properties` with your DB credentials
3. Run the app using `mvn spring-boot:run`
4. Test endpoints using Postman or curl

๐Ÿ“„ Sample `application.properties`
```properties
spring.datasource.url=jdbc:postgresql://localhost:5432/your_db
spring.datasource.username=your_username
spring.datasource.password=your_password
spring.jpa.hibernate.ddl-auto=update
```

๐Ÿ‘จโ€๐Ÿ’ป Author
**Sumit Madaan** โ€” Backend Developer & Security Enthusiast
exploring scalable backend architectures, authentication flows, and system design.