You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert

3
4
4
-
## FastAPI, Jinja2, PostgreSQL Webapp
5
+
## Documentation
5
6
6
-

7
+
This README provides a high-level overview. See the **[full documentation website](https://promptlytechnologies.com/fastapi-jinja2-postgres-webapp/docs/)** for more detailed information on installation, features, architecture, conventions and code style, customization, and deployment to cloud platforms.
7
8
8
-
This project is still under development.
9
+
## Features
9
10
10
-
### Architecture
11
+
*FastAPI, Jinja2, PostgreSQL Webapp Template* combines three of the most lightweight and performant open-source web development frameworks in existence into a customizable webapp template with:
11
12
12
-
This application uses a Post-Redirect-Get (PRG) pattern. The user
13
-
submits a form, which sends a POST request to a FastAPI endpoint on the
14
-
server. The database is updated, and the user is redirected to a GET
15
-
endpoint, which fetches the updated data and re-renders the Jinja2 page
16
-
template with the new data.
13
+
- Pure Python backend
14
+
- Low-Javascript frontend
15
+
- Powerful, easy-to-manage database layer
17
16
18
-

17
+
The template also includes full-featured secure auth with:
19
18
20
-
The advantage of the PRG pattern is that it is very straightforward to
21
-
implement and keeps most of the rendering logic on the server side. The
22
-
disadvantage is that it requires an extra round trip to the database to
23
-
fetch the updated data, and re-rendering the entire page template may be
24
-
less efficient than a partial page update on the client side.
19
+
- Token-based authentication
20
+
- Password recovery flow
21
+
- Role-based access control system
25
22
26
-
### Authentication Flow
23
+
The design philosophy of the template is to prefer low-level, best-in-class open-source frameworks that offer flexibility, scalability, and performance without vendor-lock-in. You'll find the template amazingly easy not only to understand and customize, but also to deploy to any major cloud hosting platform.
27
24
28
-
This application implements a comprehensive authentication system with
29
-
security best practices. The diagrams below show the main authentication
30
-
flows and security measures.
25
+
## Tech stack
31
26
32
-
#### Registration and Login Flow
27
+
**Core frameworks:**
28
+
-[FastAPI](https://fastapi.tiangolo.com/): scalable, high-performance, type-annotated Python web backend framework
29
+
-[PostgreSQL](https://www.postgresql.org/): the world's most advanced open-source database engine
30
+
-[Jinja2](https://jinja.palletsprojects.com/en/3.1.x/): frontend HTML templating engine
(Note: You will need to activate the shell every time you open a new
154
-
terminal session. Alternatively, you can use the `poetry run` prefix
155
-
before other commands to run them without activating the shell.)
90
+
(Note: You will need to activate the shell every time you open a new terminal session. Alternatively, you can use the `poetry run` prefix before other commands to run them without activating the shell.)
156
91
157
92
### Set environment variables
158
93
159
94
Copy .env.example to .env with `cp .env.example .env`.
160
95
161
-
Generate a 256 bit secret key with `openssl rand -base64 32` and paste
162
-
it into the .env file.
96
+
Generate a 256 bit secret key with `openssl rand -base64 32` and paste it into the .env file.
163
97
164
98
Set your desired database name, username, and password in the .env file.
165
99
166
-
To use password recovery, register a [Resend](https://resend.com/)
167
-
account, verify a domain, get an API key, and paste the API key into the
168
-
.env file.
100
+
To use password recovery, register a [Resend](https://resend.com/) account, verify a domain, get an API key, and paste the API key into the .env file.
169
101
170
102
### Start development database
171
103
@@ -175,8 +107,7 @@ docker compose up -d
175
107
176
108
### Run the development server
177
109
178
-
Make sure the development database is running and tables and default
179
-
permissions/roles are created first.
110
+
Make sure the development database is running and tables and default permissions/roles are created first.
@@ -190,22 +121,10 @@ Navigate to http://localhost:8000/
190
121
mypy .
191
122
```
192
123
193
-
### Render the README
194
-
195
-
When updating the documentation, remember to make changes in the
196
-
README.qmd file, not the README.md file. Then run the following command
197
-
to render the README.md file:
198
-
199
-
```bash
200
-
quarto render README.qmd
201
-
```
202
-
203
124
### Contributing
204
125
205
-
Fork the repository, create a new branch, make your changes, and submit
206
-
a pull request.
126
+
Your contributions are welcome! See the [issues page](https://github.com/promptly-technologies-llc/fastapi-jinja2-postgres-webapp/issues) for ideas. Fork the repository, create a new branch, make your changes, and submit a pull request.
207
127
208
128
### License
209
129
210
-
This project is licensed under the MIT License. See the LICENSE file for
211
-
more details.
130
+
This project is licensed under the MIT License. See the LICENSE file for more details.
0 commit comments