Skip to content
sankethreddy-404Public

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

38 Commits

Folders and files

Repository files navigation

🚀 Spring Boot Backend Application

A production-style Spring Boot REST API built as part of a
30 Days Backend Development Challenge, focusing on real-world backend concepts.


🛠 Tech Stack

  • Java 17
  • Spring Boot
  • Spring Security
  • JWT (JSON Web Token)
  • Spring Data JPA
  • MySQL
  • Hibernate
  • Maven

✨ Features Implemented

🔐 Authentication & Security

  • JWT-based authentication
  • Login & token generation
  • Custom UserDetailsService
  • JwtFilter for request validation
  • Secure password storage using BCrypt

👥 Authorization

  • Role-based access control:
    • ADMIN
    • USER
  • API-level restrictions using roles
  • Users can update only their own data
  • Admin has full access

🧩 User Management

  • Create user
  • Update user
  • Get user by ID
  • Get all users (Admin only)
  • Bulk user creation
  • Secure email-based authentication

📄 Pagination, Sorting & Search

  • Pagination (page, size)
  • Sorting (sortBy, sortDir)
  • Keyword-based search:
    • Search by name
    • Search by email

⚡ Performance Optimization

  • Database indexes added on:
    • email
    • name
  • Optimized queries for faster search & pagination

🧾 Global Exception Handling

  • Centralized exception handling
  • Custom exceptions
  • Proper HTTP status codes
  • Clean error responses

📂 Project Structure

src/main/java/com/backend/demo │ ├── controller ├── service ├── repository ├── security ├── filter ├── mapper ├── entity ├── exception └── dto


🔑 JWT Flow

  1. User logs in with email & password

  2. Server generates JWT token

  3. Token sent in header: Authorization: Bearer

  4. JwtFilter validates token

  5. Access granted based on role


📌 Sample API

GET /users?page=0&size=5&sortBy=id&sortDir=asc&keyword=san


🗄 Database Indexes

CREATE INDEX idx_user_email ON users(email);
CREATE INDEX idx_user_name ON users(name);

🧪 Testing
Tested using Postman
JWT & role-based access verified
Unauthorized access handled properly

📈 Status
✅ Completed till Day 29

🚧 Day 30: Final polish & interview prep

👤 Author
Sanketh Reddy
Backend Developer | Java | Spring Boot
Learning in public 🚀

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages