Skip to content

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.

License

Notifications You must be signed in to change notification settings

MafanNam/Spotify_Clone_API

Repository files navigation

Spotify_Clone_API

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 title

Diagram DB

Spotify diagram DB

Description

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.

Spotify front

Requirements

To run this API, you'll need:

  • Python 3.11
  • Django v5
  • Django REST Framework
  • and other dependencies listed in the requirements.txt file

Installation and Running

  1. Clone the repository to your local machine:
$ git clone https://github.com/MafanNam/Spotify_Clone_API.git
  1. Navigate to the project directory:
$ cd Spotify_Clone_API
  1. Create/Activate environment:
$ pip install virtualenv
$ python -m virtualenv venv
$ .\venv\Scripts\activate
$ # or linux
$ source venv/bin/activate
  1. Install dependencies:
$ pip install -r requirements/local.txt
  1. Apply migrations to create the database:
$ python manage.py migrate
  1. Load example data NOT COMPLETE
$ python -Xutf8 ./manage.py loaddata data/mydata.json
  1. Run the server:
$ python manage.py runserver

About fixtures(mydata.json)

All user email in data/mydata.json and password=Pass12345

for admin user [email protected] and password=1

If you want the api to send messages to mail

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/.

Getting Started with Docker

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/

To build and raise a container, you just need to run it:

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

Basic commands:

$ make buld-log

$ make up

$ make down

Run test

For testing and generate coverage

cov tests

makefile

$ make cov
$ make cov-gen

Docker

$ make cov-docker
$ make cov-gen-docker

no makefile

$ 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

API Documentation

The API documentation available Local localhost:8000 Docker localhost:8080

Spotify swagger Spotify redoc

Custom Admin

Spotify admin

Author

This project is developed by Mafan.

License

This project is licensed under MIT License.

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages