Skip to content

Commit b277018

Browse files
Fixed documentation website index routing
1 parent a32e5da commit b277018

File tree

6 files changed

+202
-68
lines changed

6 files changed

+202
-68
lines changed

README.md

Lines changed: 59 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,76 @@
11
# FastAPI, Jinja2, PostgreSQL Webapp Template
22

3+
34
![Screenshot of homepage](docs/static/Screenshot.png)
45

5-
## Documentation
6+
## Quickstart
67

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.
8+
This quickstart guide provides a high-level overview. See the full
9+
documentation for comprehensive information on
10+
[features](https://promptlytechnologies.com/fastapi-jinja2-postgres-webapp/index.html),
11+
[installation](https://promptlytechnologies.com/fastapi-jinja2-postgres-webapp/docs/installation.html),
12+
[architecture](https://promptlytechnologies.com/fastapi-jinja2-postgres-webapp/docs/architecture.html),
13+
[conventions, code style, and
14+
customization](https://promptlytechnologies.com/fastapi-jinja2-postgres-webapp/docs/customization.html),
15+
[deployment to cloud
16+
platforms](https://promptlytechnologies.com/fastapi-jinja2-postgres-webapp/docs/deployment.html),
17+
and
18+
[contributing](https://promptlytechnologies.com/fastapi-jinja2-postgres-webapp/docs/contributing.html).
819

920
## Features
1021

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:
22+
This template combines three of the most lightweight and performant
23+
open-source web development frameworks into a customizable webapp
24+
template with:
1225

1326
- Pure Python backend
14-
- Low-Javascript frontend
15-
- Powerful, easy-to-manage database layer
27+
- Minimal-Javascript frontend
28+
- Powerful, easy-to-manage database
1629

1730
The template also includes full-featured secure auth with:
1831

1932
- Token-based authentication
2033
- Password recovery flow
2134
- Role-based access control system
2235

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.
36+
## Design Philosophy
37+
38+
The design philosophy of the template is to prefer low-level,
39+
best-in-class open-source frameworks that offer flexibility,
40+
scalability, and performance without vendor-lock-in. You’ll find the
41+
template amazingly easy not only to understand and customize, but also
42+
to deploy to any major cloud hosting platform.
2443

25-
## Tech stack
44+
## Tech Stack
2645

2746
**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
47+
48+
- [FastAPI](https://fastapi.tiangolo.com/): scalable, high-performance,
49+
type-annotated Python web backend framework
50+
- [PostgreSQL](https://www.postgresql.org/): the world’s most advanced
51+
open-source database engine
52+
- [Jinja2](https://jinja.palletsprojects.com/en/3.1.x/): frontend HTML
53+
templating engine
3154
- [SQLModel](https://sqlmodel.tiangolo.com/): easy-to-use Python ORM
3255

3356
**Additional technologies:**
57+
3458
- [Poetry](https://python-poetry.org/): Python dependency manager
3559
- [Pytest](https://docs.pytest.org/en/7.4.x/): testing framework
3660
- [Docker](https://www.docker.com/): development containerization
3761
- [Github Actions](https://docs.github.com/en/actions): CI/CD pipeline
38-
- [Quarto](https://quarto.org/docs/): simple documentation website renderer
39-
- [MyPy](https://mypy.readthedocs.io/en/stable/): static type checker for Python
62+
- [Quarto](https://quarto.org/docs/): simple documentation website
63+
renderer
64+
- [MyPy](https://mypy.readthedocs.io/en/stable/): static type checker
65+
for Python
4066
- [Bootstrap](https://getbootstrap.com/): HTML/CSS styler
41-
- [Resend](https://resend.com/): zero- or low-cost email service used for password recovery
67+
- [Resend](https://resend.com/): zero- or low-cost email service used
68+
for password recovery
4269

43-
## Quickstart
70+
## Installation
4471

45-
For comprehensive installation instructions, see the [documentation website](https://promptlytechnologies.com/fastapi-jinja2-postgres-webapp/docs/).
72+
For comprehensive installation instructions, see the [installation
73+
page](https://promptlytechnologies.com/fastapi-jinja2-postgres-webapp/docs/installation.html).
4674

4775
### Python and Docker
4876

@@ -87,17 +115,22 @@ poetry install
87115
poetry shell
88116
```
89117

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.)
118+
(Note: You will need to activate the shell every time you open a new
119+
terminal session. Alternatively, you can use the `poetry run` prefix
120+
before other commands to run them without activating the shell.)
91121

92122
### Set environment variables
93123

94124
Copy .env.example to .env with `cp .env.example .env`.
95125

96-
Generate a 256 bit secret key with `openssl rand -base64 32` and paste it into the .env file.
126+
Generate a 256 bit secret key with `openssl rand -base64 32` and paste
127+
it into the .env file.
97128

98129
Set your desired database name, username, and password in the .env file.
99130

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.
131+
To use password recovery, register a [Resend](https://resend.com/)
132+
account, verify a domain, get an API key, and paste the API key into the
133+
.env file.
101134

102135
### Start development database
103136

@@ -107,7 +140,8 @@ docker compose up -d
107140

108141
### Run the development server
109142

110-
Make sure the development database is running and tables and default permissions/roles are created first.
143+
Make sure the development database is running and tables and default
144+
permissions/roles are created first.
111145

112146
``` bash
113147
uvicorn main:app --host 0.0.0.0 --port 8000 --reload
@@ -123,8 +157,12 @@ mypy .
123157

124158
### Contributing
125159

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.
160+
Your contributions are welcome! See the [issues
161+
page](https://github.com/promptly-technologies-llc/fastapi-jinja2-postgres-webapp/issues)
162+
for ideas. Fork the repository, create a new branch, make your changes,
163+
and submit a pull request.
127164

128165
### License
129166

130-
This project is licensed under the MIT License. See the LICENSE file for more details.
167+
This project is licensed under the MIT License. See the LICENSE file for
168+
more details.

_quarto.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ website:
66
title: "FastAPI Webapp Template"
77
navbar:
88
left:
9-
- href: docs/index.qmd
9+
- href: index.qmd
1010
text: Home
1111
- href: docs/architecture.qmd
1212
text: Architecture

docs/contributing.qmd

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,17 @@ Fork the repository, create a new branch, make your changes, and submit a pull r
88

99
### Render the documentation
1010

11-
The documentation is rendered with [Quarto](https://quarto.org/docs/). Make changes to the `.qmd` files in the `docs` folder. Then run the following command to render:
11+
The README and documentation website are rendered with [Quarto](https://quarto.org/docs/). Make changes to the `.qmd` files in the root folder and the `docs` folder. Then run the following commands to render:
1212

1313
``` bash
14+
# To render the documentation website
1415
quarto render
16+
# To render the README
17+
quarto render index.qmd --output-dir . --output README.md --to gfm
1518
```
1619

20+
Due to a quirk of Quarto, an unnecessary `index.html` file is created in the root folder when the README is rendered. This file can be safely deleted.
21+
1722
## Maintainers
1823

1924
### Increment the version

docs/index.qmd

Lines changed: 0 additions & 45 deletions
This file was deleted.

index.qmd

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
---
2+
title: "FastAPI, Jinja2, PostgreSQL Webapp Template"
3+
---
4+
5+
![Screenshot of homepage](docs/static/Screenshot.png)
6+
7+
## Quickstart
8+
9+
This quickstart guide provides a high-level overview. See the full documentation for comprehensive information on [features](https://promptlytechnologies.com/fastapi-jinja2-postgres-webapp/index.html), [installation](https://promptlytechnologies.com/fastapi-jinja2-postgres-webapp/docs/installation.html), [architecture](https://promptlytechnologies.com/fastapi-jinja2-postgres-webapp/docs/architecture.html), [conventions, code style, and customization](https://promptlytechnologies.com/fastapi-jinja2-postgres-webapp/docs/customization.html), [deployment to cloud platforms](https://promptlytechnologies.com/fastapi-jinja2-postgres-webapp/docs/deployment.html), and [contributing](https://promptlytechnologies.com/fastapi-jinja2-postgres-webapp/docs/contributing.html).
10+
11+
## Features
12+
13+
This template combines three of the most lightweight and performant open-source web development frameworks into a customizable webapp template with:
14+
15+
- Pure Python backend
16+
- Minimal-Javascript frontend
17+
- Powerful, easy-to-manage database
18+
19+
The template also includes full-featured secure auth with:
20+
21+
- Token-based authentication
22+
- Password recovery flow
23+
- Role-based access control system
24+
25+
## Design Philosophy
26+
27+
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.
28+
29+
## Tech Stack
30+
31+
**Core frameworks:**
32+
33+
- [FastAPI](https://fastapi.tiangolo.com/): scalable, high-performance, type-annotated Python web backend framework
34+
- [PostgreSQL](https://www.postgresql.org/): the world's most advanced open-source database engine
35+
- [Jinja2](https://jinja.palletsprojects.com/en/3.1.x/): frontend HTML templating engine
36+
- [SQLModel](https://sqlmodel.tiangolo.com/): easy-to-use Python ORM
37+
38+
**Additional technologies:**
39+
40+
- [Poetry](https://python-poetry.org/): Python dependency manager
41+
- [Pytest](https://docs.pytest.org/en/7.4.x/): testing framework
42+
- [Docker](https://www.docker.com/): development containerization
43+
- [Github Actions](https://docs.github.com/en/actions): CI/CD pipeline
44+
- [Quarto](https://quarto.org/docs/): simple documentation website renderer
45+
- [MyPy](https://mypy.readthedocs.io/en/stable/): static type checker for Python
46+
- [Bootstrap](https://getbootstrap.com/): HTML/CSS styler
47+
- [Resend](https://resend.com/): zero- or low-cost email service used for password recovery
48+
49+
## Installation
50+
51+
For comprehensive installation instructions, see the [installation page](https://promptlytechnologies.com/fastapi-jinja2-postgres-webapp/docs/installation.html).
52+
53+
### Python and Docker
54+
55+
- [Python 3.12 or higher](https://www.python.org/downloads/)
56+
- [Docker and Docker Compose](https://docs.docker.com/get-docker/)
57+
58+
### PostgreSQL headers
59+
60+
For Ubuntu/Debian:
61+
62+
``` bash
63+
sudo apt update && sudo apt install -y python3-dev libpq-dev
64+
```
65+
66+
For macOS:
67+
68+
``` bash
69+
brew install postgresql
70+
```
71+
72+
For Windows:
73+
74+
- No installation required
75+
76+
### Python dependencies
77+
78+
1. Install Poetry
79+
80+
``` bash
81+
pipx install poetry
82+
```
83+
84+
2. Install project dependencies
85+
86+
``` bash
87+
poetry install
88+
```
89+
90+
3. Activate shell
91+
92+
``` bash
93+
poetry shell
94+
```
95+
96+
(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.)
97+
98+
### Set environment variables
99+
100+
Copy .env.example to .env with `cp .env.example .env`.
101+
102+
Generate a 256 bit secret key with `openssl rand -base64 32` and paste it into the .env file.
103+
104+
Set your desired database name, username, and password in the .env file.
105+
106+
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.
107+
108+
### Start development database
109+
110+
``` bash
111+
docker compose up -d
112+
```
113+
114+
### Run the development server
115+
116+
Make sure the development database is running and tables and default permissions/roles are created first.
117+
118+
``` bash
119+
uvicorn main:app --host 0.0.0.0 --port 8000 --reload
120+
```
121+
122+
Navigate to http://localhost:8000/
123+
124+
### Lint types with mypy
125+
126+
``` bash
127+
mypy .
128+
```
129+
130+
### Contributing
131+
132+
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.
133+
134+
### License
135+
136+
This project is licensed under the MIT License. See the LICENSE file for more details.

static/Screenshot.png

114 KB
Loading

0 commit comments

Comments
 (0)