Mohammed Khan 3423e58085 cut short dashboard gif | 10 ヶ月 前 | |
---|---|---|
backend | 1 年間 前 | |
walkthroughs | 10 ヶ月 前 | |
.editorconfig | 1 年間 前 | |
.flake8 | 1 年間 前 | |
.gitignore | 1 年間 前 | |
.pre-commit-config.yaml | 1 年間 前 | |
Makefile | 1 年間 前 | |
README.md | 1 年間 前 | |
poetry.lock | 1 年間 前 | |
pyproject.toml | 1 年間 前 |
A simple, comprehensive YouTube playlist manager web app powered by YouTube Data API V3. Built with ❤ using Django, htmx and Bootstrap.
I built UnTube with the goal of making it easier to manage multiple YouTube playlists. UnTube makes it possible to bulk delete videos from a playlist, take care of duplicate or unavailable videos, bulk copy/move videos from one playlist to other playlists. All you have to do is log in with your Google account and import your playlists to access these basic features + more!
Apart from the base features mentioned above, UnTube offers more:
make update
to install all the dependencies and run the migrations. Note that Poetry will automatically create a virtual environment and manage it for you.make local-settings
to create a local
folder under the root directory that contains a local-settings.py
file. This file will be ignored by Git.
local/local-settings.py
file. Take a look at the Configuring Google APIs section in this Medium article to set up your OAuth credientials. While creating your OAuth credentials on Google IAM, fill in the URIs exactly as mentioned in the article.SITE_ID
to 2
in local/local-settings.py
.make run-server
to run the Django server. Visit 127.0.0.1:8000/
in your browser to view the site.Optional: If see a SocialApp matching query does not exist
error, please go into the local/local-settings.py
file and increment the SITE_ID
by one. Then, when the server re-runs the error should go away when you try to log in. If it still does not go away, keep incrementing it until it does...
Most of the dynamic interactivity on this site was made possible due to htmx. When I began implementing core site features like moving, deleting, checking for updates, etc., and tried to make it interactive, I found myself writing a lot of AJAX code each and every time, for even the simplest of interactivity. It was when I found htmx my development process sped up quite a bit. Who would have thought that instead of replacing the whole page with the response, just replacing a particular target element within the page with the HttpResponse would do wonders? Some of the major places I've used htmx on this site:
load
trigger. After the dashboard finishes loading, I've set up htmx to automatically send a GET request to the backend (this only happens once upon the page load) to check for playlist updates. From the backend, the update status is sent back via a HttpResponse which htmx promptly loads into a target div I specified. That way I did not need to check for updates inside the main view that loaded the page. In a way, htmx helped me check for updates in the "background". I've used this load
trigger many other places on the site, one other example is the playlist completion time info is loaded after the playlist page is loaded.load
, it is also possible to send htmx requests when any HTML element is click
ed or revealed
. I've used this click
trigger on the mark playlist/video as favorite buttons and the mark videos as watched buttons. Below, I discuss about using the revealed
to achieve infinite scrolling.hx-trigger="revealed"
and hx-swap="afterend"
attributes helped me achieve this functionality. When the 50th video is revealed on the screen, htmx makes a GET request to the backend to get the next 50 videos (if available) and appends the HttpResponse after the 50th video. Until htmx gets back a response from the backend, it can be set up to show the user a loading spinner!Additional interactive features such as the progress bar and tagging playlist were all made possible because of htmx. Any questions on how I've implemented some of the features on this site? Please send me an email at abukhan363@gmail.com with your feedback and questions. I will be happy to share my code and thought process to illustrate how I implemented the site's features using htmx.