{"id":26085996,"url":"https://github.com/lokeshkarra/springboot-auth-performance","last_synced_at":"2026-04-11T17:02:34.937Z","repository":{"id":281396773,"uuid":"944976982","full_name":"lokeshkarra/springboot-auth-performance","owner":"lokeshkarra","description":"Spring Boot Authentication Rest API","archived":false,"fork":false,"pushed_at":"2025-03-08T19:26:15.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-08T20:24:53.275Z","etag":null,"topics":["java","jmeter","postgresql","spring","spring-boot","spring-data-jpa","springsecurity"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lokeshkarra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-08T11:16:58.000Z","updated_at":"2025-03-08T19:30:04.000Z","dependencies_parsed_at":"2025-03-08T20:35:28.431Z","dependency_job_id":null,"html_url":"https://github.com/lokeshkarra/springboot-auth-performance","commit_stats":null,"previous_names":["lokeshkarra/springboot-auth-performance"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lokeshkarra%2Fspringboot-auth-performance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lokeshkarra%2Fspringboot-auth-performance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lokeshkarra%2Fspringboot-auth-performance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lokeshkarra%2Fspringboot-auth-performance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lokeshkarra","download_url":"https://codeload.github.com/lokeshkarra/springboot-auth-performance/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242656038,"owners_count":20164431,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","jmeter","postgresql","spring","spring-boot","spring-data-jpa","springsecurity"],"created_at":"2025-03-09T06:33:20.839Z","updated_at":"2025-12-05T17:01:59.345Z","avatar_url":"https://github.com/lokeshkarra.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring Security REST API\n\n## 📌 Overview\nThis is a **Spring Boot REST API** secured with **Spring Security**, implementing user authentication and authorization using `UsernamePasswordAuthenticationToken`. The API provides both **public** and **protected** endpoints, enforcing security measures like password hashing and session management.\n\n## ✨ Features\n- ✅  User authentication with **Spring Security**\n- ✅  **BCrypt password encoding** for secure storage\n- ✅  Role-based access control (**RBAC**) for API endpoints\n- ✅  JWT authentication (future enhancement possible)\n- ✅  Stateless session management with **SessionCreationPolicy**\n- ✅  Custom authentication entry point\n\n\n## 🏗️ Tech Stack\n- ☕ **Java 17+**\n- 🏗 **Spring Boot**\n- 🔐 **Spring Security**\n- 🗄 **Spring Data JPA**\n- 🛢 **Postgres Database**\n- 🐘 **Hibernate**\n- 🛠 **Maven**\n\n\n## 🚀 Getting Started\n### 1️⃣ Clone the Repository\n```sh\n git clone https://github.com/your-username/spring-security-rest-api.git\n cd spring-security-rest-api\n```\n\n### 2️⃣ Configure the Application\nModify `application.properties` for database and security settings.\n\n### 3️⃣ Build \u0026 Run the Project\n```sh\nmvn clean install\njava -jar target/SpringSecurityRestAPI-0.0.1-SNAPSHOT.ja\n```\n\n## 🔑 API Endpoints\n### **Authentication**\n| Method | Endpoint | Description |\n|--------|-------------|------------------------------|\n| `POST` | `/api/auth/signup` | Registers a new user |\n| `POST` | `/api/auth/login` | Authenticates and returns token |\n\n### **Public Endpoints**\n| Method | Endpoint | Access |\n|--------|-------------|-------------|\n| `GET`  | `/public_resource` | ✅ Open to all |\n\n### **Protected Endpoints**\n| Method | Endpoint | Access |\n|--------|----------------|----------------------|\n| `GET`  | `/secret_resource` | 🔒 Requires authentication |\n\n## 🔥 Security Configuration\nSpring Security is configured in `SecurityConfig.java` to:\n- **Allow public access** to `/public_resource` \u0026 `/api/auth/**`\n- **Secure all other endpoints**, requiring authentication\n- **Encrypt passwords** using `BCryptPasswordEncoder`\n- **Manage sessions** as per security best practices\n\n## 💡 Performance and Load Testing\n### **Overview**\nPerformance and load testing were conducted on the **/signup** endpoint to evaluate response times, error rates, and system behavior under concurrent requests.\n\n### **Testing Tool**\n- **JMeter** was used for simulating multiple concurrent users and measuring performance metrics.\n\n### **Test Scenario**\n- **Endpoint Tested:** `/signup`\n- **Total Requests:** 6000\n- **Request Type:** HTTP POST\n- **Database Connection:** HikariCP (Connection Pooling)\n\n### **Performance Metrics**\n| Metric | Value |\n|--------|-------|\n| **Total Samples** | 6000 |\n| **Average Response Time** | 5465 ms |\n| **Min Response Time** | 78 ms |\n| **Max Response Time** | 18915 ms |\n| **Standard Deviation** | 3809.88 ms |\n| **Error Rate** | 0.00% |\n| **Throughput** | 84.3 requests/sec |\n| **Received KB/sec** | 29.63 KB |\n| **Sent KB/sec** | 24.17 KB |\n| **Average Bytes** | 360.0 bytes |\n\n### **Key Observations**\n1. **High Response Time:** The average response time is relatively high, which may indicate potential bottlenecks in database queries or backend processing.\n2. **Large Variability in Response Time:** The high standard deviation suggests inconsistent performance due to load spikes or inefficient resource allocation.\n3. **No Errors Recorded:** The error rate is 0.00%, meaning all requests were processed successfully.\n4. **Throughput Limitations:** The system processes 84.3 requests per second, which may not be sufficient for high-traffic applications.\n\n### **Potential Performance Bottlenecks \u0026 Recommendations**\n- **Optimize Database Queries:** Use indexing and optimize JOIN operations.\n- **Enhance Connection Pooling:** Properly configure HikariCP pool size and fix JDBC URL issues.\n- **Improve API Scalability:** Implement caching and consider asynchronous processing.\n- **Conduct Further Testing:** Perform stress testing and analyze heap memory usage.\n\n\n\n\n\n## 🤝 Contributing\nPull requests are welcome! Feel free to submit issues for improvements.\n\n---\n🚀 **Happy Coding!**\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flokeshkarra%2Fspringboot-auth-performance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flokeshkarra%2Fspringboot-auth-performance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flokeshkarra%2Fspringboot-auth-performance/lists"}