├── src ├── auth │ ├── __init__.py │ ├── migrations │ │ └── __init__.py │ ├── models.py │ ├── admin.py │ ├── tests.py │ ├── apps.py │ └── views.py ├── cfehome │ ├── __init__.py │ ├── asgi.py │ ├── wsgi.py │ ├── hosts.py │ ├── installed.py │ ├── urls.py │ ├── views.py │ └── settings.py ├── landing │ ├── __init__.py │ ├── migrations │ │ └── __init__.py │ ├── models.py │ ├── tests.py │ ├── admin.py │ ├── apps.py │ └── views.py ├── tenants │ ├── __init__.py │ ├── migrations │ │ ├── __init__.py │ │ ├── 0002_alter_tenant_subdomain.py │ │ └── 0001_initial.py │ ├── tests.py │ ├── apps.py │ ├── urls.py │ ├── admin.py │ ├── utils.py │ ├── models.py │ ├── views.py │ └── tasks.py ├── visits │ ├── __init__.py │ ├── migrations │ │ ├── __init__.py │ │ ├── 0002_pagevisit_user.py │ │ └── 0001_initial.py │ ├── tests.py │ ├── admin.py │ ├── apps.py │ ├── views.py │ └── models.py ├── checkouts │ ├── __init__.py │ ├── migrations │ │ └── __init__.py │ ├── models.py │ ├── admin.py │ ├── tests.py │ ├── apps.py │ └── views.py ├── commando │ ├── __init__.py │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ ├── __init__.py │ │ │ ├── hello_world.py │ │ │ ├── drop_schema.py │ │ │ ├── init_schema.py │ │ │ ├── migrate_schema.py │ │ │ ├── migrate_dynamic_db.py │ │ │ ├── db_branch.py │ │ │ ├── vendor_pull.py │ │ │ └── migrate_schema_basic.py │ ├── migrations │ │ └── __init__.py │ ├── models.py │ ├── admin.py │ ├── views.py │ ├── apps.py │ └── tests.py ├── customers │ ├── __init__.py │ ├── migrations │ │ ├── __init__.py │ │ ├── 0002_customer_init_email_customer_init_email_confirmed.py │ │ └── 0001_initial.py │ ├── tests.py │ ├── views.py │ ├── admin.py │ ├── apps.py │ └── models.py ├── dashboard │ ├── __init__.py │ ├── migrations │ │ └── __init__.py │ ├── models.py │ ├── admin.py │ ├── tests.py │ ├── apps.py │ └── views.py ├── enterprises │ ├── __init__.py │ ├── migrations │ │ └── __init__.py │ ├── models.py │ ├── tests.py │ ├── admin.py │ ├── apps.py │ ├── urls.py │ └── views.py ├── profiles │ ├── __init__.py │ ├── migrations │ │ └── __init__.py │ ├── models.py │ ├── tests.py │ ├── admin.py │ ├── apps.py │ ├── urls.py │ └── views.py ├── helpers │ ├── db │ │ ├── engine │ │ │ ├── __init__.py │ │ │ └── base.py │ │ ├── __init__.py │ │ ├── context │ │ │ ├── __init__.py │ │ │ └── managers.py │ │ ├── statements.py │ │ ├── validators.py │ │ └── schemas.py │ ├── security │ │ ├── __init__.py │ │ └── blocked_lists.py │ ├── middleware │ │ ├── __init__.py │ │ └── schemas.py │ ├── __init__.py │ ├── neonctl │ │ ├── __init__.py │ │ └── clients.py │ ├── date_utils.py │ ├── downloader.py │ ├── numbers.py │ └── billing.py ├── subscriptions │ ├── __init__.py │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ ├── __init__.py │ │ │ ├── sync_permissions.py │ │ │ └── sync_user_subs.py │ ├── migrations │ │ ├── __init__.py │ │ ├── 0006_subscription_active.py │ │ ├── 0012_alter_subscriptionprice_options.py │ │ ├── 0016_subscription_subtitle.py │ │ ├── 0008_subscription_stripe_id.py │ │ ├── 0018_usersubscription_user_cancelled.py │ │ ├── 0017_usersubscription_stripe_id.py │ │ ├── 0021_usersubscription_cancel_at_period_end.py │ │ ├── 0003_subscription_groups.py │ │ ├── 0004_subscription_permissions.py │ │ ├── 0014_alter_subscriptionprice_options.py │ │ ├── 0015_subscription_features.py │ │ ├── 0002_alter_subscription_options.py │ │ ├── 0010_subscriptionprice_featured_subscriptionprice_order.py │ │ ├── 0005_alter_subscription_permissions.py │ │ ├── 0022_usersubscription_timestamp_usersubscription_updated.py │ │ ├── 0019_usersubscription_current_period_end_and_more.py │ │ ├── 0001_initial.py │ │ ├── 0020_usersubscription_status.py │ │ ├── 0011_subscriptionprice_timestamp_and_more.py │ │ ├── 0007_usersubscription.py │ │ ├── 0009_subscriptionprice.py │ │ └── 0013_alter_subscription_options_subscription_featured_and_more.py │ ├── tests.py │ ├── apps.py │ ├── admin.py │ ├── timing.md │ ├── utils.py │ ├── views.py │ └── models.py ├── requirements │ ├── dev.in │ └── prod.in ├── templates │ ├── base │ │ ├── js.html │ │ ├── css.html │ │ └── messages.html │ ├── snippets │ │ └── welcome-user-msg.html │ ├── protected │ │ ├── view.html │ │ ├── user-only.html │ │ └── entry.html │ ├── landing │ │ ├── main.html │ │ ├── proof.html │ │ ├── hero.html │ │ └── features.html │ ├── tenants │ │ ├── detail.html │ │ ├── new-user.html │ │ └── list.html │ ├── auth │ │ ├── login.html │ │ └── register.html │ ├── base.html │ ├── checkout │ │ └── success.html │ ├── profiles │ │ ├── detail.html │ │ └── list.html │ ├── dashboard │ │ ├── base.html │ │ ├── main.html │ │ └── sidebar.html │ ├── subscriptions │ │ ├── user_cancel_view.html │ │ ├── user_detail_view.html │ │ ├── snippets │ │ │ └── pricing-card.html │ │ └── pricing.html │ ├── allauth │ │ └── layouts │ │ │ └── base.html │ └── nav │ │ └── navbar.html ├── staticfiles │ ├── base_tailwind │ │ └── tailwind-input.css │ └── images │ │ └── flowbite-phone-mockup.png └── manage.py ├── saas.code-workspace ├── railway.toml ├── package.json ├── rav.yaml ├── requirements.dev.txt ├── LICENSE ├── tailwind.config.js ├── requirements.txt ├── Dockerfile ├── README.md └── .gitignore /src/auth/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/cfehome/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/landing/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/tenants/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/visits/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/checkouts/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/commando/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/customers/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/dashboard/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/enterprises/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/profiles/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/auth/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/helpers/db/engine/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/helpers/security/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/subscriptions/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/visits/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/checkouts/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/commando/management/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/commando/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/customers/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/dashboard/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/enterprises/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/helpers/middleware/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/landing/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/profiles/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/tenants/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/requirements/dev.in: -------------------------------------------------------------------------------- 1 | pip-tools 2 | rav -------------------------------------------------------------------------------- /src/subscriptions/management/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/subscriptions/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/commando/management/commands/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/subscriptions/management/commands/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/auth/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /src/auth/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /src/auth/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /src/checkouts/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /src/commando/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /src/dashboard/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /src/landing/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /src/landing/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /src/profiles/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /src/profiles/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /src/tenants/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /src/visits/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /src/checkouts/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /src/checkouts/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /src/commando/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /src/commando/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | # Create your views here. 4 | -------------------------------------------------------------------------------- /src/customers/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /src/customers/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | # Create your views here. 4 | -------------------------------------------------------------------------------- /src/dashboard/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /src/dashboard/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /src/enterprises/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /src/enterprises/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /src/landing/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /src/profiles/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /src/subscriptions/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /src/visits/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /src/enterprises/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /saas.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "." 5 | } 6 | ], 7 | "settings": {} 8 | } -------------------------------------------------------------------------------- /src/helpers/__init__.py: -------------------------------------------------------------------------------- 1 | from .downloader import download_to_local 2 | 3 | __all__ = ['download_to_local'] -------------------------------------------------------------------------------- /src/templates/base/js.html: -------------------------------------------------------------------------------- 1 | {% load static %} 2 | -------------------------------------------------------------------------------- /src/staticfiles/base_tailwind/tailwind-input.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; -------------------------------------------------------------------------------- /src/helpers/neonctl/__init__.py: -------------------------------------------------------------------------------- 1 | from .clients import NeonBranchClient 2 | 3 | __all__ = [ 4 | "NeonBranchClient" 5 | ] -------------------------------------------------------------------------------- /src/templates/base/css.html: -------------------------------------------------------------------------------- 1 | {% load static %} 2 | -------------------------------------------------------------------------------- /src/helpers/security/blocked_lists.py: -------------------------------------------------------------------------------- 1 | BLOCKED_LIST = [ 2 | "apple", 3 | "admin", 4 | "www", 5 | "blocked" 6 | ] -------------------------------------------------------------------------------- /src/helpers/db/__init__.py: -------------------------------------------------------------------------------- 1 | from .context import use_dynamic_database_url 2 | 3 | __all__ = [ 4 | 'use_dynamic_database_url' 5 | ] -------------------------------------------------------------------------------- /src/helpers/db/context/__init__.py: -------------------------------------------------------------------------------- 1 | from .managers import use_dynamic_database_url 2 | 3 | __all__ = [ 4 | 'use_dynamic_database_url' 5 | ] -------------------------------------------------------------------------------- /src/helpers/db/engine/base.py: -------------------------------------------------------------------------------- 1 | from django.db.backends.postgresql import base 2 | 3 | class DatabaseWrapper(base.DatabaseWrapper): 4 | schema_name = None -------------------------------------------------------------------------------- /src/helpers/date_utils.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | 3 | def timestamp_as_datetime(timestamp): 4 | return datetime.datetime.fromtimestamp(timestamp, tz=datetime.UTC) -------------------------------------------------------------------------------- /src/customers/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | from .models import Customer 5 | 6 | admin.site.register(Customer) -------------------------------------------------------------------------------- /src/auth/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class AuthConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "auth" 7 | -------------------------------------------------------------------------------- /src/staticfiles/images/flowbite-phone-mockup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codingforentrepreneurs/SaaS-for-Enterprise-with-Django/HEAD/src/staticfiles/images/flowbite-phone-mockup.png -------------------------------------------------------------------------------- /src/visits/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class VisitsConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "visits" 7 | -------------------------------------------------------------------------------- /src/commando/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class CommandoConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "commando" 7 | -------------------------------------------------------------------------------- /src/landing/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class LandingConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "landing" 7 | -------------------------------------------------------------------------------- /src/profiles/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ProfilesConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "profiles" 7 | -------------------------------------------------------------------------------- /src/tenants/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class TenantsConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "tenants" 7 | -------------------------------------------------------------------------------- /src/checkouts/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class CheckoutsConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "checkouts" 7 | -------------------------------------------------------------------------------- /src/customers/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class CustomersConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "customers" 7 | -------------------------------------------------------------------------------- /src/dashboard/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class DashboardConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "dashboard" 7 | -------------------------------------------------------------------------------- /src/enterprises/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class EnterprisesConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "enterprises" 7 | -------------------------------------------------------------------------------- /src/templates/snippets/welcome-user-msg.html: -------------------------------------------------------------------------------- 1 |
{{ message }}
7 |Plan name: {{ subscription.plan_name }}
16 | 17 |Status: {{ subscription.status|title }}
18 | 19 |Membership age: {{ subscription.original_period_start|timesince }}
20 |Start: {{ subscription.current_period_start }}
21 | 22 |End: {{ subscription.current_period_end|timeuntil }} ({{ subscription.current_period_end }})
23 | 24 | {% endblock content %} 25 | 26 | -------------------------------------------------------------------------------- /src/subscriptions/migrations/0005_alter_subscription_permissions.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 5.0.6 on 2024-06-01 21:51 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | dependencies = [ 8 | ("auth", "0012_alter_user_first_name_max_length"), 9 | ("subscriptions", "0004_subscription_permissions"), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name="subscription", 15 | name="permissions", 16 | field=models.ManyToManyField( 17 | limit_choices_to={ 18 | "codename__in": ["advanced", "pro", "basic", "basic_ai"], 19 | "content_type__app_label": "subscriptions", 20 | }, 21 | to="auth.permission", 22 | ), 23 | ), 24 | ] 25 | -------------------------------------------------------------------------------- /src/templates/landing/proof.html: -------------------------------------------------------------------------------- 1 |{{ object.display_sub_subtitle }}
6 | {% endif %} 7 |From checkout to global sales tax compliance, companies around the world use Flowbite to simplify their payment stack.
7 | 8 | Get started 9 | 10 | 11 | 12 | Speak to Sales 13 | 14 |
17 | Here at SaaS we focus on markets where technology, innovation, and capital can unlock long-term value and drive economic growth.
14 | 15 | 25 |Here at Flowbite we focus on markets where technology, innovation, and capital can unlock long-term value and drive economic growth.
6 |Plan it, create it, launch it. Collaborate seamlessly with all the organization and hit your marketing goals every month with our marketing plan.
14 |Protect your organization, devices and stay compliant with our structured workflows and custom permissions made for you.
21 |Auto-assign tasks, send Slack messages, and much more. Now power up with hundreds of new templates to help you get started.
28 |Audit-proof software built for critical financial operations like month-end close and quarterly budgeting.
35 |Craft beautiful, delightful experiences for both marketing and product with real cross-company collaboration.
42 |Keep your company’s lights on with customizable, iterative, and structured workflows built for all efficient teams and individual.
49 |