Skip to content

This Django API provides user authentication, anime data management, and personalized recommendations.

Notifications You must be signed in to change notification settings

Dev-Aligator/animercs-backend

Repository files navigation

Anime Recommendation Backend

This Repository is a REST API built with Django, aimed at providing anime recommendations based on user preferences. The API utilizes Django to manage user authentication, store anime data, and generate recommendations dynamically.

API Endpoints

Authentication:

  • POST /api/auth/register/: Register a new user.
  • POST /api/auth/login/: Login and obtain an authentication token.
  • POST /api/auth/logout/: Logout and invalidate the authentication token.

Anime Data:

  • GET /api/anime/: List all anime entries.
  • POST /api/anime/: Add a new anime entry.
  • GET /api/anime/<id>/: Retrieve details of a specific anime.
  • PUT /api/anime/<id>/: Update details of a specific anime.
  • DELETE /api/anime/<id>/: Delete a specific anime entry.

Recommendations:

  • GET /api/recommendations/: Get personalized anime recommendations for the authenticated user.

Setup

  1. Clone the repository:
    git clone https://github.com/Dev-Aligator/animercs-backend.git 
 2. Create Virtual Environment:

Creating Virtual Environment named env

    python -m venv env

To Activate env (on Linux bash/zsh), checkout the venv docs for other flatforms

    source env/bin/activate

To deactivate env

deactivate

  1. Install dependencies:
    pip install -r requirements.txt
 4. Setup Database:

Making database migrations

    python manage.py makemigrations
    python manage.py migrate

To import Anime data to the database, Download this CSV file containing anime data crawled from MyAnimeList, having information for over 16,000 anime entries across various genres.

Modify the scripts.py file to specify the location of your downloaded animes.csv file.

Then, Run the following command to execute the script and import the anime data into the database:

    python manage.py shell < scripts.py

Note: If you're utilizing your own data source, ensure its format aligns with the expected model fields in the Django model (Anime) for successful insertion.


  1. Creating superuser to access Admin Panel:
    python manage.py createsuperuser
  1. Run the Server:
    python manage.py runserver

References

Crawling Information: For details regarding the process of crawling anime data from MyAnimeList or similar sources, please refer to the following repository.

Dev-Aligator

About

This Django API provides user authentication, anime data management, and personalized recommendations.

Topics

Resources

Stars

Watchers

Forks