Skip to content

Commit 87616ec

Browse files
Make documentation project-specific
This commit revises the README.md and other documentation files to remove language that refers to your project as a template. Changes include: - Updating the main README.md title and removing sections related to template usage (e.g., "How To Use It", Copier instructions, template license). - Rephrasing content in `development.md`, `backend/README.md`, and `frontend/README.md` to be specific to this project rather than a generic template. - Removed the "Removing the frontend" section from `frontend/README.md` as it was template-specific advice. The documentation now more accurately reflects an active, specific project.
1 parent 51dab82 commit 87616ec

File tree

4 files changed

+26
-213
lines changed

4 files changed

+26
-213
lines changed

README.md

Lines changed: 1 addition & 165 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Full Stack FastAPI Template
1+
# Full Stack FastAPI Project
22

33
<a href="https://github.com/fastapi/full-stack-fastapi-template/actions?query=workflow%3ATest" target="_blank"><img src="https://github.com/fastapi/full-stack-fastapi-template/workflows/Test/badge.svg" alt="Test"></a>
44
<a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/fastapi/full-stack-fastapi-template" target="_blank"><img src="https://coverage-badge.samuelcolvin.workers.dev/fastapi/full-stack-fastapi-template.svg" alt="Coverage"></a>
@@ -52,166 +52,6 @@
5252

