Giter VIP home page Giter VIP logo

moodmelody_frontend's Introduction

MoodMelody Frontend

MoodMelody is a web application that provides personalized music recommendations based on your mood. The frontend is built with React and connects to a Flask backend that leverages GPT-4 for generating music suggestions and integrates with the Spotify API to create playlists.

Table of Contents

Getting Started

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v14 or later)
  • npm (v6 or later)
  • Git

Installation

  1. Clone the repository:

    git clone https://github.com/abecerrilsalas/MoodMelody_frontend.git
    cd MoodMelody_frontend
    
    
  2. Install dependencies:

     npm install
    
  3. Create a .env file in the root directory and add the following environment variables:

    NODE_ENV=development
    REACT_APP_API_URL=<backend-url>
    Replace <backend-url> with the URL of the Flask backend.
    

Running the Application

  1. Start the development server:

    npm start
    
    this will start the development server at `http://localhost:3000`.
    

Project Structure

The project structure is as follows:

moodmelody-frontend/
│
├── public/
│   ├── index.html
│   └── ...
│
├── src/
│   ├── assets/          # Images, logos, etc.
│   ├── components/      # Reusable components like Button, Header, Footer
│   ├── pages/           # Different pages of the application (Home, About, Playlist)
│   ├── App.js           # Main App component
│   ├── index.js         # Entry point of the React application
│   ├── App.css          # Global styles
│   ├── index.css        # Global styles
│   └── ...
│
├── .env                 # Environment variables
├── package.json         # Project metadata and dependencies
└── README.md            # This file

Features

  • Mood-based Music Recommendations: Enter your mood, and get a personalized playlist.
  • Spotify Integration: Directly save recommended playlists to your Spotify account.
  • Responsive Design: Optimized for various screen sizes using Flexbox and CSS Grid.
  • Persistent State: Retain user inputs and playlist selections when navigating through pages.

Technologies Used

  • React: JavaScript library for building user interfaces.
  • React Router: For navigation between pages.
  • Axios: For making API requests to the backend.
  • CSS: For layout management.
  • Jest and React Testing Library: For testing components and hooks.

Testing

To run tests, use the following command:

npm test

Mock API calls to avoid making actual requests during tests. Tests are located adjacent to their corresponding source files.

Deployment

Deployment with GitHub Pages (or any preferred service)

  1. Build the application:

    npm run build
    
  2. Set up Heroku CLI: If you haven't already, install the Heroku CLI and log in to your Heroku account using:

    heroku login
    
  3. Create a new Heroku app:

    heroku create <app-name>
    
  4. Set Heroku environment variables:

    heroku config:set REACT_APP_API_URL=<backend-url>  
    

Replace with the actual URL of your deployed backend.

  1. Deploy to Heroku:

    git add .
    git commit -m "Deploying to Heroku"
    git push heroku main
    

moodmelody_frontend's People

Contributors

abecerrilsalas avatar mariia-iureva avatar

Watchers

 avatar

Forkers

mariia-iureva

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.