Skip to content

Commit 3a3c36e

Browse files
committed
restrucutre files
1 parent 3c3d0d1 commit 3a3c36e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+41
-27
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
}
5555
},
5656
// Use 'postCreateCommand' to run commands after the container is created.
57-
"postCreateCommand": "pip install -r requirements-dev.txt && pip install -e src",
57+
"postCreateCommand": "pip install -r requirements-dev.txt && pip install -e src/backend && pip install -e src",
5858
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
5959
"remoteUser": "vscode"
6060
}

.github/workflows/app-tests.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,13 @@ jobs:
5555
python -m pip install -r requirements-dev.txt
5656
- name: Install app as editable app
5757
run: |
58+
python -m pip install -e src/backend
5859
python -m pip install -e src
5960
- name: Setup local database with seed data
6061
run: |
6162
cp .env.sample .env
62-
python ./src/fastapi_app/setup_postgres_database.py
63-
python ./src/fastapi_app/setup_postgres_seeddata.py
63+
python ./src/backend/fastapi_app/setup_postgres_database.py
64+
python ./src/backend/fastapi_app/setup_postgres_seeddata.py
6465
- name: Setup node
6566
uses: actions/setup-node@v4
6667
with:

README.md

Lines changed: 4 additions & 3 deletions

azure.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ metadata:
44
template: rag-postgres-openai-python@0.0.1
55
services:
66
web:
7-
project: ./src
7+
project: ./src/backend
88
language: py
99
module: web
1010
host: containerapp

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
-r src/requirements.txt
1+
-r src/backend/requirements.txt
22
ruff
33
pre-commit
44
pip-tools

scripts/load_python_env.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ echo 'Creating Python virtual environment in .venv...'
44
python3 -m venv .venv
55

66
echo 'Installing dependencies from "requirements.txt" into virtual environment (in quiet mode)...'
7+
.venv/bin/python -m pip --quiet --disable-pip-version-check install -e src/backend
78
.venv/bin/python -m pip --quiet --disable-pip-version-check install -e src
89
.venv/bin/python -m pip --quiet --disable-pip-version-check install -r requirements-dev.txt

