https://github.com/unit2795/cat-facts
https://github.com/unit2795/cat-facts
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/unit2795/cat-facts
- Owner: Unit2795
- Created: 2024-06-10T20:10:06.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-13T13:26:54.000Z (about 2 years ago)
- Last Synced: 2025-01-22T18:14:01.478Z (over 1 year ago)
- Language: TypeScript
- Homepage: https://cat-facts-one.vercel.app
- Size: 347 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Cat Facts Sample Application
Demonstrator application that displays random cat facts, built using Next.js. There are two pages; the homepage where you can generate individual facts and a bulk facts page where you can generate multiple facts at once. Click on a fact in the bulk facts page to visit that specific fact.
## Live Site
https://cat-facts-one.vercel.app/
## Features
- Generate random cat facts, bookmark your favorites
- Click a fact in the bulk facts page to visit that specific fact
- Responsive & accessible design, with support for reduced motion
- Animated navbar, facts, and buttons
- Internal route handlers for fact API
## Development
First, run the development server:
```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```
## API Endpoints
- /api/v1/fact - returns a random cat fact
- /api/v1/fact?id=ID - returns a specific cat fact by ID
- /api/v1/facts - returns multiple cat facts
- /api/v1/facts?amount=amount - returns multiple cat facts with a set amount
### Example Response
The response will either be a single object or an array of objects, depending on the endpoint.
```
{
"data": {
"_id": 193,
"text": "The Japanese Bobtail's tail resembles a rabbit's tail."
}
}
```
## Images
Home Page:

Bulk Facts Page:
