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
Updates to `backend`:
- FastAPI 0.99 -> 0.109 (Inboard 0.51 -> 0.68)
- Pydantic 1.10 -> 2.7.1
Updates to `frontend`:
- NuxtJS 3.6.5 -> 3.11.2
- Nuxtjs i18n 8.0.0 RC -> 8.3.1
The Pydantic change is dramatic, so please revise their [migration guide](https://docs.pydantic.dev/2.7/migration/). Similarly, [nuxt/i18n](https://i18n.nuxtjs.org/docs/getting-started) has some major quality of life improvements.
This update necessitated refactoring across the stack.
Accelerate your next web development project with this FastAPI/Nuxt.js base project generator.
5
+
Accelerate your next web development project with this FastAPI/NuxtJS base project generator.
6
6
7
7
This project is for developers looking to build and maintain full-feature progressive web applications using Python on the backend / Typescript on the frontend, and want the complex-but-routine aspects of auth 'n auth, and component and deployment configuration, taken care of, including interactive API documentation.
8
8
9
-
This is a comprehensively updated fork of [Sebastián Ramírez's](https://github.com/tiangolo)[Full Stack FastAPI and PostgreSQL Base Project Generator](https://github.com/tiangolo/full-stack-fastapi-postgresql). FastAPI is updated to version 0.99 (July 2023), SQLAlchemy to version 2.0 (July 2023), and the frontend to Nuxt 3.6 (July 2023).
9
+
This project is a fork of [Sebastián Ramírez's](https://github.com/tiangolo)[Full Stack FastAPI and PostgreSQL Base Project Generator](https://github.com/tiangolo/full-stack-fastapi-postgresql). FastAPI is updated to version 0.109 (April 2024), SQLAlchemy to version 2.0.29 (March 2024), and the frontend to Nuxt 3.11 (April 2024).
10
10
11
-
-[Screenshots](#screenshots)
12
11
-[Key features](#key-features)
12
+
-[Screenshots](#screenshots)
13
13
-[How to use it](#how-to-use-it)
14
14
-[Getting started](./docs/getting-started.md)
15
15
-[Development and installation](./docs/development-guide.md)
16
16
-[Deployment for production](./docs/deployment-guide.md)
17
17
-[Authentication and magic tokens](./docs/authentication-guide.md)
18
18
-[Websockets for interactive communication](./docs/websocket-guide.md)
19
+
-[Fork differences](#fork-differences)
19
20
-[More details](#more-details)
20
21
-[Help needed](#help-needed)
21
22
-[Release notes](#release-notes)
22
23
-[License](#license)
23
24
24
-
## Screenshots
25
-
26
-
### App landing page
27
-
28
-

29
-
30
-
### Dashboard Login
31
-
32
-

33
-
34
-
### Dashboard User Management
35
-
36
-

37
-
38
-
### Interactive API documentation
39
-
40
-

41
-
42
-
### Enabling two-factor security (TOTP)
43
-
44
-

45
-
46
25
## Key features
47
26
48
27
This FastAPI, PostgreSQL, Neo4j & Nuxt 3 repo will generate a complete web application stack as a foundation for your project development.
49
28
50
29
-**Docker Compose** integration and optimization for local development.
51
30
-**Authentication** user management schemas, models, crud and apis already built, with OAuth2 JWT token support & default hashing. Offers _magic link_ authentication, with password fallback, with cookie management, including `access` and `refresh` tokens.
52
-
-[**FastAPI**](https://github.com/tiangolo/fastapi) backend with [Inboard](https://inboard.bws.bio/) one-repo Docker images:
31
+
-[**FastAPI**](https://github.com/tiangolo/fastapi) backend with [Inboard](https://inboard.bws.bio/) one-repo Docker images, using Python 3.11:
53
32
-**SQLAlchemy** version 2.0 support for models.
54
-
-**MJML**templates for common email transactions.
33
+
-**Pydantic**version 2.7 for schemas.
55
34
-**Metadata Schema** based on [Dublin Core](https://www.dublincore.org/specifications/dublin-core/dcmi-terms/#section-3) for inheritance.
56
35
-**Common CRUD** support via generic inheritance.
57
36
-**Standards-based**: Based on (and fully compatible with) the open standards for APIs: [OpenAPI](https://github.com/OAI/OpenAPI-Specification) and [JSON Schema](http://json-schema.org/).
37
+
-**MJML** templates for common email transactions.
58
38
-[**Many other features**]("https://fastapi.tiangolo.com/features/"): including automatic validation, serialization, interactive documentation, etc.
59
-
-[**Nuxt/Vue 3**](https://nuxt.com/) frontend:
39
+
-[**Nuxt/Vue 3**](https://nuxt.com/) frontend using TypeScript:
60
40
-**Authorisation** via middleware for page access, including logged in or superuser.
61
41
-**Model blog** project, with [Nuxt Content](https://content.nuxtjs.org/) for writing Markdown pages.
62
42
-**Form validation** with [Vee-Validate 4](https://vee-validate.logaretm.com/v4/).
63
43
-**State management** with [Pinia](https://pinia.vuejs.org/), and persistance with [Pinia PersistedState](https://prazdevs.github.io/pinia-plugin-persistedstate/).
64
44
-**CSS and templates** with [TailwindCSS](https://tailwindcss.com/), [HeroIcons](https://heroicons.com/), and [HeadlessUI](https://headlessui.com/).
65
-
-**Internationalisation** with [@nuxt/i18n](https://nuxt.com/modules/i18n).
66
-
-**PWA support** with [Vite PWA plugin](https://vite-pwa-org.netlify.app/frameworks/nuxt.html).
67
45
-**PostgreSQL** database.
68
46
-**PGAdmin** for PostgreSQL database management.
69
47
-**Celery** worker that can import and use models and code from the rest of the backend selectively.
70
48
-**Flower** for Celery jobs monitoring.
71
49
-**Neo4j** graph database, including integration into the FastAPI base project.
72
50
- Load balancing between frontend and backend with **Traefik**, so you can have both under the same domain, separated by path, but served by different containers.
73
51
- Traefik integration, including Let's Encrypt **HTTPS** certificates automatic generation.
74
-
- GitLab **CI** (continuous integration), including frontend and backend testing.
52
+
53
+
## Screenshots
54
+
55
+
### App landing page
56
+
57
+

58
+
59
+
### Dashboard Login
60
+
61
+

62
+
63
+
### Dashboard User Management
64
+
65
+

66
+
67
+
### Interactive API documentation
68
+
69
+

70
+
71
+
### Enabling two-factor security (TOTP)
72
+
73
+

75
74
76
75
## How to use it
77
76
@@ -81,15 +80,32 @@ This FastAPI, PostgreSQL, Neo4j & Nuxt 3 repo will generate a complete web appli
81
80
-[Authentication and magic tokens](./docs/authentication-guide.md)
82
81
-[Websockets for interactive communication](./docs/websocket-guide.md)
83
82
83
+
## Fork differences
84
+
85
+
The original objective of this fork was to maintain parity with the [Full Stack FastAPI and PostgreSQL Base Project Generator](https://github.com/tiangolo/full-stack-fastapi-postgresql) but update it to bring it up to current stack versions, fixes, and with a complete auth 'n auth system.
86
+
87
+
With the most recent updates to the base stack, Sebastián has made some fairly dramatic changes and these two stacks are no longer compatible. This table presents a summary of the major differences:
I use this stack to produce some fairly complex web-based applications and I need to get to the full APIs for SQLAlchemy and Pydantic, and SqlModel doesn't offer me that. I also need to run distributed asyncronous tasks, so Celery is important. Finally, I prefer Nuxt.
97
+
98
+
This stack also has a much more sophisticated and feature-complete auth 'n auth system which is a requirement for any web app.
99
+
84
100
## More details
85
101
86
102
After using this generator, your new project (the directory created) will contain an extensive `README.md` with instructions for development, deployment, etc. You can pre-read [the project `README.md` template here too](./{{cookiecutter.project_slug}}/README.md).
87
103
88
-
This current release (August 2023) is for FastAPI version 0.99 and is the last before introducing support for Pydantic 2. Since this is intended as a base stack on which you will build complex applications, there is no intention of backwards compatability between releases, and the objective is to ensure that each release has the latest long-term-support versions of the core libraries so that you can rely on your application core for as long as possible.
104
+
This current release (May 2024) is for FastAPI version 0.109 introduces support for Pydantic 2.7. Since this is intended as a base stack on which you will build complex applications, there is no intention of backwards compatability between releases, and the objective is to ensure that each release has the latest long-term-support versions of the core libraries so that you can rely on your application core for as long as possible.
89
105
90
-
To align with [Inboard](https://inboard.bws.bio/), Poetry has been deprecated in favour of [Hatch](https://hatch.pypa.io/latest/). This will also, hopefully, sort out some Poetry-related Docker build errors.
106
+
To align with [Inboard](https://inboard.bws.bio/), Poetry has been deprecated in favour of [Hatch](https://hatch.pypa.io/latest/).
91
107
92
-
You will also find an initial implementation of internationalisation using [@nuxt/i18n](https://nuxt.com/modules/i18n). This is - at this time - a release candidate, so please do update and check their documentation for any changes. The [Vite PWA plugin](https://vite-pwa-org.netlify.app/frameworks/nuxt.html) is also included, along with a Node CLI for generating all necessary app icons. You will see links and notes to this in the [nuxt.config.ts](./{{cookiecutter.project_slug}}/frontend/nuxt.config.ts) file.
108
+
You will also find an initial implementation of internationalisation using [@nuxt/i18n](https://nuxt.com/modules/i18n). The [Vite PWA plugin](https://vite-pwa-org.netlify.app/frameworks/nuxt.html) is also included, along with a Node CLI for generating all necessary app icons. You will see links and notes to this in the [nuxt.config.ts](./{{cookiecutter.project_slug}}/frontend/nuxt.config.ts) file.
93
109
94
110
## Help needed
95
111
@@ -103,6 +119,18 @@ The tests are broken and it would be great if someone could take that on. Other
103
119
104
120
See notes and [releases](https://github.com/whythawk/full-stack-fastapi-postgresql/releases).
105
121
122
+
## 0.9.0
123
+
124
+
Updates to `backend`:
125
+
- FastAPI 0.99 -> 0.109 (Inboard 0.51 -> 0.68)
126
+
- Pydantic 1.10 -> 2.7.1
127
+
128
+
Updates to `frontend`:
129
+
- NuxtJS 3.6.5 -> 3.11.2
130
+
- Nuxtjs i18n 8.0.0 RC -> 8.3.1
131
+
132
+
The Pydantic change is dramatic, so please revise their [migration guide](https://docs.pydantic.dev/2.7/migration/). Similarly, [nuxt/i18n](https://i18n.nuxtjs.org/docs/getting-started) has some major quality of life improvements.
133
+
106
134
## 0.8.2
107
135
108
136
Fixing [#39](https://github.com/whythawk/full-stack-fastapi-postgresql/issues/39), thanks to @a-vorobyoff:
Copy file name to clipboardexpand all lines: docs/getting-started.md
+16-4
Original file line number
Diff line number
Diff line change
@@ -25,14 +25,15 @@ It consists of the following key components:
25
25
26
26
-**Docker Compose** integration and optimization for local development.
27
27
-**Authentication** user management schemas, models, crud and apis already built, with OAuth2 JWT token support & default hashing. Offers _magic link_ authentication, with password fallback, with cookie management, including `access` and `refresh` tokens.
28
-
-[**FastAPI**](https://github.com/tiangolo/fastapi) backend with [Inboard](https://inboard.bws.bio/) one-repo Docker images:
28
+
-[**FastAPI**](https://github.com/tiangolo/fastapi) backend with [Inboard](https://inboard.bws.bio/) one-repo Docker images, using Python 3.11:
29
29
-**SQLAlchemy** version 2.0 support for models.
30
-
-**MJML**templates for common email transactions.
30
+
-**Pydantic**version 2.7 for schemas.
31
31
-**Metadata Schema** based on [Dublin Core](https://www.dublincore.org/specifications/dublin-core/dcmi-terms/#section-3) for inheritance.
32
32
-**Common CRUD** support via generic inheritance.
33
33
-**Standards-based**: Based on (and fully compatible with) the open standards for APIs: [OpenAPI](https://github.com/OAI/OpenAPI-Specification) and [JSON Schema](http://json-schema.org/).
34
+
-**MJML** templates for common email transactions.
34
35
-[**Many other features**]("https://fastapi.tiangolo.com/features/"): including automatic validation, serialization, interactive documentation, etc.
35
-
-[**Nuxt/Vue 3**](https://nuxt.com/) frontend:
36
+
-[**Nuxt/Vue 3**](https://nuxt.com/) frontend using TypeScript:
36
37
-**Authorisation** via middleware for page access, including logged in or superuser.
37
38
-**Model blog** project, with [Nuxt Content](https://content.nuxtjs.org/) for writing Markdown pages.
38
39
-**Form validation** with [Vee-Validate 4](https://vee-validate.logaretm.com/v4/).
@@ -45,7 +46,6 @@ It consists of the following key components:
45
46
-**Neo4j** graph database, including integration into the FastAPI base project.
46
47
- Load balancing between frontend and backend with **Traefik**, so you can have both under the same domain, separated by path, but served by different containers.
47
48
- Traefik integration, including Let's Encrypt **HTTPS** certificates automatic generation.
48
-
- GitLab **CI** (continuous integration), including frontend and backend testing.
49
49
50
50
## Who is it for?
51
51
@@ -105,6 +105,18 @@ After using this generator, your new project will contain an extensive `README.m
105
105
106
106
See notes and [releases](https://github.com/whythawk/full-stack-fastapi-postgresql/releases). The last four release notes are listed here:
107
107
108
+
## 0.9.0
109
+
110
+
Updates to `backend`:
111
+
- FastAPI 0.99 -> 0.109 (Inboard 0.51 -> 0.68)
112
+
- Pydantic 1.10 -> 2.7.1
113
+
114
+
Updates to `frontend`:
115
+
- NuxtJS 3.6.5 -> 3.11.2
116
+
- Nuxtjs i18n 8.0.0 RC -> 8.3.1
117
+
118
+
The Pydantic change is dramatic, so please revise their [migration guide](https://docs.pydantic.dev/2.7/migration/). Similarly, [nuxt/i18n](https://i18n.nuxtjs.org/docs/getting-started) has some major quality of life improvements.
119
+
108
120
## 0.8.2
109
121
110
122
Fixing [#39](https://github.com/whythawk/full-stack-fastapi-postgresql/issues/39), thanks to @a-vorobyoff:
Copy file name to clipboardexpand all lines: {{cookiecutter.project_slug}}/README.md
+14-14
Original file line number
Diff line number
Diff line change
@@ -30,13 +30,13 @@ Traefik UI, to see how the routes are being handled by the proxy: http://localho
30
30
To check the logs, run:
31
31
32
32
```bash
33
-
docker-compose logs
33
+
dockercompose logs
34
34
```
35
35
36
36
To check the logs of a specific service, add the name of the service, e.g.:
37
37
38
38
```bash
39
-
docker-compose logs backend
39
+
dockercompose logs backend
40
40
```
41
41
42
42
If your Docker is not running in `localhost` (the URLs above wouldn't work) check the sections below on **Development with Docker Toolbox** and **Development with a custom IP**.
@@ -81,21 +81,21 @@ The changes to that file only affect the local development environment, not the
81
81
For example, the directory with the backend code is mounted as a Docker "host volume", mapping the code you change live to the directory inside the container. That allows you to test your changes right away, without having to build the Docker image again. It should only be done during development, for production, you should build the Docker image with a recent version of the backend code. But during development, it allows you to iterate very fast. Have in mind that if you have a syntax error and save the Python file, it will break and exit, and the container will stop. After that, you can restart the container by fixing the error and running again:
82
82
83
83
```console
84
-
$ docker-compose up -d
84
+
$ dockercompose up -d
85
85
```
86
86
87
87
There is also a commented out `command` override, you can uncomment it and comment the default one. It makes the backend container run a process that does "nothing", but keeps the container alive. That allows you to get inside your running container and execute commands inside, for example a Python interpreter to test installed dependencies, or start the development server that reloads when it detects changes, or start a Jupyter Notebook session.
88
88
89
89
To get inside the container with a `bash` session you can start the stack with:
90
90
91
91
```console
92
-
$ docker-compose up -d
92
+
$ dockercompose up -d
93
93
```
94
94
95
95
and then `exec` inside the running container:
96
96
97
97
```console
98
-
$ docker-compose exec backend bash
98
+
$ dockercompose exec backend bash
99
99
```
100
100
101
101
You should see an output like:
@@ -133,23 +133,23 @@ The `./backend/app` directory is mounted as a "host volume" inside the docker co
133
133
You can rerun the test on live code:
134
134
135
135
```Bash
136
-
docker-compose exec backend /app/tests-start.sh
136
+
dockercompose exec backend /app/tests-start.sh
137
137
```
138
138
139
139
#### Test running stack
140
140
141
141
If your stack is already up and you just want to run the tests, you can use:
142
142
143
143
```bash
144
-
docker-compose exec backend /app/tests-start.sh
144
+
dockercompose exec backend /app/tests-start.sh
145
145
```
146
146
147
147
That `/app/tests-start.sh` script just calls `pytest` after making sure that the rest of the stack is running. If you need to pass extra arguments to `pytest`, you can pass them to that command and they will be forwarded.
### Live development with Python Jupyter Notebooks
@@ -177,7 +177,7 @@ The `docker-compose.override.yml` file sends a variable `env` with a value `dev`
177
177
So, you can enter into the running Docker container:
178
178
179
179
```bash
180
-
docker-compose exec backend bash
180
+
dockercompose exec backend bash
181
181
```
182
182
183
183
And use the environment variable `$JUPYTER` to run a Jupyter Notebook with everything configured to listen on the public port (so that you can use it from your browser).
@@ -218,7 +218,7 @@ Make sure you create a "revision" of your models and that you "upgrade" your dat
218
218
* Start an interactive session in the backend container:
219
219
220
220
```console
221
-
$ docker-compose exec backend bash
221
+
$ dockercompose exec backend bash
222
222
```
223
223
224
224
* If you created a new model in `./backend/app/app/models/`, make sure to import it in `./backend/app/app/db/base.py`, that Python module (`base.py`) that imports all the models will be used by Alembic.
@@ -349,7 +349,7 @@ That variable will make your frontend communicate with that domain when interact
349
349
After changing the two lines, you can re-start your stack with:
350
350
351
351
```bash
352
-
docker-compose up -d
352
+
dockercompose up -d
353
353
```
354
354
355
355
and check all the corresponding available URLs in the section at the end.
@@ -587,11 +587,11 @@ TAG=${TAG?Variable not set} \
587
587
# a default value of "production" if nothing else was passed
588
588
FRONTEND_ENV=${FRONTEND_ENV-production?Variable not set} \
589
589
# The actual comand that does the work: docker-compose
590
-
docker-compose \
590
+
dockercompose \
591
591
# Pass the file that should be used, setting explicitly docker-compose.yml avoids the
592
592
# default of also using docker-compose.override.yml
593
593
-f docker-compose.yml \
594
-
# Use the docker-compose sub command named "config", it just uses the docker-compose.yml
594
+
# Use the dockercompose sub command named "config", it just uses the docker-compose.yml
595
595
# file passed to it and prints their combined contents
596
596
# Put those contents in a file "docker-stack.yml", with ">"
0 commit comments