A RESTful API built with Spring Boot that allows managing phrases, authors, and categories. The project follows a clean, modular architecture in Java, using layered design with controllers, services, repositories, DTOs, and entities.
- Features
- Architecture
- Technologies Used
- How to Run
- Available Endpoints
- Project Structure
- Error Handling
- Future Enhancements
- Acknowledgments
- Team
- Motivational phrase management
- CRUD operations for authors, phrases, and categories
- Custom exception handling
- DTO-level input validation
- Layered architecture using Spring Boot
- Structured and controlled API responses
- Ready to be connected to frontend or Postman tests
The project follows a layered architecture:
MFPSB/
├── controller/ # REST Controllers
├── service/ # Business Logic
├── repository/ # JPA Data Access
├── dto/ # Data Transfer Objects
├── entity/ # JPA Entities
├── exceptions/ # Custom Exceptions & Global Handler- Java 21
- Spring Boot
- Spring Web
- Spring Data JPA
- Maven
- Lombok
- MySQL (based on config)
- JDK 21
- Maven installed
- IDE (IntelliJ, VSCode, Eclipse)
- Clone or unzip the project
- Configure
application.propertiesinsidesrc/main/resources(if needed) - Run from IDE or terminal:
mvn spring-boot:run- API will be available at:
http://localhost:8080
Note: Endpoints are grouped by resource type.
GET /phrases– Get all phrasesGET /phrases/{id}– Get a phrase by IDPOST /phrases– Create new phrasePUT /phrases/{id}– Update phraseDELETE /phrases/{id}– Delete phraseGET /phrases/author– Get all phrases by authorGET /phrases/category– Get all phrases by category
GET /authors– List authorsPOST /authors– Create author
GET /categories– List categoriesPOST /categories– Create category
src/
├── main/
│ ├── java/com/MyFirstProjectSpringBoot/MFPSB/
│ │ ├── controller/
│ │ ├── service/
│ │ ├── repository/
│ │ ├── dto/
│ │ ├── entity/
│ │ ├── exceptions/
│ │ └── MfpsbApplication.java
│ └── resources/
│ └── application.propertiesIncludes centralized error management via GlobalExceptionHandler and custom exceptions like:
EmptyListExceptionAuthorIsExistingExceptionCategoryIsExistingExceptionPhraseAlreadyExistExceptionNoIdPhraseFoundException
- Swagger/OpenAPI documentation
- Authentication & Authorization (JWT)
- Connect to external DB (MySQL/PostgreSQL)
- Pagination in list endpoints
- Unit & integration testing
- Spring Boot Team
- Factoria F5
- Open Source Community
Thanks for using MFPSB! 🚀