Skip to content

Harshal-Bhangale/Entry-Level-Java-Challenge

Repository files navigation

Entry-Level Java Challenge — Employee API

About

A minimal, production-focused REST API built with Spring Boot for managing employee data. Demonstrates clean architecture with DTOs, layered services, and Gradle-driven build conventions—ready for integration with third-party platforms.

Features: 3 REST endpoints (list, retrieve, create employees) | In-memory repository | DTO separation | Spotless formatting enforcement | Java 21.

-- Quick links

Features

  • REST endpoints for listing, retrieving (by UUID), and creating employees
  • Simple in-memory repository for demonstration and tests
  • Clear DTO separation: CreateEmployeeRequest and EmployeeResponse
  • Formatting enforced by Spotless and shared Gradle conventions

Prerequisites

  • JDK 21 installed
  • Gradle wrapper is included — recommended usage via the provided wrapper scripts

Quickstart

From the repository root run:

Windows PowerShell

.\gradlew.bat :api:bootRun

Build (includes formatting check):

.\gradlew.bat build

Format code (applies Spotless rules):

.\gradlew.bat spotlessApply

API Endpoints

See docs/API.md for a complete reference including request/response examples and sample curl commands.

Project Layout

  • api/ — Spring Boot application module
    • src/main/java/com/challenge/api — application sources
      • controller/ — REST controllers
      • service/ — business logic
      • repository/ — in-memory data store for demo
      • model/ — domain model objects
      • dto/ — API request/response objects
    • src/main/resources/application.yml — app configuration
  • buildSrc/ — shared Gradle conventions (Spotless, versions)
  • gradle/wrapper — wrapper binaries configuration

Coding structure

Below is a concise coding-structure view showing where to find responsibilities in the codebase:

entry-level-java-challenge-master/
├─ api/
│  ├─ src/main/java/com/challenge/api/
│  │  ├─ controller/        # HTTP endpoints (EmployeeController)
│  │  ├─ service/           # Business logic (EmployeeService)
│  │  ├─ repository/        # Data access / in-memory store
│  │  ├─ model/             # Domain objects (Employee, EmployeeImpl)
│  │  └─ dto/               # API request/response DTOs
│  └─ src/main/resources/   # app configuration (application.yml)
├─ buildSrc/                # Shared Gradle conventions (Spotless, plugin rules)
└─ gradle/wrapper/           # Gradle wrapper configuration

Guidelines:

  • Keep controllers thin: delegate validation and business rules to service.
  • Service layer contains orchestration and policies; repository is a lightweight data store for this exercise.
  • Use DTOs for all external-facing request/response objects to keep the internal model stable.
  • Run ./gradlew.bat spotlessApply before committing to ensure consistent formatting.

Development notes

  • Keep the API stable: prefer adding new DTOs rather than changing existing response shapes.
  • Spotless is configured in buildSrc — run spotlessApply before committing.

API Testing

The REST API endpoints were tested using Postman.

📬 Postman Collection:
Employee Management API Collection

Contributing

See docs/CONTRIBUTING.md for coding style and commit guidance.


If you'd like, I can now: (a) start the app and run the three endpoints automatically, or (b) add a minimal test suite to exercise endpoints. Which do you prefer?

About

Employee Management REST API built with Java 21, Spring Boot, and Gradle. The project demonstrates RESTful API development, layered architecture (Controller-Service-Repository), clean coding practices, dependency injection, and in-memory employee management.

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages