This is the backend repository for MusicBase, a web application for searching artists, albums, and songs. The app is build with Node.js, Express.js and MySQL.
- See a live version of the frontend https://osman-butt.github.io/musicbase-frontend/
- The frontend respository of this project is managed in a separate repository: https://github.com/osman-butt/musicbase-frontend.
- Link to deployed backend https://musicbase-app.azurewebsites.net/api/v1
- API documentation can be found here
- ER diagram can be found here
To run the backend server locally, follow these steps:
- Node.js and npm (Node Package Manager)
- MySQL Database
- Fork this repository by clicking the "Fork" button in the top right corner of the GitHub page.
- Clone the repository to your local machine using the following command in your terminal:
git clone https://github.com/osman-butt/musicbase-backend.git
Navigate to the project directory and install the necessary dependencies:
cd musicbase-backend
npm install
- Ensure you have a MySQL server running on your local machine.
- Create a new database named musicbase.
- Import the provided SQL dump file into the musicbase database to set up the initial schema and data. The file can be found here by running the command
mysql -u username -p musicbasedb < path/to/musicbasedb.sql
- Create a .env file a fill it with your database information
MYSQL_HOST=localhost
MYSQL_USER= ENTER YOUR USERNAME
MYSQL_DATABASE= musicbasedb
MYSQL_PASSWORD= ENTER YOUR PASSWORD
MYSQL_PORT=3306
When you run the server it will now use the local MySQL database
Start the server using the following command:
npm start