https://github.com/amadr-95/swagger-account-api
API with Swagger Documentation designed to manage user accounts
https://github.com/amadr-95/swagger-account-api
api-rest java postgresql spring-boot swagger
Last synced: about 2 months ago
JSON representation
API with Swagger Documentation designed to manage user accounts
- Host: GitHub
- URL: https://github.com/amadr-95/swagger-account-api
- Owner: amadr-95
- Created: 2023-05-03T12:22:01.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-05-03T09:23:58.000Z (about 2 years ago)
- Last Synced: 2025-06-30T00:03:13.911Z (about 1 year ago)
- Topics: api-rest, java, postgresql, spring-boot, swagger
- Language: Java
- Homepage:
- Size: 188 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Spring Boot REST CRUD API with Swagger Documentation
This example demonstrates how to build a Spring Boot REST CRUD API using Maven, leveraging Spring Data JPA/Hibernate to
interact with a PostgreSQL database. Additionally, the API endpoints are documented using Swagger 3 annotations.
## Overview
We'll be developing a REST CRUD API for an Account management application. Each Account in the system consists of the
following attributes: _userId, name, username, password, email, and createdOn date_
The API provides the following functionalities:
- CRUD operations for managing accounts.
- Custom finder methods such as searching by name or email domain
## API Endpoints
The API exposes the following endpoints
| Method | URL | Description |
|--------|-----------------------------------|----------------------------------------------------------|
| GET | /api/accounts[/:name] | Retrieve all accounts, optionally filtered by name. |
| GET | /api/accounts/filter/:id | Retrieve an account by ID. |
| GET | /api/accounts/filter/:username | Retrieve an account by username. |
| GET | /api/accounts/filter/:email | Retrieve an account by email. |
| GET | /api/accounts/filter/:domain | Retrieve accounts matching the provided email domain. |
| POST | /api/accounts | Add a new account. |
| PUT | /api/accounts/update/username/:id | Update the username of an account with the specified ID. |
| PUT | /api/accounts/update/email/:id | Update the email of an account with the specified ID. |
| DELETE | /api/accounts/delete/:id | Delete an account by ID. |
| DELETE | /api/accounts/delete | Delete all accounts. |
## Swagger UI
You can explore and interact with these endpoints using Swagger UI, accessible
at: http://localhost:8080/accounts-management