5353
[![API docs](img/docs.png)](https://github.com/fastapi/full-stack-fastapi-template)
5454

55-
## How To Use It
56-
57-
You can **just fork or clone** this repository and use it as is.
58-
59-
✨ It just works. ✨
60-
61-
### How to Use a Private Repository
62-
63-
If you want to have a private repository, GitHub won't allow you to simply fork it as it doesn't allow changing the visibility of forks.
64-
65-
But you can do the following:
66-
67-
- Create a new GitHub repo, for example `my-full-stack`.
68-
- Clone this repository manually, set the name with the name of the project you want to use, for example `my-full-stack`:
69-
70-
```bash
71-
git clone [email protected]:fastapi/full-stack-fastapi-template.git my-full-stack
72-
```
73-
74-
- Enter into the new directory:
75-
76-
```bash
77-
cd my-full-stack
78-
```
79-
80-
- Set the new origin to your new repository, copy it from the GitHub interface, for example:
81-
82-
```bash
83-
git remote set-url origin [email protected]:octocat/my-full-stack.git
84-
```
85-
86-
- Add this repo as another "remote" to allow you to get updates later:
87-
88-
```bash
89-
git remote add upstream [email protected]:fastapi/full-stack-fastapi-template.git
90-
```
91-
92-
- Push the code to your new repository:
93-
94-
```bash
95-
git push -u origin master
96-
```
97-
98-
### Update From the Original Template
99-
100-
After cloning the repository, and after doing changes, you might want to get the latest changes from this original template.
101-
102-
- Make sure you added the original repository as a remote, you can check it with:
103-
104-
```bash
105-
git remote -v
106-
107-
origin [email protected]:octocat/my-full-stack.git (fetch)
108-
origin [email protected]:octocat/my-full-stack.git (push)
109-
upstream [email protected]:fastapi/full-stack-fastapi-template.git (fetch)
110-
upstream [email protected]:fastapi/full-stack-fastapi-template.git (push)
111-
```
112-
113-
- Pull the latest changes without merging:
114-
115-
```bash
116-
git pull --no-commit upstream master
117-
```
118-
119-
This will download the latest changes from this template without committing them, that way you can check everything is right before committing.
120-
121-
- If there are conflicts, solve them in your editor.
122-
123-
- Once you are done, commit the changes:
124-
125-
```bash
126-
git merge --continue
127-
```
128-
129-
### Configure
130-
131-
You can then update configs in the `.env` files to customize your configurations.
132-
133-
Before deploying it, make sure you change at least the values for:
134-
135-
- `SECRET_KEY`
136-
- `FIRST_SUPERUSER_PASSWORD`
137-
- `POSTGRES_PASSWORD`
138-
139-
You can (and should) pass these as environment variables from secrets.
140-
141-
Read the [deployment.md](./deployment.md) docs for more details.
142-
143-
### Generate Secret Keys
144-
145-
Some environment variables in the `.env` file have a default value of `changethis`.
146-
147-
You have to change them with a secret key, to generate secret keys you can run the following command:
148-
149-
```bash
150-
python -c "import secrets; print(secrets.token_urlsafe(32))"
151-
```
152-
153-
Copy the content and use that as password / secret key. And run that again to generate another secure key.
154-
155-
## How To Use It - Alternative With Copier
156-
157-
This repository also supports generating a new project using [Copier](https://copier.readthedocs.io).
158-
159-
It will copy all the files, ask you configuration questions, and update the `.env` files with your answers.
160-
161-
### Install Copier
162-
163-
You can install Copier with:
164-
165-
```bash
166-
pip install copier
167-
```
168-
169-
Or better, if you have [`pipx`](https://pipx.pypa.io/), you can run it with:
170-
171-
```bash
172-
pipx install copier
173-
```
174-
175-
**Note**: If you have `pipx`, installing copier is optional, you could run it directly.
176-
177-
### Generate a Project With Copier
178-
179-
Decide a name for your new project's directory, you will use it below. For example, `my-awesome-project`.
180-
181-
Go to the directory that will be the parent of your project, and run the command with your project's name:
182-
183-
```bash
184-
copier copy https://github.com/fastapi/full-stack-fastapi-template my-awesome-project --trust
185-
```
186-
187-
If you have `pipx` and you didn't install `copier`, you can run it directly:
188-
189-
```bash
190-
pipx run copier copy https://github.com/fastapi/full-stack-fastapi-template my-awesome-project --trust
191-
```
192-
193-
**Note** the `--trust` option is necessary to be able to execute a [post-creation script](https://github.com/fastapi/full-stack-fastapi-template/blob/master/.copier/update_dotenv.py) that updates your `.env` files.
194-
195-
### Input Variables
196-
197-
Copier will ask you for some data, you might want to have at hand before generating the project.
198-
199-
But don't worry, you can just update any of that in the `.env` files afterwards.
200-
201-
The input variables, with their default values (some auto generated) are:
202-
203-
- `project_name`: (default: `"FastAPI Project"`) The name of the project, shown to API users (in .env).
204-
- `stack_name`: (default: `"fastapi-project"`) The name of the stack used for Docker Compose labels and project name (no spaces, no periods) (in .env).
205-
- `secret_key`: (default: `"changethis"`) The secret key for the project, used for security, stored in .env, you can generate one with the method above.
206-
- `first_superuser`: (default: `"[email protected]"`) The email of the first superuser (in .env).
207-
- `first_superuser_password`: (default: `"changethis"`) The password of the first superuser (in .env).
208-
- `smtp_host`: (default: "") The SMTP server host to send emails, you can set it later in .env.
209-
- `smtp_user`: (default: "") The SMTP server user to send emails, you can set it later in .env.
210-
- `smtp_password`: (default: "") The SMTP server password to send emails, you can set it later in .env.
211-
- `emails_from_email`: (default: `"[email protected]"`) The email account to send emails from, you can set it later in .env.
212-
- `postgres_password`: (default: `"changethis"`) The password for the PostgreSQL database, stored in .env, you can generate one with the method above.
213-
- `sentry_dsn`: (default: "") The DSN for Sentry, if you are using it, you can set it later in .env.
214-
21555
## Getting Started / Local Development Setup
21656

21757
Docker Compose is the recommended way to run the project locally.
@@ -255,7 +95,3 @@ Here's a list of scripts available in the project to help with common developmen
25595
## Release Notes
25696

25797
Check the file [release-notes.md](./release-notes.md).
258-
259-
## License
260-
261-
The Full Stack FastAPI Template is licensed under the terms of the MIT license.

backend/README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Start the local development environment with Docker Compose following the guide
1111

1212
## General Workflow
1313

14-
By default, the dependencies are managed with [uv](https://docs.astral.sh/uv/), go there and install it.
14+
Dependencies are managed with [uv](https://docs.astral.sh/uv/). If you haven't already, please install it.
1515

1616
From `./backend/` you can install all the dependencies with:
1717

@@ -31,25 +31,25 @@ Modify or add SQLModel models for data and SQL tables in `./backend/app/models.p
3131

3232
## VS Code
3333

34-
There are already configurations in place to run the backend through the VS Code debugger, so that you can use breakpoints, pause and explore variables, etc.
34+
VS Code configurations are provided to run the backend with the debugger, allowing use of breakpoints, variable exploration, etc.
3535

36-
The setup is also already configured so you can run the tests through the VS Code Python tests tab.
36+
The setup also allows running tests via the VS Code Python tests tab.
3737

3838
## Docker Compose Override
3939

40-
During development, you can change Docker Compose settings that will only affect the local development environment in the file `docker-compose.override.yml`.
40+
Docker Compose settings specific to local development can be configured in `docker-compose.override.yml`.
4141

42-
The changes to that file only affect the local development environment, not the production environment. So, you can add "temporary" changes that help the development workflow.
42+
These overrides only affect the local development environment, not production, allowing for temporary changes that aid development.
4343

44-
For example, the directory with the backend code is synchronized in the Docker container, copying 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.
44+
For instance, the backend code directory is synchronized with the Docker container, reflecting live code changes inside the container. This allows for immediate testing of changes without rebuilding the Docker image. This live synchronization is intended for development; for production, Docker images should be built with the finalized code. This approach significantly speeds up the development iteration cycle.
4545

46-
There is also a command override that runs `fastapi run --reload` instead of the default `fastapi run`. It starts a single server process (instead of multiple, as would be for production) and reloads the process whenever the code changes. 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:
46+
There is also a command override that runs `fastapi dev` instead of the default command. It starts a single server process (unlike multiple processes typical for production) and reloads the process whenever code changes are detected. Note that a syntax error in a saved Python file will cause the server to break and exit, stopping the container. After fixing the error, the container can be restarted by running:
4747

4848
```console
4949
$ docker compose watch
5050
```
5151

52-
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.
52+
A commented-out `command` override is available in `docker-compose.override.yml`. If uncommented (and the default one commented out), it makes the backend container run a minimal process that keeps it alive without starting the main application. This allows you to `exec` into the running container and execute commands manually, such as starting a Python interpreter, testing installed dependencies, or running the development server with live reload.
5353

5454
To get inside the container with a `bash` session you can start the stack with:
5555

@@ -123,7 +123,7 @@ When the tests are run, a file `htmlcov/index.html` is generated, you can open i
123123

124124
## Migrations
125125

126-
As during local development your app directory is mounted as a volume inside the container, you can also run the migrations with `alembic` commands inside the container and the migration code will be in your app directory (instead of being only inside the container). So you can add it to your git repository.
126+
During local development, the application directory is mounted as a volume within the container. This allows you to run Alembic migration commands inside the container, with the generated migration code appearing directly in your application directory, ready to be committed to Git.
127127

128128
Make sure you create a "revision" of your models and that you "upgrade" your database with that revision every time you change them. As this is what will update the tables in your database. Otherwise, your application will have errors.
129129

@@ -133,7 +133,7 @@ Make sure you create a "revision" of your models and that you "upgrade" your dat
133133
$ docker compose exec backend bash
134134
```
135135

136-
* Alembic is already configured to import your SQLModel models from `./backend/app/models.py`.
136+
* Alembic is configured to import SQLModel models from `./backend/app/models.py`.
137137

138138
* After changing a model (for example, adding a column), inside the container, create a revision, e.g.:
139139

@@ -149,7 +149,7 @@ $ alembic revision --autogenerate -m "Add column last_name to User model"
149149
$ alembic upgrade head
150150
```
151151

152-
If you don't want to use migrations at all, uncomment the lines in the file at `./backend/app/core/db.py` that end in:
152+
If migrations are not desired for this project, uncomment the lines in `./backend/app/core/db.py` that end with:
153153

154154
```python
155155
SQLModel.metadata.create_all(engine)
@@ -161,7 +161,7 @@ and comment the line in the file `scripts/prestart.sh` that contains:
161161
$ alembic upgrade head
162162
```
163163

164-
If you don't want to start with the default models and want to remove them / modify them, from the beginning, without having any previous revision, you can remove the revision files (`.py` Python files) under `./backend/app/alembic/versions/`. And then create a first migration as described above.
164+
If you need to reset or start fresh with migrations (e.g., squash existing migrations or initialize a new migration history), you can remove the existing revision files (the `.py` Python files) under `./backend/app/alembic/versions/`. After doing so, you can create a new initial migration as described above.
165165

166166
## Email Templates
167167

development.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ fastapi dev app/main.py
7474

7575
When you start the Docker Compose stack, it uses `localhost` by default, with different ports for each service (backend, frontend, adminer, etc).
7676

77-
When you deploy it to production (or staging), it will deploy each service in a different subdomain, like `api.example.com` for the backend and `dashboard.example.com` for the frontend.
77+
In production or staging environments, services are typically deployed to different subdomains, such as `api.example.com` for the backend and `dashboard.example.com` for the frontend.
7878

79-
In the guide about [deployment](deployment.md) you can read about Traefik, the configured proxy. That's the component in charge of transmitting traffic to each service based on the subdomain.
79+
The [deployment guide](deployment.md) details how Traefik is used as a reverse proxy to route traffic to services based on subdomains.
8080

81-
If you want to test that it's all working locally, you can edit the local `.env` file, and change:
81+
To test domain-based routing locally, you can edit the `.env` file and set:
8282

8383
```dotenv
8484
DOMAIN=localhost.tiangolo.com
@@ -88,15 +88,15 @@ That will be used by the Docker Compose files to configure the base domain for t
8888

8989
Traefik will use this to transmit traffic at `api.localhost.tiangolo.com` to the backend, and traffic at `dashboard.localhost.tiangolo.com` to the frontend.
9090

91-
The domain `localhost.tiangolo.com` is a special domain that is configured (with all its subdomains) to point to `127.0.0.1`. This way you can use that for your local development.
91+
The domain `localhost.tiangolo.com` (and its subdomains) is configured to point to `127.0.0.1`, allowing for local development and testing of domain-based routing.
9292

9393
After you update it, run again:
9494

9595
```bash
9696
docker compose watch
9797
```
9898

99-
When deploying, for example in production, the main Traefik is configured outside of the Docker Compose files. For local development, there's an included Traefik in `docker-compose.override.yml`, just to let you test that the domains work as expected, for example with `api.localhost.tiangolo.com` and `dashboard.localhost.tiangolo.com`.
99+
While in production the main Traefik instance is typically configured outside the application's Docker Compose setup, for local development, Traefik is included and configured in `docker-compose.override.yml`. This allows testing of domain routing (e.g., `api.localhost.tiangolo.com` and `dashboard.localhost.tiangolo.com`) locally.
100100

101101
## Docker Compose files and env vars
102102

@@ -116,23 +116,21 @@ docker compose watch
116116

117117
## The .env file
118118

119-
The `.env` file is the one that contains all your configurations, generated keys and passwords, etc.
119+
The `.env` file contains all project configurations, including generated keys and passwords.
120120

121-
Depending on your workflow, you could want to exclude it from Git, for example if your project is public. In that case, you would have to make sure to set up a way for your CI tools to obtain it while building or deploying your project.
122-
123-
One way to do it could be to add each environment variable to your CI/CD system, and updating the `docker-compose.yml` file to read that specific env var instead of reading the `.env` file.
121+
It is recommended to exclude the `.env` file from Git, especially for public projects. If excluded, ensure your CI/CD pipeline has a secure way to obtain these configurations during build or deployment (e.g., by setting environment variables directly in the CI/CD system and updating `docker-compose.yml` to read them).
124122

125123
## Pre-commits and code linting
126124

127-
we are using a tool called [pre-commit](https://pre-commit.com/) for code linting and formatting.
125+
This project uses [pre-commit](https://pre-commit.com/) for code linting and formatting.
128126

129-
When you install it, it runs right before making a commit in git. This way it ensures that the code is consistent and formatted even before it is committed.
127+
Installed pre-commit hooks run before each commit, ensuring code consistency and formatting.
130128

131129
You can find a file `.pre-commit-config.yaml` with configurations at the root of the project.
132130

133131
#### Install pre-commit to run automatically
134132

135-
`pre-commit` is already part of the dependencies of the project, but you could also install it globally if you prefer to, following [the official pre-commit docs](https://pre-commit.com/).
133+
`pre-commit` is included in the project's dependencies. Alternatively, it can be installed globally by following [the official pre-commit docs](https://pre-commit.com/).
136134

137135
After having the `pre-commit` tool installed and available, you need to "install" it in the local repository, so that it runs automatically before each commit.
138136

0 commit comments

Comments
 (0)