An open API service indexing awesome lists of open source software.

https://github.com/lizar22/fem-cloud-api

RESTful API built with Java via Spring Boot that lets you manage and explore quotes by feminist and pioneering women throughout history
https://github.com/lizar22/fem-cloud-api

api-rest database feminist-data feministech java jpa-hibernate maven mysql quotes-api restful-api spring-boot women-in-tech

Last synced: 3 months ago
JSON representation

RESTful API built with Java via Spring Boot that lets you manage and explore quotes by feminist and pioneering women throughout history

Awesome Lists containing this project

README

          

# πŸŸͺ FemCloud API

**FemCloud API** is a RESTful API built with **Spring Boot** that lets you manage and explore quotes by **feminist and pioneering women** throughout history. It's designed as a learning project and a tribute to the words and ideas that inspired generations of women and men.


## πŸ“š Table of Contents

- [πŸš€ Project Purpose](#-project-purpose)
- [✨ Thematic Focus](#-thematic-focus)
- [πŸ› οΈ Technologies & Tools](#️-technologies--tools)
- [πŸ—‚οΈ Project Structure](#️-project-structure)
- [πŸ“‹ Functional Requirements](#-functional-requirements)
- [πŸ”Œ API Endpoints](#-api-endpoints)
- [πŸ“¦ Example JSON for Creating/Updating a Quote](#-example-json-for-creatingupdating-a-quote)
- [⚠️ Error Handling](#️-error-handling)
- [πŸ§ͺ Testing with Postman](#-testing-with-postman)
- [βœ… Non-Functional Requirements](#-non-functional-requirements)
- [πŸ’‘ Possible Future Improvements](#-possible-future-improvements)
- [🧠 What I Learned](#-what-i-learned)
- [πŸ“ Suggested Directory Structure](#-suggested-directory-structure)
- [🧾 License](#-license)


## πŸš€ Project Purpose

This project helps you:

- Learn how to build a complete CRUD REST API using Spring Boot
- Understand the MVC architecture (Controller – Service – Repository)
- Connect a Spring Boot app to a **MySQL** database
- Practice API testing with **Postman**
- Promote historical and inspirational quotes from impactful women


## ✨ Thematic Focus

This API is dedicated to preserving and sharing **quotes by feminist thinkers, activists, and historical pioneers**.

Examples of influential women:

- **Simone de Beauvoir**
- **Wu Zetian**
- **Rosa Luxemburg**
- **Audre Lorde**
- **Christine de Pizan**
- **Clara Campoamor**
- **Aspasia of Miletus**
- **Frida Kahlo**
- **Angela Davis**
- **Nana Asma’u**
- **Olympe de Gouges**
- **Virginia Woolf**
- **Im Yunjidang**
- **Malala Yousafzai**
- **Qiu Jin**
- **Dolores IbΓ‘rruri**
- **Hypatia of Alexandria**

Quotes should reflect feminist thought, social change, human rights, or historical relevance.


## πŸ› οΈ Technologies & Tools

- βœ… Java 21
- βœ… Spring Boot
- βœ… MySQL
- βœ… Jakarta Bean Validation
- βœ… Maven
- βœ… IntelliJ IDEA
- βœ… Postman
- βœ… Git & GitHub
- βœ… Trello (for task tracking)


## πŸ—‚οΈ Project Structure

The project follows a clean **3-layer MVC architecture**:

```
src/
β”œβ”€β”€ main/
β”‚ └── java/com/femcloudapi
β”‚ β”œβ”€β”€ controllers
β”‚ β”œβ”€β”€ dtos
β”‚ β”œβ”€β”€ exceptions
β”‚ β”œβ”€β”€ models
β”‚ β”œβ”€β”€ repositories
β”‚ └── services
β”œβ”€β”€ resources/
β”‚ └── application.properties
β”‚ └── data.sql
β”œβ”€β”€ test/
β”‚ └── application-mysql.properties

````


## πŸ“‹ Functional Requirements

- [x] View all quotes
- [x] View a quote by ID
- [x] Create a new quote
- [x] Update an existing quote
- [x] Delete a quote


## πŸ”Œ API Endpoints

| Method | Endpoint | Description |
| ------ | -------------- | -------------------------- |
| GET | `/quotes` | Get all quotes |
| GET | `/quotes/{id}` | Get a specific quote by ID |
| POST | `/quotes` | Add a new quote |
| PUT | `/quotes/{id}` | Update an existing quote |
| DELETE | `/quotes/{id}` | Delete a quote |


## πŸ“¦ Example JSON for Creating/Updating a Quote

```json
{
"text": "I am not free while any woman is unfree, even when her shackles are very different from my own.",
"author": "Audre Lorde",
"year": 1981
}
```


## ⚠️ Error Handling

When a quote is not found by ID, the API responds with a structured JSON error and a `404` status code:

```json
{
"message": "Quote not foud with id 99",
"status": 404,
"errorCode": "PRODUCT_NOT_FOUND",
"path": "/quotes/99",
"timestamp": "2025-07-20 23:49:18"
}
```

This is handled via a custom exception `QuoteNotFoundException`, a `GlobalExceptionHandler` and an `ErrorResponse` class.


## πŸ§ͺ Testing with Postman

1. Run the application with your IDE (e.g., IntelliJ, VS Code)
2. Use Postman to test all API endpoints
3. Ensure your MySQL database is running and configured
4. Update `application.properties` or `application.yml` with correct DB settings


## βœ… Non-Functional Requirements

* Clean MVC architecture
* Connection to MySQL database
* Clean and maintainable code
* Error handling with custom messages
* Manual API testing via Postman
* Input validation using `@Valid`


## πŸ’‘ Possible Future Improvements

* Pagination and search by author
* Swagger/OpenAPI documentation
* Spring Security authentication


## 🧠 What I Learned

* Building REST APIs with Spring Boot
* Use of `JpaRepository` for CRUD operations
* Structuring code using MVC pattern
* Error handling using custom exceptions
* Testing endpoints with Postman
* Integration tests via H2 and Mysql profiles


## πŸ“ Suggested Directory Structure

```
src/
β”œβ”€β”€ main/
β”‚ └── java/com/femcloudapi
β”‚ β”œβ”€β”€ controllers
β”‚ β”œβ”€β”€ dtos
β”‚ β”œβ”€β”€ exceptions
β”‚ β”œβ”€β”€ models
β”‚ β”œβ”€β”€ repositories
β”‚ └── services
β”œβ”€β”€ resources/
β”‚ └── application.properties
β”‚ └── data.sql
└── test/
β”‚ └── application-mysql.properties
```


## 🧾 License

This project is part of the FemCoders educational program.


## πŸ™Œ Created with πŸ’œ by Lizar22

FemCloud API is more than just a CRUD project β€” it's a tribute to feminist voices and an essential part of my Spring Boot learning journey, combining backend development practice with the creation of powerful, respectful software.