A RESTful API providing a collection of Yoruba proverbs with their translations and wisdom insights.
# Yoruba Proverb API
A RESTful API providing a collection of Yoruba proverbs with their translations and wisdom insights.
## About
This API serves traditional Yoruba proverbs from Nigeria, complete with English translations and explanations of their wisdom. Yoruba proverbs are an important part of the cultural heritage and contain deep philosophical insights and practical wisdom.
## Features
- Get a random proverb
- Fetch a specific proverb by ID
- JSON response format with proverb text, translation, and wisdom explanation
- Email subscription for receiving proverbs
- Welcome emails for new subscribers
- Batch email delivery of proverbs to subscribers
## Tech Stack
- Node.js
- Express.js
- TypeScript
- Docker (optional)
## API Endpoints
### Base URL
```
localhost
```
### Routes
| Method | Endpoint | Description |
| ------ | --------------------- | -------------------------------------------- |
| GET | `/` | Welcome message |
| GET | `/proverb` | Fetch a random proverb |
| GET | `/proverb/:id` | Fetch a specific proverb by ID |
| POST | `/subscribe` | Subscribe to receive proverb emails |
| GET | `/unsubscribe` | Unsubscribe from proverb emails |
| POST | `/admin/send-proverb` | Send proverbs to all subscribers (protected) |
### Response Format
```json
{
"id": 1,
"proverb": "Ká dijú ká ṣe bí ẹní kú, ká wo ẹni tí yóò sunkún ẹni; ká sáré ṣẹ́ṣẹ́ ká fẹsẹ̀ kọ, ká wo ẹni tí yóò ṣeni pẹ̀lẹ́.",
"translation": "Close your eyes and feign death to see who'll mourn you; run and be ensure you trip to see those who truly care.",
"wisdom": "Adversities often show true friends."
}
```
### Subscription Request Format
```json
{
"email": "user@example.com",
"name": "John Doe"
}
```
### Email Features
The API includes email functionality using Resend:
1. **We …