Skip to content

Commit 12c484e

Browse files
committed
Update basic template
1 parent 047cb10 commit 12c484e

28 files changed

+75
-21
lines changed

create_fastapi_project/templates/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,11 @@ def install_template(root: str, template: ITemplate, app_name: str):
3939

4040
poetry_path = ""
4141
if template == ITemplate.full or template == ITemplate.langchain_basic:
42-
# TODO: CHECK PATHS IN MACOS AND WINDOWS | (os.path.join)
43-
poetry_path = os.path.join(root, "backend", "app")
42+
# TODO: CHECK PATHS IN MACOS AND WINDOWS | (os.path.join)
4443
poetry_frontend_path = os.path.join(root, "frontend", "app")
4544

4645
else:
47-
poetry_path = os.path.join(root, "app")
46+
poetry_path = os.path.join(root, "backend", "app")
4847

4948
has_pyproject = add_configuration_to_pyproject(poetry_path)
5049

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
11
PROJECT_NAME=app
2-
BACKEND_CORS_ORIGINS=["*"]
2+
BACKEND_CORS_ORIGINS=["*"]
3+
4+
#############################################
5+
# Caddy variables
6+
#############################################
7+
EXT_ENDPOINT1=127.0.0.1
8+
LOCAL_1=localhost
9+
LOCAL_2=127.0.0.1

create_fastapi_project/templates/basic/Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ help:
3030
@echo " Lint code with ruff and try to fix."
3131

3232
install:
33-
cd app && poetry install && cd ..
33+
cd backend/app && poetry install && cd ..
3434

3535
run-app:
36-
cd app && poetry run uvicorn app.main:app --host 0.0.0.0 --port 8000 && cd ..
36+
cd backend/app && poetry run uvicorn app.main:app --host 0.0.0.0 --port 8000 && cd ..
3737

3838

3939
run-dev-build:
@@ -52,21 +52,21 @@ stop-prod:
5252
docker compose down
5353

5454
formatter:
55-
cd app && \
55+
cd backend/app && \
5656
poetry run black app
5757

5858
mypy:
59-
cd app && \
59+
cd backend/app && \
6060
poetry run mypy .
6161

6262
lint:
63-
cd app && \
63+
cd backend/app && \
6464
poetry run ruff app && poetry run black --check app
6565

6666
lint-watch:
67-
cd app && \
67+
cd backend/app && \
6868
poetry run ruff app --watch
6969

7070
lint-fix:
71-
cd app && \
71+
cd backend/app && \
7272
poetry run ruff app --fix

create_fastapi_project/templates/basic/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ make run-dev
2121
make run-prod
2222
```
2323

24+
Open [http://fastapi.localhost/docs](http://fastapi.localhost/docs) with your browser to see the result.
25+
26+
2427
- Run the server without docker:
2528

2629
First, make sure you have all packages installed:

0 commit comments

Comments
 (0)