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

https://github.com/rahulrmcoder/moonlight-tales

Moonlight Tales is an AI-powered web app that creates funny and heartwarming bedtime stories for children based on a single sentence or idea. With a beautifully illustrated interface and playful storytelling, this app brings joy, laughter, and life lessons to kids β€” one story at a time.
https://github.com/rahulrmcoder/moonlight-tales

Last synced: 8 months ago
JSON representation

Moonlight Tales is an AI-powered web app that creates funny and heartwarming bedtime stories for children based on a single sentence or idea. With a beautifully illustrated interface and playful storytelling, this app brings joy, laughter, and life lessons to kids β€” one story at a time.

Awesome Lists containing this project

README

          

# πŸŒ™ Moonlight Tales

**Where AI Magic Meets Bedtime Wonder**

Moonlight Tales is an AI-powered web app that creates funny and heartwarming bedtime stories for children based on a single sentence or idea. With a beautifully illustrated interface and playful storytelling, this app brings joy, laughter, and life lessons to kids β€” one story at a time.

---

## 🧠 Powered by Lyzr Agent

This project connects to a Lyzr AI inference agent that generates creative bedtime stories on demand using the following endpoint:

```
POST https://agent-prod.studio.lyzr.ai/v3/inference/chat/
```

**Headers:**

```
Content-Type: application/json
x-api-key: sk-default-iPEOmf2biknSikwsVOh0xbDtT5nNkUx6
```

**Example Payload:**

```json
{
"user_id": "rahulrajasekharanmenon64325@gmail.com",
"agent_id": "#",
"session_id": "#",
"message": "A curious girl finds a talking sock in her laundry basket"
}
```

---

## ✨ Features

- 🎨 Cute, animated bedtime-themed UI (clouds, stars, moon)
- πŸ§’ Child-friendly fonts (e.g., Comic Neue, Baloo 2)
- πŸ’‘ Single sentence input to generate full story
- πŸ“– Storybook-style display with soft scrolling or flipping
- 🌈 Gentle moral or life lesson in every tale
- 🎡 Optional toggle for soothing background music
- πŸ“± Fully responsive and mobile-friendly

---

## 🌈 Tech Stack

- **Frontend**: HTML, CSS, JavaScript or React
- **Styling**: Tailwind CSS (for pastel tones, smooth UI)
- **Font**: Google Fonts - Comic Neue / Baloo
- **API**: Lyzr Agent (AI backend)
- **Audio**: Howler.js (optional background music)

---

## πŸš€ How to Use

1. **Clone the repository**

```bash
git clone https://github.com/RahulRmCoder/moonlight-tales.git
cd moonlight-tales
```

2. **Install dependencies**

```bash
npm install
```

3. **Set your environment variables**

Create a `.env` file and add your key:

```env
VITE_LYZR_API_KEY=sk-default-iPEOmf2biknSikwsVOh0xbDtT5nNkUx6
```

4. **Run the development server**

```bash
npm run dev
```

---

## πŸ“ Project Structure

```
moonlight-tales/
β”œβ”€β”€ public/ # Static assets (images, sounds)
β”œβ”€β”€ src/
β”‚ β”œβ”€β”€ components/ # InputBox, StoryDisplay, etc.
β”‚ β”œβ”€β”€ styles/ # Tailwind or CSS files
β”‚ β”œβ”€β”€ App.jsx
β”‚ └── main.jsx
β”œβ”€β”€ .env
β”œβ”€β”€ index.html
β”œβ”€β”€ package.json
└── README.md
```

---

## πŸ§ͺ Sample API Call (cURL)

```bash
curl -X POST 'https://agent-prod.studio.lyzr.ai/v3/inference/chat/' \
-H 'Content-Type: application/json' \
-H 'x-api-key: sk-default-iPEOmf2biknSikwsVOh0xbDtT5nNkUx6' \
-d '{
"user_id": "rahulrajasekharanmenon64325@gmail.com",
"agent_id": "#",
"session_id": "#",
"message": "A giraffe who wants to touch the moon"
}'
```

---

## 🌟 Example Input β†’ Output

**Input:**
`A shy dragon wants to become a stand-up comedian`

**Generated Story:**
> Once upon a time in the giggle-filled valley of Burniebelly, a shy dragon named Drako discovered a love for telling jokes. Every time he tried to breathe fire, he sneezed sparkles instead…

(Continues with a moral at the end.)

---

## πŸ“œ License

This project is licensed under the MIT License.

---

## 🌠 Ending Note

> β€œSweet dreams are made of stories.”
Bring imagination to life and make bedtime magical β€” one sentence at a time.