scripts/setup_postgres_azurerole.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ if ([string]::IsNullOrEmpty($POSTGRES_HOST) -or [string]::IsNullOrEmpty($POSTGRE
77
exit 1
88
}
99

10-
python ./src/fastapi_app/setup_postgres_azurerole.py --host $POSTGRES_HOST --username $POSTGRES_USERNAME --app-identity-name $APP_IDENTITY_NAME
10+
python ./src/backend/fastapi_app/setup_postgres_azurerole.py --host $POSTGRES_HOST --username $POSTGRES_USERNAME --app-identity-name $APP_IDENTITY_NAME

scripts/setup_postgres_azurerole.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ fi
99

1010
. ./scripts/load_python_env.sh
1111

12-
.venv/bin/python ./src/fastapi_app/setup_postgres_azurerole.py --host $POSTGRES_HOST --username $POSTGRES_USERNAME --app-identity-name $APP_IDENTITY_NAME
12+
.venv/bin/python ./src/backend/fastapi_app/setup_postgres_azurerole.py --host $POSTGRES_HOST --username $POSTGRES_USERNAME --app-identity-name $APP_IDENTITY_NAME

scripts/setup_postgres_database.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ if ([string]::IsNullOrEmpty($POSTGRES_HOST) -or [string]::IsNullOrEmpty($POSTGRE
77
exit 1
88
}
99

10-
python ./src/fastapi_app/setup_postgres_database.py --host $POSTGRES_HOST --username $POSTGRES_USERNAME --password $POSTGRES_PASSWORD
10+
python ./backend/src/fastapi_app/setup_postgres_database.py --host $POSTGRES_HOST --username $POSTGRES_USERNAME --password $POSTGRES_PASSWORD

scripts/setup_postgres_database.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ POSTGRES_DATABASE=$(azd env get-values | grep POSTGRES_DATABASE | sed 's/="/=/'
44

55
. ./scripts/load_python_env.sh
66

7-
.venv/bin/python ./src/fastapi_app/setup_postgres_database.py --host $POSTGRES_HOST --username $POSTGRES_USERNAME --database $POSTGRES_DATABASE
7+
.venv/bin/python ./src/backend/fastapi_app/setup_postgres_database.py --host $POSTGRES_HOST --username $POSTGRES_USERNAME --database $POSTGRES_DATABASE

scripts/setup_postgres_seeddata.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ if ([string]::IsNullOrEmpty($POSTGRES_HOST) -or [string]::IsNullOrEmpty($POSTGRE
77
exit 1
88
}
99

10-
python ./src/fastapi_app/setup_postgres_seeddata.py --host $POSTGRES_HOST --username $POSTGRES_USERNAME --password $POSTGRES_PASSWORD
10+
python ./src/backend/fastapi_app/setup_postgres_seeddata.py --host $POSTGRES_HOST --username $POSTGRES_USERNAME --password $POSTGRES_PASSWORD

scripts/setup_postgres_seeddata.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ POSTGRES_DATABASE=$(azd env get-values | grep POSTGRES_DATABASE | sed 's/="/=/'
44

55
. ./scripts/load_python_env.sh
66

7-
.venv/bin/python ./src/fastapi_app/setup_postgres_seeddata.py --host $POSTGRES_HOST --username $POSTGRES_USERNAME --database $POSTGRES_DATABASE
7+
.venv/bin/python ./src/backend/fastapi_app/setup_postgres_seeddata.py --host $POSTGRES_HOST --username $POSTGRES_USERNAME --database $POSTGRES_DATABASE
File renamed without changes.
File renamed without changes.

src/backend/__init__.py

Whitespace-only changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/backend/pyproject.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[project]
2+
name = "fastapi_app"
3+
version = "1.0.0"
4+
description = "Create a application with fastapi and postgres-flexible"
5+
dependencies = [
6+
"fastapi>=0.111.0,<1.0.0",
7+
"python-dotenv>=1.0.1,<2.0.0",
8+
"environs>=11.0.0,<12.0.0",
9+
"azure-identity>=1.16.1,<2.0.0",
10+
"aiohttp>=3.9.5,<4.0.0",
11+
"asyncpg>=0.29.0,<1.0.0",
12+
"SQLAlchemy[asyncio]>=2.0.30,<3.0.0",
13+
"pgvector>=0.2.5,<0.3.0",
14+
"openai>=1.34.0,<2.0.0",
15+
"tiktoken>=0.7.0,<0.8.0",
16+
"openai-messages-token-helper>=0.1.5,<0.2.0",
17+
]
18+
19+
[build-system]
20+
requires = ["flit_core<4"]
21+
build-backend = "flit_core.buildapi"
File renamed without changes.

src/frontend/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import react from "@vitejs/plugin-react";
55
export default defineConfig({
66
plugins: [react()],
77
build: {
8-
outDir: "../static",
8+
outDir: "../backend/static",
99
emptyOutDir: true,
1010
sourcemap: true,
1111
rollupOptions: {

src/pyproject.toml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
11
[project]
2-
name = "fastapi_app"
2+
name = "backend"
33
version = "1.0.0"
44
description = "Create a application with fastapi and postgres-flexible"
55
dependencies = [
6-
"fastapi>=0.111.0,<1.0.0",
7-
"python-dotenv>=1.0.1,<2.0.0",
8-
"environs>=11.0.0,<12.0.0",
9-
"azure-identity>=1.16.1,<2.0.0",
10-
"aiohttp>=3.9.5,<4.0.0",
11-
"asyncpg>=0.29.0,<1.0.0",
12-
"SQLAlchemy[asyncio]>=2.0.30,<3.0.0",
13-
"pgvector>=0.2.5,<0.3.0",
14-
"openai>=1.34.0,<2.0.0",
15-
"tiktoken>=0.7.0,<0.8.0",
16-
"openai-messages-token-helper>=0.1.5,<0.2.0",
6+
"fastapi_app"
177
]
188

199
[build-system]

0 commit comments

Comments
 (0)