Skip to content

Asmit159/TalentCore-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

76 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TalentCore API

A Secure, Scalable Full-Stack Employee Management System built with Spring Boot and React.

Overview

TalentCore API is a production-ready backend service designed to manage employee data with a strong emphasis on clean architecture, security, and real-world API design principles.

While the project originated as part of a Spring Boot REST learning module, it has been deliberately extended beyond tutorial scope to reflect industry-grade backend development practices. The project now includes a modern React frontend dashboard that integrates directly with the backend API, turning the system into a complete full-stack employee management platform.

The result is a robust system that demonstrates how enterprise applications are typically built, secured, validated, documented, and integrated with a frontend client. This repository focuses on clarity, correctness, and extensibility rather than shortcuts or framework magic.


Project Goals

The primary objectives of this project were to:

  • Design a clean, layered backend architecture.
  • Implement a complete RESTful API with proper HTTP semantics.
  • Enforce data integrity and validation at multiple layers.
  • Secure endpoints using Spring Security and BCrypt.
  • Build a responsive frontend dashboard to interact with the API.
  • Expose APIs with clear, interactive documentation.
  • Build something maintainable, not just functional.

System Architecture

The system now follows a full-stack architecture, where a React frontend communicates with a Spring Boot backend API.

flowchart TD

%% Client Layer
A[User / Web Browser]

%% Frontend Layer
A --> B[React Frontend Dashboard]
B -->|HTTP REST Requests| C[Spring Boot REST API]

%% Security Layer
C --> D[Spring Security Filter Chain]
D --> E[HTTP Basic Authentication]
E --> F[CustomUserDetailsService]

%% Controller Layer
C --> G[EmployeeRestController]
C --> H[AuthController]

%% Service Layer
G --> I[EmployeeService]
H --> J[UserService]

%% DTO Layer
I --> K[EmployeeMapper]
K --> L[EmployeeDTO]

%% Persistence Layer
I --> M[EmployeeRepository]
J --> N[UserRepository]

%% Database Layer
M --> O[(Employee Table)]
N --> P[(Users Table)]

%% Exception Handling
G -.-> Q[Global Exception Handler]
I -.-> Q

%% Documentation
C -.-> R[Swagger / OpenAPI]
R -.-> S[Swagger UI]
Loading

Architecture Explanation

The application follows a clean layered architecture with clearly defined responsibilities.

Frontend Layer

The React dashboard provides a user interface for interacting with the backend API. Responsibilities include:

  • User authentication
  • Employee CRUD operations
  • Searching and filtering employees
  • Pagination and sorting
  • Form validation before requests
  • Displaying API responses and errors
  • Providing a responsive UI for managing data

Backend Layer

The Spring Boot backend follows the architecture: Controller β†’ Service β†’ Repository β†’ Database

  • Controllers: Expose REST endpoints and handle HTTP request/response mapping.
  • Services: Contain all business logic and enforce validation rules.
  • Repositories: Use Spring Data JPA to handle persistence and database interaction.
  • DTO Layer: Prevent direct exposure of database entities and ensure API contracts remain stable.

Security Layer

Authentication is handled by Spring Security. Features include:

  • HTTP Basic Authentication
  • BCrypt password hashing
  • Secure credential storage
  • Authentication required for protected endpoints

The Spring Security filter chain intercepts all requests before they reach the controller layer.


Core Features

Employee Management

  • Full CRUD operations for employees.
  • Partial updates using HTTP PATCH.
  • Pagination and sorting support for large datasets.
  • Unique email enforcement at the database level.
  • DTO-based API responses to prevent over-exposure.
  • Integrated frontend interface for managing employees.

Frontend Dashboard

A modern React-based UI allows users to interact with the backend API:

  • Secure login interface.
  • Employee directory dashboard.
  • Add / edit / delete employees.
  • Table-based employee management UI.
  • Search and sorting functionality.
  • Pagination support.
  • Visual feedback for API responses.
  • Responsive layout.

Validation & Error Handling

  • Field-level validation using Jakarta Validation.
  • Centralized exception handling with structured JSON responses.
  • Proper HTTP status codes for all failure scenarios.
  • Graceful handling of invalid input and edge cases.

