Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
### Project: MD-Attractor

#### Other Details
- **Contributor:** Ayush Ray
- **Contributor:** [Ayush Ray](https://github.com/aayushray)
- **Mentors:** [Giannis Prokopiou](https://github.com/GiannisProkopiouOrfium), [Panagiotis Sfendourakis](https://github.com/sfendourakis)
- Detailed Insights about the project is provided in this [Medium](https://medium.com/p/18518c6ca4df) blog.

## Project Overview

Expand Down Expand Up @@ -47,11 +48,8 @@ Develop a web application to recommend song based on the music data from various
To set up the project, follow these steps:
1. Navigate to the backend directory.
2. Install the required dependencies by running `pip install -r requirements.txt`.
3. Start the Django server by running `python manage.py runserver`.

4. Navigate to the frontend directory.
5. Install the required dependencies by running `npm install`.
6. Start the React development server by running `npm start`.
3. Navigate to backend directory and follow the instructions given in its Readme file, to setup Backend.
4. Navigate to frontend directory and follow the instructions given in its Readme file, to setup FrontEnd.


## Contact
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion backend/MD_Attractor/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []
ALLOWED_HOSTS = ['md-attractor-backend.onrender.com', 'localhost', '127.0.0.1']


# Application definition
Expand Down
1 change: 1 addition & 0 deletions backend/Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: gunicorn MD_Attractor.wsgi --log-file -
79 changes: 61 additions & 18 deletions backend/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
# MD Attractor

## Installation
1. Clone the repository:
```bash
git clone https://github.com/aayushray/MD-Attractor.git
```
2. Install the project dependencies:
```bash
pip install -r requirements.txt
```
3. Start the development server:
```bash
python manage.py runserver
```
# Backend Setup

## Setting Django secret key
- within the MD_Attractor/settings.py, replace the DJANGO_SECRET_KEY part with the secret key generated by you.
- Within the MD_Attractor/settings.py, replace the DJANGO_SECRET_KEY part with the secret key generated by you.
```
SECRET_KEY = 'your_secret_key_here'
```
Expand All @@ -27,12 +13,69 @@
self.client_secret = 'SPOTIFY_SECRET_KEY'
```

## Starting Backend Server
1. Setup admin user `python manage.py createsuperuser`.
2. Start the Django server by running `python manage.py runserver`.
3. The server will be running on `http://localhost:8000'.

## Usage
1. Access the application in your web browser at `http://localhost:8000`.
2. For better visualization and testing of API endpoints, you can use Postman. Download and install Postman from [https://www.postman.com/](https://www.postman.com/).


## API Endpoints
```bash
http://localhost:8000 # For send search request to Spotify API
```
http://localhost:8000/admin #View Django admin panel
http://localhost:8000/ #Song Search Feature
http://localhost:8000/history #View Search History
```

Certainly! Below is an updated section for your `README.md` that addresses the installation issue and provides a resolution.

---

# Installation Issue

When running `npm install`, you may encounter the following error:

```
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: react-vis-network@1.0.0
npm error Found: react@18.3.1
npm error node_modules/react
npm error react@"^18.3.1" from the root project
npm error peer react@"^18.0.0" from @testing-library/react@13.4.0
npm error node_modules/@testing-library/react
npm error @testing-library/react@"^13.4.0" from the root project
npm error 7 more (react-dom, react-graph-vis, react-loader-spinner, ...)
npm error
npm error Could not resolve dependency:
npm error peer react@"^16.0.0" from react-vis-network@1.0.0
npm error node_modules/react-vis-network
npm error react-vis-network@"^1.0.0" from the root project
npm error
npm error Conflicting peer dependency: react@16.14.0
npm error node_modules/react
npm error peer react@"^16.0.0" from react-vis-network@1.0.0
npm error node_modules/react-vis-network
npm error react-vis-network@"^1.0.0" from the root project
npm error
```

This error occurs because there is a conflict between the version of `react` installed in your project (`react@18.3.1`) and the peer dependency required by the `react-vis-network` package (`react@^16.0.0`).

### Resolution

To resolve this issue, use the following command to bypass the peer dependency conflict:

```bash
npm install --legacy-peer-deps
```

### Explanation

- The `--legacy-peer-deps` flag tells npm to ignore the peer dependency conflicts and install the packages anyway.
- This is useful when you're working with packages that have not been updated to support the latest versions of their dependencies, or when you're using specific versions of libraries that are incompatible with the latest versions.

Binary file modified backend/db.sqlite3
Binary file not shown.
16 changes: 16 additions & 0 deletions backend/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,46 @@ asgiref==3.8.1
async-timeout==4.0.3
certifi==2024.6.2
cffi==1.16.0
cfgv==3.4.0
charset-normalizer==3.3.2
contourpy==1.2.1
cryptography==42.0.8
cycler==0.12.1
distlib==0.3.8
Django==5.0.6
django-cors-headers==4.4.0
django-rest-framework==0.1.0
djangorestframework==3.15.1
filelock==3.15.4
fonttools==4.53.0
fuzzywuzzy==0.18.0
git-filter-repo==2.45.0
gunicorn==23.0.0
identify==2.5.36
idna==3.7
kiwisolver==1.4.5
Levenshtein==0.25.1
matplotlib==3.9.0
networkx==3.3
nodeenv==1.9.1
numpy==1.26.4
packaging==24.1
pillow==10.3.0
platformdirs==4.2.2
pre-commit==3.7.1
pycparser==2.22
PyJWT==2.8.0
pyparsing==3.1.2
python-dateutil==2.9.0.post0
python-dotenv==1.0.1
python-Levenshtein==0.25.1
PyYAML==6.0.1
rapidfuzz==3.9.6
redis==5.0.5
requests==2.32.3
six==1.16.0
spotipy==2.24.0
sqlparse==0.5.0
typing_extensions==4.12.1
urllib3==2.2.1
virtualenv==20.26.3
Binary file not shown.
Binary file added backend/song_api/__pycache__/admin.cpython-312.pyc
Binary file not shown.
Binary file added backend/song_api/__pycache__/apps.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file modified backend/song_api/__pycache__/models.cpython-310.pyc
Binary file not shown.
Binary file not shown.
Binary file modified backend/song_api/__pycache__/serializers.cpython-310.pyc
Binary file not shown.
Binary file not shown.
Binary file modified backend/song_api/__pycache__/spotifyAPI.cpython-310.pyc
Binary file not shown.
Binary file not shown.
Binary file modified backend/song_api/__pycache__/urls.cpython-310.pyc
Binary file not shown.
Binary file added backend/song_api/__pycache__/urls.cpython-312.pyc
Binary file not shown.
Binary file modified backend/song_api/__pycache__/views.cpython-310.pyc
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion backend/song_api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class SongSerializer(serializers.ModelSerializer):
class Meta:
model = models.Song
fields = ['songId', 'songName', 'recommendedSongs']
fields = ['songId', 'songName', 'recommendedSongs', 'dateCreated']

class RecommendedSongSerializer(serializers.ModelSerializer):
class Meta:
Expand Down
1 change: 1 addition & 0 deletions backend/song_api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
urlpatterns = [
path('', views.trackDetails, name='home'),
path('history/', views.searchHistory, name='history'),
path('song-detail/<str:id>/', views.songDetails, name='songDetail'),
]
Loading