StorySpark brings storytelling to life for children with an interactive web application featuring AI-narrated adventures. Designed for young users, the platform allows kids to choose a story, make decisions that shape the narrative, and listen as their unique tale is told through real-time, high-quality audio.
- Story Catalogue: A welcome screen presents users with a selection of available stories to begin their adventure.
- Interactive Narrative: The story progresses based on the user's choices, leading to different branches and outcomes.
- AI-Powered Narration: Leverages the Murf.ai API to convert story text into speech, providing an immersive audio experience.
- WebSocket Audio Streaming: Audio data is streamed directly to the client as it's generated, ensuring smooth and immediate playback.
- Responsive UI: A clean and simple interface built with React and Tailwind CSS that works on various screen sizes.
The project is a monorepo containing two separate packages: a React frontend and a Node.js backend.
- Runtime: Node.js
- Server: Express.js
- Real-time Communication:
ws(WebSockets) - API Integration: Murf.ai for Text-to-Speech
- Environment Management:
dotenv
- Library: React
- Build Tool: Vite
- Styling: Tailwind CSS
- API Communication: Axios
To run this project on your local machine, please follow the steps below.
- Node.js (version 18.x or higher)
npmpackage manager- A valid API key from Murf.ai
-
Clone the Repository
git clone [https://github.com/257divyanshu/storyspark.git](https://github.com/257divyanshu/storyspark.git) cd storyspark -
Configure the Backend
- Navigate to the server directory:
cd storyspark-server - Install the required dependencies:
npm install
- Create a new file named
.envin this directory. Add your Murf.ai API key to this file:# storyspark-server/.env MURF_API_KEY="YOUR_API_KEY_HERE"
- Navigate to the server directory:
-
Configure the Frontend
- Navigate to the client directory from the project root:
cd storyspark-client - Install the required dependencies:
npm install
- Navigate to the client directory from the project root:
You will need two separate terminal windows to run both the backend and frontend services.
-
Start the Backend Server (Terminal 1)
# In the storyspark-server/ directory npm startThe server will start on
http://localhost:3001. -
Start the Frontend Application (Terminal 2)
# In the storyspark-client/ directory npm run devThe Vite development server will start. Open your web browser to the URL it provides (usually
http://localhost:5173).
The frontend is configured with a proxy, so all API and WebSocket requests will be correctly forwarded to your local backend server.
This application was successfully deployed on Render.
- The backend is deployed as a Web Service.
- The frontend is deployed as a Static Site.
Environment variables were configured in the Render dashboard to manage the Murf API key and the production URLs for the client and server to communicate.