This is the repository for the Spotify_Clone_API project, which is a clone of the Spotify web service. This API implements a basic set of functionalities allowing users to interact with the platform.
Spotify_Clone_API is developed using Django, one of the most popular frameworks for building web applications in Python. This API provides features such as user registration, advertisement creation, user profile management, and other core functionalities.
To run this API, you'll need:
- Python 3.11
- Django v5
- Django REST Framework
- and other dependencies listed in the
requirements.txt
file
- Clone the repository to your local machine:
$ git clone https://github.com/MafanNam/Spotify_Clone_API.git
- Navigate to the project directory:
$ cd Spotify_Clone_API
- Create/Activate environment:
$ pip install virtualenv
$ python -m virtualenv venv
$ .\venv\Scripts\activate
$ # or linux
$ source venv/bin/activate
- Install dependencies:
$ pip install -r requirements/local.txt
- Apply migrations to create the database:
$ python manage.py migrate
- Load example data
NOT COMPLETE
$ python -Xutf8 ./manage.py loaddata data/mydata.json
- Run the server:
$ python manage.py runserver
All user email in data/mydata.json and password=Pass12345
for admin user [email protected]
and password=1
Then you MUST create and config django.env
optional django.docker.env
.
For example I create django.example.env
and django.docker.example.env
All these files are in .envs/.local/
You can now access the API in your browser at http://localhost:8000/.
Commands can be run through a makefile or written manually.
You can access the API in your browser at http://localhost:8080/. Flower http://localhost:5555/
You cannot use makefile
$ docker compose -f local.yml up --build -d --remove-orphans
$ # or
$ docker compose -f local.yml up --build
You can use makefile
$ make build
$ # or
$ make build-log
$ make buld-log
$ make up
$ make down
For testing and generate coverage
$ make cov
$ make cov-gen
Docker
$ make cov-docker
$ make cov-gen-docker
$ coverage run --source='.' --omit='*/migrations/*.py,*/asgi.py,*/wsgi.py,*/manage.py' manage.py test
$ coverage html
Docker
$ docker compose -f local.yml run --rm server coverage run --source='.' --omit='*/migrations/*.py,*/asgi.py,*/wsgi.py,*/manage.py' manage.py test
$ docker compose -f local.yml run --rm server coverage html
The API documentation available
Local
localhost:8000
Docker
localhost:8080
This project is developed by Mafan.
This project is licensed under MIT License.