Table of Contents
- Keeps track of all movies watched and want to watch.
- Personalised movie tracker.
- Search for movies.
- Add them to Watch list.
- Add them to Watched list.
Flixed - Track, Watch, and Relive Your Favorite Movies
To get a local copy up and running follow these simple steps.
You need to install Node
, Python
and Django
.
-
Node
You can dowload Node from the below link depending on the OS you have.
https://nodejs.org/en/download
-
Python
Download and install python3 on your system.
https://www.python.org/downloads/
-
Django
python -m pip install Django
Environment variables for Django need to be initialized in your shell profile file:
.bash_profile
(for Bash users).zsh_profile
(for Zsh users)
Below is the list of environment variables required for Django, along with their usage:
Variable | Purpose |
---|---|
CORS_ORIGIN_WHITELIST |
List of origins allowed for CORS requests. |
DJANGO_DEBUG |
Enables or disables debug mode (True/False ). |
DJANGO_SECRET_KEY |
Secret key for Django security. |
REACT_HOST |
Used for the ALLOWED_HOSTS property in settings.py . |
OMDB_API_KEY |
API key for OMDB integration. |
TMDB_API_KEY |
API key for TMDB integration. |
TMDB_API_AUTH_ACCESS |
Authentication token for TMDB API. |
OMDB_URL |
Base URL for OMDB API. |
TMDB_URL |
Base URL for TMDB API. |
TMDB_CONFIG_URL |
URL for TMDB configuration settings. |
DJANGO_DB_NAME |
Database name for Django App. |
DJANGO_DB_USERNAME |
Database username for Django App. |
DJANGO_DB_PWD |
Database password for Django App. |
DJANGO_DB_HOST |
Database host for Django App. |
DJANGO_DB_PORT |
Database port number for Django App. |
export CORS_ORIGIN_WHITELIST="http://localhost:3000"
export DJANGO_DEBUG=True
export DJANGO_SECRET_KEY="your-secret-key"
export REACT_HOST="localhost"
export OMDB_API_KEY="your-omdb-api-key"
export TMDB_API_KEY="your-tmdb-api-key"
export TMDB_API_AUTH_ACCESS="your-tmdb-auth-access"
export OMDB_URL="https://www.omdbapi.com"
export TMDB_URL="https://api.themoviedb.org/3"
export TMDB_CONFIG_URL="https://api.themoviedb.org/3/configuration"
React environment variables must be defined in a .env
file located at the root of your React project (where package.json
is present).
All React environment variables must start with the prefix REACT_APP_
. This is a requirement for Create React App to recognize them.
Below is the list of environment variables required for your React project:
Variable | Purpose |
---|---|
REACT_APP_FLIXED_REST_BASE_URL |
Base URL for the REST API used in the app. |
REACT_APP_TMDB_IMG_BASE_URL |
Base URL for TMDB images. |
REACT_APP_TMDB_SEC_IMG_BASE_URL |
Base URL for secondary TMDB images. |
- Create a
.env
file in the root directory of your React project. - Add the environment variables in the following format:
REACT_APP_FLIXED_REST_BASE_URL=https://api.flixed.com
REACT_APP_TMDB_IMG_BASE_URL=https://image.tmdb.org/t/p/original
REACT_APP_TMDB_SEC_IMG_BASE_URL=https://image.tmdb.org/t/p/w500
-
Get a free API Key for OMDB at OMDB API and TMDB at TMDB API
-
Clone the repo
git clone https://github.com/nilesh1168/flixed-movie-tracker.git
-
Install Python packages
pip3 install -r requirements.txt
π Note: Run this command from the directory where requirements.txt is available.
-
Install NPM packages
cd flixed_reactjs npm install
-
Create a superuser in Django which can be used to login to the app.
python manage.py createsuperuser
Enter the email, username and password that is asked. π Note: Run this command from the directory where manage.py is available.
Here is a sample screen of the application
This section tells you about how to deploy this application on a system.
-
Run the following command to install the required packages. This will also install gunicorn.
$ pip install -r /path/to/requirements.txt
-
Create a Config File for Gunicorn.
-
You can use the existing
gunicorn_config.py
with desired changes according to your directory structure. -
Set the
bind
variable as desired in thegunicorn_config.py
file.
-
-
Create a bash file to set up all the required environment variables for the application and to start Gunicorn.
- You can use the existing
gunicorn-env.sh
file. Make sure to make changes in the file according to your directory structure. - Set the
OMDB_API_KEY, TMDB_API_AUTH_ACCESS
, andTMDB_API_KEY
to successfully run the application.
- You can use the existing
-
Create a property list file for launching Gunicorn at system startup.
- You can use the existing
flixed_launctl.plist
file. - Make sure to change the
PATH
variable in the file according to your directory structure. 3. Update theUserName
andGroupName
accordingly.
π Note: This property list file will run the bash script to create the environment variables and start the Gunicorn server on system startup.
- For user-specific setup, copy the property list file to your system's LaunchAgents folder. For all users, copy it to LaunchDaemons at the root location.
$ cp /your/path/flixed_launctl.plist /your/path/LaunchAgents
- You can use the existing
-
After copying the file, use the launchctl utility to load this file.
$ launchctl load flixed_launctl.plist
To check if the load was successful, run:
$ launchctl list com.nilesh.flixed.gunicorn
This should return a JSON response similar to:
{ "LimitLoadToSessionType" = "Aqua"; "Label" = "com.nilesh.flixed.gunicorn"; "OnDemand" = true; "LastExitStatus" = 0; "PID" = 6869; "Program" = "/bin/bash"; "ProgramArguments" = ( "/bin/bash"; "/your/path/gunicorn-env.sh"; ); };
-
Your Gunicorn should now be up and running at the specified bind IP and port.
-
To stop the gunicorn service run
$ launchctl unload flixed_launctl.plist
-
To verify if the unload was success, run
$ launchctl list com.nilesh.flixed.gunicorn
This should give the following output
Could not find service "com.nilesh.flixed.gunicorn" in domain for port
This means that the service has been stopped successfully.
-
Install nginx as following
brew install nginx
-
Goto
/opt/homebrew/Cellar/nginx/1.25.5/
and run the following command on the filehomebrew.mxcl.nginx.plist
:launchctl load homebrew.mxcl.nginx.plist
This will start the nginx service on you macOS.
π Note: To stop the service, use the following command:
launchctl unload homebrew.mxcl.nginx.plist
-
Update the
nginx.conf
at/opt/homebrew/etc/nginx/nginx.conf
to include the settings to add nginx as reverse proxy server.upstream server_django { server 127.0.0.1:8000; # whatever bind value that you gave in gunicorn_config.py } server { server_name localhost; listen 80; location / { proxy_pass http://server_django; proxy_set_header Host $host; } location /static/ { alias /your/venv/lib/python3.9/site-packages/rest_framework/static/; }
Once you update the
nginx.conf
you can restart the nginx service.π Note: You can stop and start the nginx service for a restart.
-
All the REST APIs will then be available at
server_name:listen
that you provided forserver_name
andlisten
innginx.conf
.
-
Install the required packages and libraries.
npm install
π Note: Run this command at
flixed_reactjs
location. -
Update the
base_url
property underflixed_reactjs/src/components/config.js
as per your nginx configuration. -
Head to the
flixed_reactjs
directory, and run the following command on the terminalnpm start
-
This will start the frontend server at
localhost:3000
.
- Add back to top links
- Dashboard with graphs and information
- Add charts and comparisons in a page called statistics
- Display movies with poster; Use TMDB API
- Optimise component loading for huge data
Distributed under the MIT License. See LICENSE.txt
for more information.
- Search movies
- Add them to watched movies or add them to watchlist
- User can login and access the home
- Search movies
- Add them to watched movies or watchlist
- Added eye-catching UI
- Personalised user experience
- Added test cases for REST API
Project Link: https://github.com/nilesh1168/flixed-movie-tracker