Skip to content

allyelvis/musicgenerator

Repository files navigation

Here is a README.md file:

# Music Lyrics Generator App

This project is a Firebase and React-based web application that allows users to generate song lyrics using AI. The backend is powered by Firebase Functions, integrated with OpenAI's GPT model to generate lyrics based on a user's input.

## Features

- Generate song lyrics based on user prompts
- Different music styles such as Pop, Jazz, Classical, etc.
- Deployed on Firebase Hosting
- Backend integrated with OpenAI using Firebase Functions

## Project Structure

```bash
.
├── functions/          # Backend Firebase Functions
│   ├── index.js        # Firebase Function for generating lyrics
│   ├── package.json    # Backend dependencies
├── public/             # Public folder for hosting files
├── src/                # React frontend files
├── .firebaserc         # Firebase project configuration
├── firebase.json       # Firebase configuration for hosting and functions
├── README.md           # Project documentation
└── .gitignore          # Ignore unnecessary files in version control

Prerequisites

To work with this project, ensure you have the following installed:

Setup and Installation

Follow these steps to get the project running locally and deploy it to Firebase.

Step 1: Clone the Repository

git clone https://github.com/allyelvis/musicgenerator.git
cd musicgenerator

Step 2: Install Firebase CLI and Login

npm install -g firebase-tools
firebase login

Step 3: Initialize Firebase Functions

Go to the functions directory and install necessary dependencies:

cd functions
npm install

Make sure to replace the openai.apiKey in index.js with your own OpenAI API key.

Step 4: Run Firebase Locally

You can emulate Firebase functions locally using the Firebase CLI:

firebase emulators:start

To call the function locally:

curl -X POST http://localhost:5001/<your-project-id>/us-central1/generateLyrics -d '{"prompt":"Compose a reflective song for times of sadness, calm."}'

Step 5: Deploy Firebase Functions

Once everything is set up, deploy the Firebase Functions and hosting:

firebase deploy --only functions,hosting

This will deploy the backend to Firebase Functions and your app to Firebase Hosting.

Firebase Function: Generate Song Lyrics

The Firebase Function to generate song lyrics is located in functions/index.js. It uses OpenAI's API to generate song lyrics based on user prompts.

Example Request:

{
  "prompt": "Compose a reflective song for times of sadness, calm."
}

Example Response:

{
  "lyrics": "In the quiet of the night, when all is still and calm..."
}

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributions

Feel free to fork this project, open issues, or submit pull requests for improvements and fixes.


Author

Developed by Ally Elvis Nzeyimana.


### Instructions:
1. **Replace**: Be sure to replace `your-repository-url`, `your-project-id`, and `your-username` with your actual GitHub repository, Firebase project ID, and username.
2. **API Key**: Remind users to add their OpenAI API Key when they work on the project.

Let me know if you need more customization for this `README.md`!

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •