{"id":29820402,"url":"https://github.com/leoraclet/django-saas-template","last_synced_at":"2025-08-12T06:46:42.970Z","repository":{"id":305505721,"uuid":"1020858337","full_name":"leoraclet/django-saas-template","owner":"leoraclet","description":"🌐 A fully featured template for building a Django-based SaaS application with Docker","archived":false,"fork":false,"pushed_at":"2025-07-23T09:02:52.000Z","size":646,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-28T23:02:08.055Z","etag":null,"topics":["caddy","celery","django","docker","flower","grafana","nginx","postgresql","prometheus","python3","saas","uv"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leoraclet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2025-07-16T13:56:19.000Z","updated_at":"2025-07-23T09:02:56.000Z","dependencies_parsed_at":"2025-07-20T14:47:21.575Z","dependency_job_id":null,"html_url":"https://github.com/leoraclet/django-saas-template","commit_stats":null,"previous_names":["leoraclet/django-saas-template"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/leoraclet/django-saas-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leoraclet%2Fdjango-saas-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leoraclet%2Fdjango-saas-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leoraclet%2Fdjango-saas-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leoraclet%2Fdjango-saas-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leoraclet","download_url":"https://codeload.github.com/leoraclet/django-saas-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leoraclet%2Fdjango-saas-template/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270016562,"owners_count":24512963,"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-08-12T02:00:09.011Z","response_time":80,"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":["caddy","celery","django","docker","flower","grafana","nginx","postgresql","prometheus","python3","saas","uv"],"created_at":"2025-07-28T23:00:52.681Z","updated_at":"2025-08-12T06:46:42.938Z","avatar_url":"https://github.com/leoraclet.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\u003cimg src=\"assets/django.png\" style=\"width: 200px\"\u003e\u003c/div\u003e\n\u003cbr\u003e\n\u003ch1 align=\"center\"\u003eDjango + Docker Saas Template\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n![license](https://img.shields.io/github/license/leoraclet/django-saas-template)\n![language](https://img.shields.io/github/languages/top/leoraclet/django-saas-template)\n![lastcommit](https://img.shields.io/github/last-commit/leoraclet/django-saas-template) \u003cbr\u003e\n![Language](https://img.shields.io/badge/Language-Python-1d50de)\n![Libraries](https://img.shields.io/badge/Framework-Django-fa8925)\n![Size](https://img.shields.io/badge/Size-376Mo-f12222)\n![OpenSource](https://badges.frapsoft.com/os/v2/open-source.svg?v=103)\n\n\u003c/div\u003e\n\n\u003e [!IMPORTANT]\n\u003e\n\u003e This project is currently under active development. I'm regularly making updates and additions to improve its completeness and functionality.\n\n\n## Table of Contents\n- [Table of Contents](#table-of-contents)\n- [🌟 Showcase](#-showcase)\n- [📖 About](#-about)\n- [✨ Features](#-features)\n- [📦 Structure](#-structure)\n- [📚 Libraries](#-libraries)\n- [🚀 Install \\\u0026 Run](#-install--run)\n  - [🏠 System](#-system)\n  - [🐳 Using Docker](#-using-docker)\n- [❤️ Thanks](#️-thanks)\n- [📜 License](#-license)\n\n\n## 🌟 Showcase\n\n\u003e [!NOTE]\n\u003e\n\u003e Some images coming some day ...\n\n## 📖 About\n\nThis is a fully featured template for building a **Django**-based **SaaS** application, containerized with\n**Docker**. It includes everything from user authentication and background task processing to a **REST API**\nwith complete documentation.\n\nThe frontend is developed using **Vite** and **Svelte**, compiled into static assets and served via Django’s\ntemplate system.\n\nFor development, testing, and production, the stack incorporates tools such as **PostgreSQL**,\n**Redis**, **Caddy**, **MailHog**, **Sentry**, **Grafana**, and **Prometheus**.\n\n## ✨ Features\n\n**Project**\n\n- 🔄 **Reproducibility**: The project is built using [**uv**](https://docs.astral.sh/uv/), enabling seamless setup replication across different machines for consistent environments.\n\n- 📖 **Well-Documented**: Source files include thorough comments and, where applicable, links and explanations to clarify key settings.\n\n**Program**\n\n  - 🧱 **Django-based backend** Powerful and extensible backend using Django, ideal for SaaS\n  applications.\n\n  - 🔐 **Built-in authentication system** User registration, login, password reset, and more out\n  of the box.\n\n  - ⚙️ **Background task support** Integrated support for background processing (e.g., with Celery\n  or Django Q).\n\n  - 🔌 **REST API with documentation** Fully functional REST API with auto-generated documentation\n  (e.g., Swagger or ReDoc).\n\n  - 🎨 **Modern frontend with Vite and Svelte** Responsive and fast frontend built with Svelte and\n  bundled via Vite, served through Django templates.\n\n  - 🐳 **Docker-based development and deployment** Consistent environments using Docker for local\n  development, testing, and production.\n\n  - 📊 **Monitoring and observability tools** Integrated support for Prometheus and Grafana for\n  metrics and monitoring.\n\n  - 📬 **Email testing with MailHog** Catch and inspect outgoing emails during development.\n\n  - 📈 **Error tracking with Sentry** Real-time error logging and alerting for faster debugging\n  and maintenance.\n\n  - 🌐 **Caddy as a web server and reverse proxy** Automatically manages HTTPS and routing for\n  production-ready deployments.\n\n  - 🐘 **PostgreSQL database** Reliable and robust relational database for handling application\n    data.\n\n  - 🚀 **Redis integration** In-memory data store for caching, session management, and background\n  tasks.\n\n## 📦 Structure\n\n\u003e [!NOTE]\n\u003e\n\u003e The project's structure should speak for itself, but here are the most important parts just in case\n\u003e you're wondering\n\n**Directories**\n\n- [**`.github`**](./.github/) - Contains GitHub Actions CI/CD workflows.\n- [**`.vscode`**](./.vscode/) - VS Code-specific settings and helper documentation.\n- [**`ansible`**](./ansible/) - Ansible configuration files (*currently empty*).\n- [**`assets`**](./assets/) - Static image resources used in the project.\n- [**`docker`**](./docker/) - Scripts to run services via Docker (e.g. Django, Celery, Gunicorn).\n- [**`etc`**](./etc/) - Configuration files for infrastructure components (e.g. Grafana, Traefik, Caddy, Prometheus).\n- [**`frontend`**](./frontend/) - Frontend app using **Svelte**, **Vite**, and **TypeScript**.\n- [**`server`**](./server/) - Main Django application, including apps, configuration, static files, templates, and localization.\n- [**`terraform`**](./terraform/) - Infrastructure-as-code configuration with Terraform (*currently empty*).\n\n**Files**\n\n- `.dockerignore`, `.gitignore`, `.gitattributes` - Ignore rules and Git configurations.\n- `.editorconfig`, `.flake8`, `.pre-commit-config.yaml` - Formatting and linting configurations.\n- `.env.prod`, `db.prod.env` - Environment variable files for production setup.\n- `.python-version` - Python version specification (for pyenv and tooling).\n- `Dockerfile.test`, `docker-compose*.yml` - Docker configuration files for different environments.\n- `Jenkinsfile` - CI/CD pipeline configuration for Jenkins.\n- `Justfile`, `Makefile` - Task runners for development and automation.\n- `Procfile` - Process declaration file for deployment (e.g. Heroku).\n- `LICENSE`, `README.md` - License and documentation files.\n- `pyproject.toml`, `requirements.txt`, `uv.lock` - Python environment and dependency configuration.\n\n\n## 📚 Libraries\n\n\u003e [!NOTE]\n\u003e\n\u003e Below are some of the key libraries and dependencies used in this project. For the full list, refer to the [`pyproject.toml`](./pyproject.toml) file.\n\n\n- 🌐 Web Framework \u0026 Core\n  - **[`django`](https://www.djangoproject.com/):** Full-featured web framework for building modern\n    web apps.\n  - **[`django-environ`](https://github.com/joke2k/django-environ):** Environment variable\n    management for 12-factor app configs.\n  - **[`whitenoise[brotli]`](https://whitenoise.evans.io/en/stable/):** Efficient static file\n    serving in production.\n\n- ⚙️ API \u0026 Serialization\n  - **[`djangorestframework`](https://www.django-rest-framework.org/):** Build robust REST APIs with\n    Django.\n  - **[`drf-spectacular`](https://drf-spectacular.readthedocs.io/):** Automatically generate\n    OpenAPI/Swagger schema.\n\n- 🔐 Authentication \u0026 Payments\n  - **[`django-allauth`](https://django-allauth.readthedocs.io/):** Integrated auth with support for\n    social login, MFA, and OIDC.\n  - **[`dj-stripe`](https://dj-stripe.dev/):** Connects Django to Stripe for payments and\n    subscriptions.\n\n- ⚡ Async \u0026 Real-time\n  - **[`channels`](https://channels.readthedocs.io/):** WebSocket and async support for Django.\n  - **[`uvicorn`](https://www.uvicorn.org/):** ASGI server for running async Django apps.\n\n- ⏱️ Task Queue \u0026 Scheduling\n  - **[`django-celery-beat`](https://github.com/celery/django-celery-beat):** Schedule periodic\n    tasks with Celery and Django.\n  - **[`redis`](https://redis.io/):** In-memory data store used as Celery broker and cache.\n\n- 📊 Monitoring \u0026 Observability\n  - **[`sentry-sdk`](https://docs.sentry.io/platforms/python/guides/django/):** Real-time error\n  monitoring and performance tracing.\n\n- 🪵 Logging \u0026 Notifications\n  - **[`loguru`](https://github.com/Delgan/loguru):** Feature-rich logging library with beautiful\n    formatting.\n  - **[`apprise`](https://github.com/caronc/apprise):** Multi-platform push notification system.\n\n\n## 🚀 Install \u0026 Run\n\nIf you'd like to run this Django app on your machine, here are two versions of how to do so by either doing on your [**system**](#-system) or [**using docker**](#-using-docker).\n\n### 🏠 System\n\nFirst, make sure the [**`uv`**](https://docs.astral.sh/uv/getting-started/installation/) Python package manager is installed on your system.\n\nOnce that's done, clone the repository\n\n```bash\ngit clone https://github.com/leoraclet/django-saas-template\ncd django-saas-template\n```\n\nThen, install the project dependencies:\n\n```bash\nuv sync\n```\n\n\u003e [!TIP]\n\u003e\n\u003e You may need to create a virtual environment beforehand:\n\u003e ```bash\n\u003e uv venv\n\u003e ```\n\nFinally, if you have either [**Make**](https://www.gnu.org/software/make/manual/make.html) or\n[**Just**](https://github.com/casey/just) installed, you can launch the development server accordingly.\n\n```bash\nmake migrate  # To migrate the Database (MANDATORY)\nmake run  # To run the developement server\n```\n\nor you can just run simple commands using\n\n```bash\nuv run {YOUR_COMMAND}\n```\n\n### 🐳 Using Docker\n\nEnsure that [**Docker**](https://docs.docker.com/get-started/introduction/get-docker-desktop/) is installed on your system and that the `docker` command is available in your terminal.\n\nTo start the Docker setup, run:\n\n```bash\ndocker compose up -d\n```\n\n\u003e [!TIP]\n\u003e\n\u003e To rebuild the image from scratch (without using the cache), use the following command:\n\u003e```bash\n\u003e docker compose build --no-cache\n\u003e```\n\nAs with local development, you can use the [**`Makefile`**](./Makefile) (or [**`Justfile`**](./Justfile)) to manage Docker-related tasks easily with the following commands:\n\n```bash\nmake up      # Build (if needed) and start the containers\nmake down    # Stop and remove containers and associated networks\nmake build   # Build or rebuild the Docker services\nmake logs    # View the output logs from running containers\n```\n\n## ❤️ Thanks\n\nProjects and blog posts that inspired this template :\n\n- [Cookiecutter Django](https://github.com/cookiecutter/cookiecutter-django)\n- [Testdriven Blog](https://testdriven.io/blog/)\n- [SaaS Pegasus Guides](https://www.saaspegasus.com/guides/)\n- [Digital\n  Ocean](https://www.digitalocean.com/community/tutorials/how-to-scale-and-secure-a-django-application-with-docker-nginx-and-let-s-encrypt)\n- [Django Astro\n  Demo](https://github.com/marqetintl/django-astro-jsx-demo/blob/main/django/config/urls.py)\n- [Medium Article](https://medium.com/@Am_Issath/list/django-web-development-tricks-e2bac4bc0742)\n\n## 📜 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleoraclet%2Fdjango-saas-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleoraclet%2Fdjango-saas-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleoraclet%2Fdjango-saas-template/lists"}