Skip to content

Commit ea50480

Browse files
committed
prod
0 parents  commit ea50480

File tree

162 files changed

+18101
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+18101
-0
lines changed

.copier/.copier-answers.yml.jinja

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{ _copier_answers|to_json -}}

.copier/update_dotenv.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from pathlib import Path
2+
import json
3+
4+
# Update the .env file with the answers from the .copier-answers.yml file
5+
# without using Jinja2 templates in the .env file, this way the code works as is
6+
# without needing Copier, but if Copier is used, the .env file will be updated
7+
root_path = Path(__file__).parent.parent
8+
answers_path = Path(__file__).parent / ".copier-answers.yml"
9+
answers = json.loads(answers_path.read_text())
10+
env_path = root_path / ".env"
11+
env_content = env_path.read_text()
12+
lines = []
13+
for line in env_content.splitlines():
14+
for key, value in answers.items():
15+
upper_key = key.upper()
16+
if line.startswith(f"{upper_key}="):
17+
if " " in value:
18+
content = f"{upper_key}={value!r}"
19+
else:
20+
content = f"{upper_key}={value}"
21+
new_line = line.replace(line, content)
22+
lines.append(new_line)
23+
break
24+
else:
25+
lines.append(line)
26+
env_path.write_text("\n".join(lines))