Security

  • Spring Security integration.
  • BCrypt password hashing.
  • User registration endpoint.
  • Role-based user model.
  • Protected employee endpoints via authentication.

API Documentation

  • OpenAPI / Swagger integration.
  • Interactive API exploration via Swagger UI.
  • Auto-generated request/response schemas.
  • Downloadable OpenAPI specification.

Deployment

  • The Backend has been deployed using Railway
  • The Frontend has been deployed using Vercel
  • The Entire System is Deployed

Technology Stack

Backend

  • Language: Java 25
  • Framework: Spring Boot 4
  • Persistence: Spring Data JPA
  • Database: MySQL
  • Security: Spring Security, BCrypt

Frontend

  • Framework: React
  • Language: JavaScript
  • State Management: React Hooks
  • HTTP Client: Fetch API
  • UI: Custom dashboard components

Tooling

  • Build Tool: Maven
  • API Documentation: Springdoc OpenAPI / Swagger
  • Testing & Debugging: Postman, Swagger UI

Getting Started

Prerequisites

  • JDK 25 or higher
  • Maven 3.8+
  • Node.js 18+
  • MySQL 8.0+

Installation

  1. Clone the repository
    git clone [https://github.com/Asmit159/TalentCore-API.git](https://github.com/Asmit159/TalentCore-API.git)
    cd TalentCore-API\

2. Configure Backend Database

Update src/main/resources/application.properties with your MySQL credentials:

spring.datasource.url=jdbc:mysql://localhost:3306/talentcore_db
spring.datasource.username=root
spring.datasource.password=your_password

3. Run Backend

mvn clean install
mvn spring-boot:run
  • Backend URL: http://localhost:8080

4. Run Frontend

Navigate to the frontend directory:

cd frontend
npm install
npm run dev

Frontend URL: https://talent-core-api-asmit159s-projects.vercel.app Backend API: https://talentcore-api-production.up.railway.app

πŸ“‘ API Endpoints

Employee API

Method Endpoint Description
GET /api/employees Retrieve all employees
GET /api/employees/{id} Retrieve employee by ID
POST /api/employees Create a new employee
PUT /api/employees/{id} Update an existing employee
PATCH /api/employees/{id} Partially update an employee
DELETE /api/employees/{id} Delete an employee
GET /api/employees/paged Paginated & sorted listing

Authentication API

Method Endpoint Description
POST /api/auth/register Register a new user

πŸ“– API Documentation

Swagger UI is available for testing all endpoints and viewing request/response schemas:


πŸ“‚ Repository Structure

backend/
└── src/main/java/com/luv2code/springboot/cruddemo
    β”œβ”€β”€ controller    # REST Controllers
    β”œβ”€β”€ service       # Business Logic
    β”œβ”€β”€ repository    # Data Access (JPA)
    β”œβ”€β”€ entity        # Database Models
    β”œβ”€β”€ dto           # Data Transfer Objects
    β”œβ”€β”€ exception     # Custom Exception Handling
    β”œβ”€β”€ security      # Security Configuration
    └── config        # App Configurations

frontend/
└── src
    β”œβ”€β”€ components    # Reusable UI components
    β”œβ”€β”€ pages         # View components
    β”œβ”€β”€ api           # Axios/Fetch services
    └── App.jsx       # Main application entry


πŸ›  Future Enhancements

  • JWT-based authentication
  • Role-based endpoint authorization (RBAC)
  • Refresh tokens & Rate limiting
  • Integration tests with Testcontainers
  • CI/CD pipelines
  • Cloud deployment (AWS / GCP)

πŸ‘€ Author

Asmit Mandal Backend Developer | Java & Spring Boot

Feedback, suggestions, and discussions are always welcome. ⭐ If you find this project useful, consider starring the repository!


πŸ“„ License

This project is licensed under the AGPL-3.0 License

About

Spring Boot REST API for Employee management with CRUD operations, service-layer architecture, validation, global exception handling, pagination/sorting, and search filters.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors