{"id":18572116,"url":"https://github.com/ceci-aguilera/ifta_filing_django_api","last_synced_at":"2026-03-16T18:01:25.290Z","repository":{"id":105156700,"uuid":"410642539","full_name":"Ceci-Aguilera/ifta_filing_django_api","owner":"Ceci-Aguilera","description":"IFTA Filling! is a management solution for trucking companies to keep track of their fleet, trucks, drivers, and tax reports. This repo contains the Django backend API developed using Django-Rest-Framework","archived":false,"fork":false,"pushed_at":"2022-05-09T00:54:22.000Z","size":167,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-29T13:47:09.242Z","etag":null,"topics":["django","django-backend","django-react","django-rest-framework","docker","managment-system","nginx","postgresql","python","reactjs-frontend","stripe"],"latest_commit_sha":null,"homepage":"https://filling.ifta-ya.com/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ceci-Aguilera.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-09-26T19:24:59.000Z","updated_at":"2024-01-24T13:26:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"2b0c0c80-7791-4a6a-8abd-dfd375732a2d","html_url":"https://github.com/Ceci-Aguilera/ifta_filing_django_api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Ceci-Aguilera/ifta_filing_django_api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ceci-Aguilera%2Fifta_filing_django_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ceci-Aguilera%2Fifta_filing_django_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ceci-Aguilera%2Fifta_filing_django_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ceci-Aguilera%2Fifta_filing_django_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ceci-Aguilera","download_url":"https://codeload.github.com/Ceci-Aguilera/ifta_filing_django_api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ceci-Aguilera%2Fifta_filing_django_api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28058543,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-26T02:00:06.189Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","django-backend","django-react","django-rest-framework","docker","managment-system","nginx","postgresql","python","reactjs-frontend","stripe"],"created_at":"2024-11-06T23:05:03.005Z","updated_at":"2025-12-26T19:01:17.831Z","avatar_url":"https://github.com/Ceci-Aguilera.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# IFTA Filling\n\n![IF Logo](./.readme_assets/IFTA_Filling_Logo.png)\n\n![Python version](https://img.shields.io/badge/Pythn-3.8.10-4c566a?logo=python\u0026\u0026longCache=true\u0026logoColor=white\u0026colorB=pink\u0026style=flat-square\u0026colorA=4c566a) ![Django version](https://img.shields.io/badge/Django-3.2-4c566a?logo=django\u0026\u0026longCache=truelogoColor=white\u0026colorB=pink\u0026style=flat-square\u0026colorA=4c566a) ![Django-RestFramework](https://img.shields.io/badge/Django_Rest_Framework-4.1.10-red.svg?longCache=true\u0026style=flat-square\u0026logo=django\u0026logoColor=white\u0026colorA=4c566a\u0026colorB=pink) \n\n\n\u003c/div\u003e\n\n## Table of Contents\n* [Description](#intro)\n* [Structure and Backend Functionalities](#structure)\n* [Install (Run) with Docker](#docker)\n* [Installation without Docker](#installation)\n* [Deploy on VPS](#deploy)\n* [Useful Links](#useful_links)\n\n\n\u003ca name=\"intro\"\u003e\u003c/a\u003e\n## Description\n\nThe project __IFTA FILLING__ is a managing tool for truck owners to keeps track of the _IFTA Taxes_ for their trucking business. This project has been merged into the __IFTA ya!__ solution that targets truck owner-operators instead of fleet managers.\n\n- ### Some useful notes about the application:\n    - The __User Model__ was customized to match the needs of the business. For example, a Stripe Id was added for auto payments, and username was changed to the email. Other fields needed for security features were also added.\n    - __Stripe SDK__ was used to manage the User's payments.\n    - __django.core.mail__ is in use to manage the email sending functionality. While to manage the __PDFs__ creation, the package __xhtml2pdf__ is in use.\n\n\n- ### How do subscriptions work?\n\nThe owner of the truck buys a subscription which allows him to use the managing tools for a limited amount of time (measure in quarters as this is the natural way of submitting IFTA taxes). After this step, __IFTA Filling__ becomes available for any driver of the company to use and for the truck owner. However, each subscription plan also comes with a maximum amount of trucks and drivers that can be managed at the time. Truck owners can expand their subscription time by auto-payments or making a manual payment, for both cases __Stripe SDK__ is used.\n\n__NOTE:__ A driver can work for several truck owners and can also drive several trucks during a quarter.\n\n\n\n\u003ca name=\"docker\"\u003e\u003c/a\u003e\n## Install (Run) with Docker\n\n### About the Builds and Images in use:\nThere are currently 3 services in use: the api (Django App), the db (the postgrSQL database), and the nginx (Nginx configuration).\n    - __api:__ The Django Dockerfile is in the root directory, and it has an entrypoint file that connects the backend to the database and runs migrations as well as collects the statics.\n    - __db:__ This is built from the postgres:13-alpine image. The default environment variables are set in the docker-compose.yml file.\n    - __nginx:__ The default configuration for nginx is inside the nginx folder in the nginx.conf file.\n\n### Runing Docker-Compose\n\n1. Clone the repo:\n    ```bash\n    git clone https://github.com/Ceci-Aguilera/ifta_filing_django_api.git\n    ```\n1. Configure the environment variables.\n    1. Copy the content of the example env file that is inside the truck_signs_designs folder into a .env file:\n        ```bash\n        cd ifta_filing_django_api/settings\n        cp simple_env_config.env .env\n        ```\n    1. The new .env file should contain all the environment variables necessary to run all the django app in all the environments. However, the only needed variables for docker to run are the following:\n        ```bash\n        DOCKER_SECRET_KEY\n        DOCKER_DB_NAME\n        DOCKER_DB_USER\n        DOCKER_DB_PASSWORD\n        DOCKER_DB_HOST\n        DOCKER_DB_PORT\n        DOCKER_STRIPE_PUBLIC_KEY\n        DOCKER_STRIPE_SECRET_KEY\n        DOCKER_EMAIL_HOST_USER\n        DOCKER_EMAIL_HOST_PASSWORD\n        ```\n    1. For the database, the default configurations should be:\n        ```bash\n        DOCKER_DB_NAME=docker_iftafilling_db\n        DOCKER_DB_USER=docker_iftafillings_user\n        DOCKER_DB_PASSWORD=docker_superiftafillinguser!\n        DOCKER_DB_HOST=db\n        DOCKER_DB_PORT=5432\n        ```\n    1. The DOCKER_SECRET_KEY is the django secret key. To generate a new one see: [Stackoverflow Link](https://stackoverflow.com/questions/41298963/is-there-a-function-for-generating-settings-secret-key-in-django)\n\n    1. The DOCKER_STRIPE_PUBLISHABLE_KEY and the DOCKER_STRIPE_SECRET_KEY can be obtained from a developer account in [Stripe](https://stripe.com/). \n        - To retrieve the keys from a Stripe developer account follow the next instructions:\n            1. Log in into your Stripe developer account (stripe.com) or create a new one (stripe.com \u003e Sign Up). This should redirect to the account's Dashboard.\n            1. Go to Developer \u003e API Keys, and copy both the Publishable Key and the Secret Key.\n\n    1. The DOCKER_EMAIL_HOST_USER and the DOCKER_EMAIL_HOST_PASSWORD are the credentials to send emails from the website when a client asks for a PDF report.\n\n1. Run docker-compose:\n    ```bash\n    docker-compose up --build\n    ```\n1. Congratulations =) !!! The App should be running in [localhost:80](http://localhost:80)\n1. (Optional step) To create a super user run:\n    ```bash\n    docker-compose run api ./manage.py createsuperuser\n    ```\n\n\n\n\n\u003ca name=\"installation\"\u003e\u003c/a\u003e\n## Installation without Docker\n\n1. Clone the repo:\n    ```bash\n    git clone https://github.com/Ceci-Aguilera/truck_signs_api.git\n    ```\n1. Configure a virtual env and set up the database. See [Link for configuring Virtual Environment](https://docs.python-guide.org/dev/virtualenvs/) and [Link for Database setup](https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04).\n1. Configure the environment variables.\n    1. Copy the content of the example env file that is inside the truck_signs_designs folder into a .env file:\n        ```bash\n        cd truck_signs_designs/settings\n        cp simple_env_config.env .env\n        ```\n    1. The new .env file should contain all the environment variables necessary to run all the django app in all the environments. However, the only needed variables for the development environment to run are the following:\n        ```bash\n        SECRET_KEY\n        DB_NAME\n        DB_USER\n        DB_PASSWORD\n        DB_HOST\n        DB_PORT\n        STRIPE_PUBLIC_KEY\n        STRIPE_SECRET_KEY\n        EMAIL_HOST_USER\n        EMAIL_HOST_PASSWORD\n        ```\n    1. For the database, the default configurations should be:\n        ```bash\n        DB_NAME=iftadb\n        DB_USER=iftauser\n        DB_PASSWORD=SuperIfta123!\n        DB_HOST=localhost\n        DB_PORT=5432\n        ```\n    1. The SECRET_KEY is the django secret key. To generate a new one see: [Stackoverflow Link](https://stackoverflow.com/questions/41298963/is-there-a-function-for-generating-settings-secret-key-in-django)\n\n    1. The STRIPE_PUBLISHABLE_KEY and the STRIPE_SECRET_KEY can be obtained from a developer account in [Stripe](https://stripe.com/). \n        - To retrieve the keys from a Stripe developer account follow the next instructions:\n            1. Log in into your Stripe developer account (stripe.com) or create a new one (stripe.com \u003e Sign Up). This should redirect to the account's Dashboard.\n            1. Go to Developer \u003e API Keys, and copy both the Publishable Key and the Secret Key.\n\n    1. The EMAIL_HOST_USER and the EMAIL_HOST_PASSWORD are the credentials to send emails from the website when a client asks for a PDF report.\n\n1. Run the migrations and then the app:\n    ```bash\n    python manage.py migrate\n    python manage.py runserver\n    ```\n1. Congratulations =) !!! The App should be running in [localhost:8000](http://localhost:8000)\n1. (Optional step) To create a super user run:\n    ```bash\n    python manage.py createsuperuser\n\n\u003ca name=\"deploy\"\u003e\u003c/a\u003e\n## Deploy on VPS\n1. Clone the repo:\n    ```bash\n    git clone https://github.com/Ceci-Aguilera/ifta_filing_django_api\n    ```\n1. Install the dependencies:\n    ```bash\n    sudo apt-get update\n    sudo apt-get install python3-pip python3-dev libpq-dev postgresql postgresql-contrib nginx\n    ```\n1. Set up the postgresql database [Setup Database](https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04)\n1. Create an .env file and configure the environment variables\n1. Create a virtual env and activate it:\n    ```bash\n    virtualenv myprojectenv\n    source myprojectenv/bin/activate\n    ```\n1. Pip install the requirements:\n    ```bash\n    pip install -r requirements.txt\n    ```\n1. Pip install gunicorn:\n    ```bash\n    pip install gunicorn\n    ```\n1. Run the migrations and then test the the app:\n    ```bash\n    python manage.py migrate\n    python manage.py runserver\n    ```\n1. Complete the setup of the website with this [Link](https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04)\n1. Configure the CORS to allow the Frontend to make api calls. See [Link](https://www.stackhawk.com/blog/django-cors-guide/)\n\n\u003ca name=\"useful_links\"\u003e\u003c/a\u003e\n## Useful Links\n### Postgresql Databse\n- Setup Database: [Digital Ocean Link for Django Deployment on VPS](https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04)\n### Docker\n- [Docker Oficial Documentation](https://docs.docker.com/)\n- Dockerizing Django, PostgreSQL, guinicorn, and Nginx:\n    - Github repo of sunilale0: [Link](https://github.com/sunilale0/django-postgresql-gunicorn-nginx-dockerized/blob/master/README.md#nginx)\n    - My repo to Dockerize Django + Postgresql + Nginx + React js: [Ceci-Aguilera/django-react-nginx-mysql-docker](https://github.com/Ceci-Aguilera/django-react-nginx-mysql-docker)\n    - Michael Herman article on testdriven.io: [Link](https://testdriven.io/blog/dockerizing-django-with-postgres-gunicorn-and-nginx/)\n### Django and DRF\n- [Django Official Documentation](https://docs.djangoproject.com/en/4.0/)\n- Generate a new secret key: [Stackoverflow Link](https://stackoverflow.com/questions/41298963/is-there-a-function-for-generating-settings-secret-key-in-django)\n- Modify the Django Admin:\n    - Small modifications (add searching, columns, ...): [Link](https://realpython.com/customize-django-admin-python/)\n    - Modify Templates and css: [Link from Medium](https://medium.com/@brianmayrose/django-step-9-180d04a4152c)\n- [Django Rest Framework Official Documentation](https://www.django-rest-framework.org/)\n- More about Nested Serializers: [Stackoverflow Link](https://stackoverflow.com/questions/51182823/django-rest-framework-nested-serializers)\n- More about GenericViews: [Testdriver.io Link](https://testdriven.io/blog/drf-views-part-2/)\n### Miscellaneous\n- Create Virual Environment with Virtualenv and Virtualenvwrapper: [Link](https://docs.python-guide.org/dev/virtualenvs/)\n- [Configure CORS](https://www.stackhawk.com/blog/django-cors-guide/)\n- [Setup Django with Cloudinary](https://cloudinary.com/documentation/django_integration)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceci-aguilera%2Fifta_filing_django_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fceci-aguilera%2Fifta_filing_django_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceci-aguilera%2Fifta_filing_django_api/lists"}