talesmousinho / user-demo

A practical exercise to demonstrate proficiency in REST API development.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Project: User Demonstration REST Endpoint

This project is a technical challenge to implement CRUD operations through the development of a REST API for user management, it serves as a practical exercise to demonstrate proficiency in REST API development.

Index

Summary

This project is a technical challenge to implement CRUD operations through the development of a REST API for user management.
The API receives and returns values in JSON format. It allows users to create, read, update, and delete User entities. Each User entity has a name, surname, and birthdate.
The API is built using Java 17, Spring Boot 2.7, and an in-memory database. It is designed to be easy to set up and run, with detailed instructions provided in the "How to Run" section.

Features

The system provides the following features:

  • Get all users, with pagination and sorting
  • Get user by ID
  • Create new user
  • Modify user
  • Delete user

Entities

  • User
    • ID
    • Name
    • Lastname
    • Created At (DB Entity level)
    • Updated At (DB Entity level)

Requirements

The API is built with Java 17, Spring Boot 2.7, Spring JPA, and H2 Database.

Issues

The development of this project was organized into the following tasks, each represented by a GitHub issue:

  1. Implement User Entity with Basic Attributes
  2. Create Endpoint to Retrieve All Users
  3. Create Endpoint to Retrieve a User by ID
  4. Create Endpoint to Add a New User
  5. Create Endpoint to Update User Information
  6. Create Endpoint to Delete a User
  7. Create JUnit Tests for User Controller Endpoints
  8. Add Swagger UI for API Documentation

How to Run

Prerequisites

  • Java 17
  1. Clone the repository to your local machine.
git clone git@github.com:talesmousinho/user-demo.git
  1. Navigate to the project directory.
cd user-demo/
  1. Build the project using Maven.
./mvnw clean install
  1. Run the Spring Boot application.
java -jar target/user-demo-server-0.0.1-SNAPSHOT.jar

The application will start running at http://localhost:8080.

Swagger UI

Swagger UI is integrated for easy testing and interaction with the API. To access Swagger UI, once the application is running, visit http://localhost:8080/swagger-ui.html in your web browser.

About

A practical exercise to demonstrate proficiency in REST API development.


Languages

Language:Java 100.0%