Project is hosted live with the front end on mywatchwave.
email: [email protected]
password: amaliTech,services@24
A fully functional Video Platform - Django Rest API project build and tested with restframework and deployed to Heroku.
The project was inspired by AmaliTech as part of their NSS Digital Training programs. Every piece of this project required time and futher reading since I customized most of Django's Djoser library . The activities involved in this project are as follows:
- Database model (table) development and configurations
- Writing the various API views for all the neccessary methods of each view
- Admin panel management configurations.
- Adding all the neccesary URL endpoints too for all the various views and thier methods. Not forgetting the admin panel too.
- Writing tests for all the views and thier methods. I also used Postman for testing as well.
- Including a documentation for the project through a python module called drf-spectacular by OpenAPI Initiative.
- Deploy the Django REST API to Heroku
- Create an account with the credentials below
- username
- password
- Activate your account via link sent by email.
- Logging in to watch videos.
- Able to watch next or previous videos in the queue.
- Share video links across all platforms
- Loggin in to upload videos with
- title
- description
- video file
- Able to manage videos on the dasboard which will reflects on the hosted db
-
Django Rest Framework for handling the API views and URLs.
-
Cloudinary for hosting the videos and the
video previews
when scrubbing the timeline.Video Previews
are the images that show when the user hovers over the timeline of the video player.Create and account on Cloudinary and get the following credentials
- CLOUDINARY_CLOUD_NAME
- CLOUDINARY_API_KEY
- CLOUDINARY_API_SECRET
-
I built the Front end like the
youtube video player
. -
Supabase for Database management and hosting of a few static images as well.
-
Heroku for hosting the application.
-
SendGrid, the platform I used for sending Emails.
Create and account and get your API for sending emails
.
python
django
djanfo-restframework
git clone https://github.com/kofnet002/watchwave.git
cd watchwave
python -m venv venv
.venv/bin/activate => for linux
venv\Scripts\activate => for windows
pip install -r requirements.txt
- In the root directory, create the file
.env
and the following environment variables
SECRET_KEY = <any long random combination for alphabets and numbers>
================ DB CONFIGURATION ===================
There are 2 ways of setting up the database configuration, in the settings.py file, I used the approach 1
================ APPROACH 1 ================
DATABASES['default'] = dj_database_url.config(
default='postgres://user:password@localhost:port/dbname',
)
================ APPROACH 2 ================
If you go by this approach, make sure to add the necessary credentials as stated below.
ENGINE = 'django.db.backends.postgresql'
NAME = your db name
HOST = your db host
USER = your db user
PASSWORD= your db password
PORT='5432'
SITE_NAME = 'WatchWave' # Site name that will show on the admin dasboard as well as the emai the user will receive
ADMIN_SITE_HEADER = 'WatchWave' # Head on the admin dashboard
DOMAIN = 'mywatchwave.vercel.app' # Frontend domain without the domain
================ EMAIL CONFIGURATION ===================
Create an app from Gmail and get the app password
_EMAIL_HOST_PASSWORD = <your Gmail app password # For sending emails>
DEFAULT_FROM_EMAIL = <your account to send the mail from # eg. [email protected]>
================ CLOUDINARY CONFIGURATION ===================
CLOUDINARY_CLOUD_NAME = your cloudinary cloud name
CLOUDINARY_API_KEY= your cloudinary api key
CLOUDINARY_API_SECRET = your cloudinary api secret
- In the root directory of the project in the terminal, run the code below to create a superuser to manage all the users of the application. be sure python is installed before you proceed with this stage.
The application needs you to activate your account first, but as a super admin, your account will be activated by default.
python manage createsuperuser
python manage.py runserver
Open your broswer and then visit http://127.0.0.1:8000
or localhost:8000
Since some extra work is being done in the background when uploading videos, the admin dasboard provided by django is not suitable for uploading videos. Instead you can visit Admin dashboard to upload videos on the frontend or you can equally use postman as well.
- I leverage the power of ffmpeg to snapshot the current uploading video every 10s and save it along with the video. The snapshots or the video previews displays just like YouTube. That is when you hover the mouse over the video timeline, the video previews will show on the screen and on the timeline as well.
We welcome contributions and participation from the community to help make this e-commerce backend API even better! Whether you're looking to fix bugs, add new features, or improve documentation, your help is greatly appreciated. Here's how you can get involved:
If you encounter any bugs or issues, please report them using the Issues section of my GitHub repository. When reporting issues, please include:
- A clear and descriptive title.
- A detailed description of the problem, including steps to reproduce it.
- Any relevant logs or error messages. Your environment details (e.g., Django version, DRF version, database, etc.).
I love receiving pull requests from the community! If you have an improvement or a new feature you'd like to add, please feel free to do so π