{"id":28739850,"url":"https://github.com/codingforentrepreneurs/saas-foundations","last_synced_at":"2025-06-16T06:11:03.096Z","repository":{"id":240758175,"uuid":"803394217","full_name":"codingforentrepreneurs/SaaS-Foundations","owner":"codingforentrepreneurs","description":"Django tutorial integrating TailwindCSS, Neon Postgres, Stripe API, User auth, deployment, \u0026 more.","archived":false,"fork":false,"pushed_at":"2024-09-11T05:15:34.000Z","size":233,"stargazers_count":284,"open_issues_count":5,"forks_count":167,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-06-10T01:58:38.392Z","etag":null,"topics":["deployment","django","flowbite","neon","postgres","tailwindcss"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/codingforentrepreneurs.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}},"created_at":"2024-05-20T16:29:42.000Z","updated_at":"2025-06-09T20:48:49.000Z","dependencies_parsed_at":"2024-05-30T23:41:08.856Z","dependency_job_id":null,"html_url":"https://github.com/codingforentrepreneurs/SaaS-Foundations","commit_stats":null,"previous_names":["codingforentrepreneurs/saas-foundations"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codingforentrepreneurs/SaaS-Foundations","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codingforentrepreneurs%2FSaaS-Foundations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codingforentrepreneurs%2FSaaS-Foundations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codingforentrepreneurs%2FSaaS-Foundations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codingforentrepreneurs%2FSaaS-Foundations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codingforentrepreneurs","download_url":"https://codeload.github.com/codingforentrepreneurs/SaaS-Foundations/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codingforentrepreneurs%2FSaaS-Foundations/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260109606,"owners_count":22960037,"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","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":["deployment","django","flowbite","neon","postgres","tailwindcss"],"created_at":"2025-06-16T06:11:01.959Z","updated_at":"2025-06-16T06:11:03.078Z","avatar_url":"https://github.com/codingforentrepreneurs.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SaaS Foundations\n\nBuild the foundations for a Software as a Service business by leveraging Django, Tailwind, htmx, Neon Postgres, Redis, and more.\n\nThe goal of this project is to learn how to create a reusable foundation for building SaaS products. When release, this course will span multiple topics and give you a solid foundation into build your business.\n\n\n## References\n\n- Deploy Django on [Railway](https://kirr.co/qysgeu) with [this Dockerfile and guide](https://www.codingforentrepreneurs.com/blog/deploy-django-on-railway-with-this-dockerfile/)\n- Create a One-Off Secret Key for Django [blog post](https://www.codingforentrepreneurs.com/blog/create-a-one-off-django-secret-key/)\n\n\nThank you to [Neon](https://kirr.co/eu0b31) for helping bring this course to life!\n\n\n## Getting Started\n\n### Clone\n```bash\nmkdir -p ~/dev/saas\ncd ~/dev/saas\ngit clone https://github.com/codingforentrepreneurs/SaaS-Foundations .\n```\n\n### Create Virtual Environment\n\n*macOS/Linux*\n```bash\npython3 --version # should be 3.11 or higher\npython3 -m venv venv\nsource venv/bin/activate\n```\n\n*Windows*\n```bash\nc:\\Python312\\python.exe -m venv venv\n.\\venv\\Scripts\\activate\n```\n\n### Install Requirements\n```bash\n# with venv activated\npip install pip --upgrade \u0026\u0026 pip install -r requirements.txt\n```\n\n### Sample dotenv to dotnev\n\n```bash\ncp .env.sample .env\ncat .env\n```\nValues include:\n- `DJANGO_DEBUG=1`\n- `DJANGO_SECRET_KEY=\"\"`\n- `DATABASE_URL=\"\"`\n- `EMAIL_HOST=\"smtp.gmail.com\"`\n- `EMAIL_PORT=\"587\"`\n- `EMAIL_USE_TLS=True`\n- `EMAIL_USE_SSL=False`\n- `EMAIL_HOST_USER=\"\"`\n- `EMAIL_HOST_PASSWORD=\"\"`\n- `ADMIN_USER_EMAIL=\"\"`\n- `STRIPE_SECRET_KEY=\"\"`\n\n\n### Create the _DJANGO_SECRET_KEY_\n\n```bash\npython -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())'\n```\nor\n```bash\nopenssl rand -base64 64\n```\nor\n```bash\npython -c 'import secrets; print(secrets.token_urlsafe(64))'\n```\n\nOnce you have this value, add update `DJANGO_SECRET_KEY` in `.env`.\n\n\n### Create [Neon](https://kirr.co/eu0b31) Postgres Database\n\n\n#### Install Neon CLI\nUsing the [Neon cli](https://neon.tech/docs/reference/cli-install) via [homebrew](https://brew.sh/):\n\n```bash\nbrew install neonctl\n```\n\n#### Login to Neon CLI\n\n```bash\nneonctl auth\n```\nThis will open a browser window to login.\n\n####  Create a new Neon project (optional)\n```bash\nneonctl projects create --name saas\n```\n\n#### Get the Project ID\n\nOnce created, get the project id: \n\n```bash\nneonctl projects list\n```\nProjects\n\n```bash\n┌──────────────────────────┬────────────────────────────┬───────────────┬──────────────────────┐\n│ Id                       │ Name                       │ Region Id     │ Created At           │\n├──────────────────────────┼────────────────────────────┼───────────────┼──────────────────────┤\n│ steep-base-11409687      │ saas                       │ aws-us-east-2 │ 2024-06-02T04:03:07Z │\n└──────────────────────────┴────────────────────────────┴───────────────┴──────────────────────┘\n```\n\n```bash\nPROJECT_ID=steep-base-11409687\n```\nReplace `steep-base-11409687` with your project id.\n\nOr using the shortcut:\n\n```bash\nPROJECT_ID=$(neonctl projects list | grep \"saas\" | awk -F '│' '{print $2}' | xargs)\n```\n\n#### Get the Database Connection String\n\n```bash\nneonctl connection-string --project-id \"$PROJECT_ID\"\n```\nSet this value to `DATABASE_URL` in `.env`. \n\n\n### Run Migrations\n\n```bash\nsource venv/bin/activate \n# or .\\venv\\Scripts\\activate if windows\ncd src\npython manage.py migrate\n```\n\n### Create a Superuser\n\n```bash\npython manage.py createsuperuser\n```\n\n### Pull Vendor Static Files\n\n```bash\npython manage.py vendor_pull\n```\n\n\n### Create a Stripe Account\n\n1. Sign up on [Stripe.com](https://www.stripe.com) for an account\n2. Get or create a Stripe Secret API Key (Dashboard \u003e Developers \u003e API keys \u003e _Secret key_ )\n3. Update _dotenv_ (`.env`) with the value `STRIPE_SECRET_KEY` with your key.\n\n\n### Run the Server\n\n```bash\npython manage.py runserver\n```\n\nReady to roll! 🚀\n\nMuch more coming soon!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodingforentrepreneurs%2Fsaas-foundations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodingforentrepreneurs%2Fsaas-foundations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodingforentrepreneurs%2Fsaas-foundations/lists"}