.env

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Domain
2+
# This would be set to the production domain with an env var on deployment
3+
DOMAIN=localhost
4+
5+
# Environment: local, staging, production
6+
ENVIRONMENT=local
7+
8+
PROJECT_NAME="Full Stack FastAPI Project"
9+
STACK_NAME=full-stack-fastapi-project
10+
11+
# Backend
12+
BACKEND_CORS_ORIGINS="http://localhost,http://localhost:5173,https://localhost,https://localhost:5173,http://localhost.tiangolo.com"
13+
SECRET_KEY=changethis
14+
FIRST_SUPERUSER=admin@example.com
15+
FIRST_SUPERUSER_PASSWORD=changethis
16+
USERS_OPEN_REGISTRATION=False
17+
18+
# Emails
19+
SMTP_HOST=
20+
SMTP_USER=
21+
SMTP_PASSWORD=
22+
EMAILS_FROM_EMAIL=info@example.com
23+
SMTP_TLS=True
24+
SMTP_SSL=False
25+
SMTP_PORT=587
26+
27+
# Postgres
28+
POSTGRES_SERVER=localhost
29+
POSTGRES_PORT=5432
30+
POSTGRES_DB=app
31+
POSTGRES_USER=postgres
32+
POSTGRES_PASSWORD=changethis
33+
34+
SENTRY_DSN=
35+
36+
# Configure these with your own Docker registry images
37+
DOCKER_IMAGE_BACKEND=backend
38+
DOCKER_IMAGE_FRONTEND=frontend

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* text=auto
2+
*.sh text eol=lf
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
labels: [question]
2+
body:
3+
- type: markdown
4+
attributes:
5+
value: |
6+
Thanks for your interest in this project! 🚀
7+
8+
Please follow these instructions, fill every question, and do every step. 🙏
9+
10+
I'm asking this because answering questions and solving problems in GitHub is what consumes most of the time.
11+
12+
I end up not being able to add new features, fix bugs, review pull requests, etc. as fast as I wish because I have to spend too much time handling questions.
13+
14+
All that, on top of all the incredible help provided by a bunch of community members, that give a lot of their time to come here and help others.
15+
16+
That's a lot of work, but if more users came to help others like them just a little bit more, it would be much less effort for them (and you and me 😅).
17+
18+
By asking questions in a structured way (following this) it will be much easier to help you.
19+
20+
And there's a high chance that you will find the solution along the way and you won't even have to submit it and wait for an answer. 😎
21+
22+
As there are too many questions, I'll have to discard and close the incomplete ones. That will allow me (and others) to focus on helping people like you that follow the whole process and help us help you. 🤓
23+
- type: checkboxes
24+
id: checks
25+
attributes:
26+
label: First Check
27+
description: Please confirm and check all the following options.
28+
options:
29+
- label: I added a very descriptive title here.
30+
required: true
31+
- label: I used the GitHub search to find a similar question and didn't find it.
32+
required: true
33+
- label: I searched in the documentation/README.
34+
required: true
35+
- label: I already searched in Google "How to do X" and didn't find any information.
36+
required: true
37+
- label: I already read and followed all the tutorial in the docs/README and didn't find an answer.
38+
required: true
39+
- type: checkboxes
40+
id: help
41+
attributes:
42+
label: Commit to Help
43+
description: |
44+
After submitting this, I commit to one of:
45+
46+
* Read open questions until I find 2 where I can help someone and add a comment to help there.
47+
* I already hit the "watch" button in this repository to receive notifications and I commit to help at least 2 people that ask questions in the future.
48+
49+
options:
50+
- label: I commit to help with one of those options 👆
51+
required: true
52+
- type: textarea
53+
id: example
54+
attributes:
55+
label: Example Code
56+
description: |
57+
Please add a self-contained, [minimal, reproducible, example](https://stackoverflow.com/help/minimal-reproducible-example) with your use case.
58+
59+
If I (or someone) can copy it, run it, and see it right away, there's a much higher chance I (or someone) will be able to help you.
60+
61+
placeholder: |
62+
Write your example code here.
63+
render: Text
64+
validations:
65+
required: true
66+
- type: textarea
67+
id: description
68+
attributes:
69+
label: Description
70+
description: |
71+
What is the problem, question, or error?
72+
73+
Write a short description telling me what you are doing, what you expect to happen, and what is currently happening.
74+
placeholder: |
75+
* Open the browser and call the endpoint `/`.
76+
* It returns a JSON with `{"message": "Hello World"}`.
77+
* But I expected it to return `{"message": "Hello Morty"}`.
78+
validations:
79+
required: true
80+
- type: dropdown
81+
id: os
82+
attributes:
83+
label: Operating System
84+
description: What operating system are you on?
85+
multiple: true
86+
options:
87+
- Linux
88+
- Windows
89+
- macOS
90+
- Other
91+
validations:
92+
required: true
93+
- type: textarea
94+
id: os-details
95+
attributes:
96+
label: Operating System Details
97+
description: You can add more details about your operating system here, in particular if you chose "Other".
98+
validations:
99+
required: true
100+
- type: input
101+
id: python-version
102+
attributes:
103+
label: Python Version
104+
description: |
105+
What Python version are you using?
106+
107+
You can find the Python version with:
108+
109+
```bash
110+
python --version
111+
```
112+
validations:
113+
required: true
114+
- type: textarea
115+
id: context
116+
attributes:
117+
label: Additional Context
118+
description: Add any additional context information or screenshots you think are useful.

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: [tiangolo]

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Security Contact
4+
about: Please report security vulnerabilities to security@tiangolo.com
5+
- name: Question or Problem
6+
about: Ask a question or ask about a problem in GitHub Discussions.
7+
url: https://github.com/tiangolo/full-stack-fastapi-template/discussions/categories/questions
8+
- name: Feature Request
9+
about: To suggest an idea or ask about a feature, please start with a question saying what you would like to achieve. There might be a way to do it already.
10+
url: https://github.com/tiangolo/full-stack-fastapi-template/discussions/categories/questions

.github/ISSUE_TEMPLATE/privileged.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Privileged
2+
description: You are @tiangolo or he asked you directly to create an issue here. If not, check the other options. 👇
3+
body:
4+
- type: markdown
5+
attributes:
6+
value: |
7+
Thanks for your interest in this project! 🚀
8+
9+
If you are not @tiangolo or he didn't ask you directly to create an issue here, please start the conversation in a [Question in GitHub Discussions](https://github.com/tiangolo/full-stack-fastapi-template/discussions/categories/questions) instead.
10+
- type: checkboxes
11+
id: privileged
12+
attributes:
13+
label: Privileged issue
14+
description: Confirm that you are allowed to create an issue here.
15+
options:
16+
- label: I'm @tiangolo or he asked me directly to create an issue here.
17+
required: true
18+
- type: textarea
19+
id: content
20+
attributes:
21+
label: Issue Content
22+
description: Add the content of the issue here.

.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
updates:
3+
# GitHub Actions
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "daily"
8+
commit-message:
9+
prefix:
10+
# Python
11+
- package-ecosystem: "pip"
12+
directory: "/"
13+
schedule:
14+
interval: "daily"
15+
commit-message:
16+
prefix:
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Deploy to Production
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
jobs:
9+
deploy:
10+
runs-on:
11+
- self-hosted
12+
- production
13+
env:
14+
ENVIRONMENT: production
15+
DOMAIN: ${{ secrets.DOMAIN_PRODUCTION }}
16+
STACK_NAME: ${{ secrets.STACK_NAME_PRODUCTION }}
17+
SECRET_KEY: ${{ secrets.SECRET_KEY }}
18+
FIRST_SUPERUSER: ${{ secrets.FIRST_SUPERUSER }}
19+
FIRST_SUPERUSER_PASSWORD: ${{ secrets.FIRST_SUPERUSER_PASSWORD }}
20+
SMTP_HOST: ${{ secrets.SMTP_HOST }}
21+
SMTP_USER: ${{ secrets.SMTP_USER }}
22+
SMTP_PASSWORD: ${{ secrets.SMTP_PASSWORD }}
23+
EMAILS_FROM_EMAIL: ${{ secrets.EMAILS_FROM_EMAIL }}
24+
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
25+
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
- run: docker compose -f docker-compose.yml --project-name ${{ secrets.STACK_NAME_PRODUCTION }} build
30+
- run: docker compose -f docker-compose.yml --project-name ${{ secrets.STACK_NAME_PRODUCTION }} up -d

0 commit comments

Comments
 (0)