-
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
split tunnel and admin, rewrite admin in py
- Loading branch information
Showing
280 changed files
with
5,024 additions
and
4,599 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,5 @@ portr | |
!**/portr/ | ||
postgres-data | ||
node_modules | ||
.mypy_cache | ||
data/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
repos: | ||
- repo: https://github.com/charliermarsh/ruff-pre-commit | ||
rev: "v0.2.2" | ||
hooks: | ||
- id: ruff | ||
args: [--fix, --exit-non-zero-on-fix] | ||
exclude: "(^.*/migrations/|^client/)" | ||
- id: ruff-format | ||
exclude: "(^.*/migrations/|^client/)" | ||
|
||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
exclude: "(^.*/migrations/|^client/)" | ||
- id: check-merge-conflict | ||
- id: debug-statements | ||
- id: check-added-large-files | ||
|
||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.8.0 | ||
hooks: | ||
- id: mypy | ||
args: | ||
- --follow-imports=skip | ||
- --ignore-missing-imports | ||
- --show-column-numbers | ||
- --no-pretty | ||
- --check-untyped-defs | ||
exclude: '(^.*/migrations/|^client/|_tests\.py$)' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.mypy_cache | ||
.pytest_cache | ||
.venv | ||
tmp | ||
.env | ||
**/__pycache__ | ||
**/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.venv | ||
.mypy_cache | ||
.pytest_cache | ||
__pycache__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.12.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
FROM node:20-slim as frontend-builder | ||
|
||
WORKDIR /app | ||
|
||
COPY src/web/package.json src/web/pnpm-lock.yaml ./ | ||
|
||
RUN npm i -g pnpm && pnpm install --frozen-lockfile | ||
|
||
COPY src/web . | ||
|
||
RUN pnpm build | ||
|
||
FROM python:3.12 as builder | ||
|
||
ENV PATH="/app/.venv/bin:$PATH" | ||
|
||
WORKDIR /app | ||
|
||
COPY requirements.lock . | ||
|
||
RUN python3 -m venv .venv | ||
|
||
RUN sed '/-e/d' requirements.lock > requirements.txt && pip install --no-cache-dir -r requirements.txt | ||
|
||
FROM python:3.12-slim as final | ||
|
||
ENV PATH="/app/.venv/bin:$PATH" \ | ||
PYTHONPATH="/app/src:$PYTHONPATH" | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=builder /app/.venv/ /app/.venv/ | ||
COPY --from=frontend-builder /app/dist /app/src/web/dist | ||
COPY . . | ||
|
||
ENTRYPOINT ["sh", "scripts/start.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# portr-admin | ||
|
||
Describe your project here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
[project] | ||
name = "portr-admin" | ||
version = "0.1.0" | ||
description = "Add your description here" | ||
authors = [{ name = "amalshaji", email = "[email protected]" }] | ||
dependencies = [ | ||
"nanoid>=2.0.0", | ||
"fastapi>=0.109.2", | ||
"uvicorn>=0.27.1", | ||
"tortoise-orm[asyncpg]>=0.20.0", | ||
"pydantic-settings>=2.2.0", | ||
"httpx>=0.26.0", | ||
"jinja2>=3.1.3", | ||
"python-slugify[unidecode]>=8.0.4", | ||
"python-ulid>=2.2.0", | ||
"apscheduler>=3.10.4", | ||
"pydantic>=2.6.1", | ||
"email-validator>=2.1.0.post1", | ||
] | ||
readme = "README.md" | ||
requires-python = ">= 3.8" | ||
|
||
[project.scripts] | ||
hello = "portr_admin:hello" | ||
|
||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[tool.rye] | ||
managed = true | ||
dev-dependencies = [ | ||
"pre-commit>=3.5.0", | ||
"pytest>=8.0.1", | ||
"factory-boy>=3.3.0", | ||
"pytest-asyncio>=0.23.5", | ||
"asgi-lifespan>=2.1.0", | ||
"async-factory-boy>=1.0.1", | ||
"mimesis>=14.0.0", | ||
] | ||
|
||
[tool.hatch.metadata] | ||
allow-direct-references = true | ||
|
||
[tool.hatch.build.targets.wheel] | ||
packages = ["src/portr_admin"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
# generated by rye | ||
# use `rye lock` or `rye sync` to update this lockfile | ||
# | ||
# last locked with the following flags: | ||
# pre: false | ||
# features: [] | ||
# all-features: false | ||
# with-sources: false | ||
|
||
-e file:. | ||
aiosqlite==0.17.0 | ||
# via tortoise-orm | ||
annotated-types==0.6.0 | ||
# via pydantic | ||
anyio==4.3.0 | ||
# via httpx | ||
# via starlette | ||
apscheduler==3.10.4 | ||
# via portr-admin | ||
asgi-lifespan==2.1.0 | ||
async-factory-boy==1.0.1 | ||
asyncpg==0.29.0 | ||
# via tortoise-orm | ||
certifi==2024.2.2 | ||
# via httpcore | ||
# via httpx | ||
cfgv==3.4.0 | ||
# via pre-commit | ||
click==8.1.7 | ||
# via uvicorn | ||
distlib==0.3.8 | ||
# via virtualenv | ||
dnspython==2.6.1 | ||
# via email-validator | ||
email-validator==2.1.0.post1 | ||
# via portr-admin | ||
factory-boy==3.3.0 | ||
# via async-factory-boy | ||
faker==23.2.1 | ||
# via factory-boy | ||
fastapi==0.109.2 | ||
# via portr-admin | ||
filelock==3.13.1 | ||
# via virtualenv | ||
h11==0.14.0 | ||
# via httpcore | ||
# via uvicorn | ||
httpcore==1.0.3 | ||
# via httpx | ||
httpx==0.26.0 | ||
# via portr-admin | ||
identify==2.5.35 | ||
# via pre-commit | ||
idna==3.6 | ||
# via anyio | ||
# via email-validator | ||
# via httpx | ||
iniconfig==2.0.0 | ||
# via pytest | ||
iso8601==1.1.0 | ||
# via tortoise-orm | ||
jinja2==3.1.3 | ||
# via portr-admin | ||
markupsafe==2.1.5 | ||
# via jinja2 | ||
mimesis==14.0.0 | ||
nanoid==2.0.0 | ||
# via portr-admin | ||
nodeenv==1.8.0 | ||
# via pre-commit | ||
packaging==23.2 | ||
# via pytest | ||
platformdirs==4.2.0 | ||
# via virtualenv | ||
pluggy==1.4.0 | ||
# via pytest | ||
pre-commit==3.6.2 | ||
pydantic==2.6.1 | ||
# via fastapi | ||
# via portr-admin | ||
# via pydantic-settings | ||
pydantic-core==2.16.2 | ||
# via pydantic | ||
pydantic-settings==2.2.1 | ||
# via portr-admin | ||
pypika-tortoise==0.1.6 | ||
# via tortoise-orm | ||
pytest==8.0.1 | ||
# via pytest-asyncio | ||
pytest-asyncio==0.23.5 | ||
python-dateutil==2.8.2 | ||
# via faker | ||
python-dotenv==1.0.1 | ||
# via pydantic-settings | ||
python-slugify==8.0.4 | ||
# via portr-admin | ||
python-ulid==2.2.0 | ||
# via portr-admin | ||
pytz==2024.1 | ||
# via apscheduler | ||
# via tortoise-orm | ||
pyyaml==6.0.1 | ||
# via pre-commit | ||
setuptools==69.1.0 | ||
# via nodeenv | ||
six==1.16.0 | ||
# via apscheduler | ||
# via python-dateutil | ||
sniffio==1.3.0 | ||
# via anyio | ||
# via asgi-lifespan | ||
# via httpx | ||
starlette==0.36.3 | ||
# via fastapi | ||
text-unidecode==1.3 | ||
# via python-slugify | ||
tortoise-orm==0.20.0 | ||
# via portr-admin | ||
typing-extensions==4.9.0 | ||
# via aiosqlite | ||
# via fastapi | ||
# via pydantic | ||
# via pydantic-core | ||
tzlocal==5.2 | ||
# via apscheduler | ||
unidecode==1.3.8 | ||
# via python-slugify | ||
uvicorn==0.27.1 | ||
# via portr-admin | ||
virtualenv==20.25.0 | ||
# via pre-commit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# generated by rye | ||
# use `rye lock` or `rye sync` to update this lockfile | ||
# | ||
# last locked with the following flags: | ||
# pre: false | ||
# features: [] | ||
# all-features: false | ||
# with-sources: false | ||
|
||
-e file:. | ||
aiosqlite==0.17.0 | ||
# via tortoise-orm | ||
annotated-types==0.6.0 | ||
# via pydantic | ||
anyio==4.3.0 | ||
# via httpx | ||
# via starlette | ||
apscheduler==3.10.4 | ||
# via portr-admin | ||
asyncpg==0.29.0 | ||
# via tortoise-orm | ||
certifi==2024.2.2 | ||
# via httpcore | ||
# via httpx | ||
click==8.1.7 | ||
# via uvicorn | ||
dnspython==2.6.1 | ||
# via email-validator | ||
email-validator==2.1.0.post1 | ||
# via portr-admin | ||
fastapi==0.109.2 | ||
# via portr-admin | ||
h11==0.14.0 | ||
# via httpcore | ||
# via uvicorn | ||
httpcore==1.0.3 | ||
# via httpx | ||
httpx==0.26.0 | ||
# via portr-admin | ||
idna==3.6 | ||
# via anyio | ||
# via email-validator | ||
# via httpx | ||
iso8601==1.1.0 | ||
# via tortoise-orm | ||
jinja2==3.1.3 | ||
# via portr-admin | ||
markupsafe==2.1.5 | ||
# via jinja2 | ||
nanoid==2.0.0 | ||
# via portr-admin | ||
pydantic==2.6.1 | ||
# via fastapi | ||
# via portr-admin | ||
# via pydantic-settings | ||
pydantic-core==2.16.2 | ||
# via pydantic | ||
pydantic-settings==2.2.1 | ||
# via portr-admin | ||
pypika-tortoise==0.1.6 | ||
# via tortoise-orm | ||
python-dotenv==1.0.1 | ||
# via pydantic-settings | ||
python-slugify==8.0.4 | ||
# via portr-admin | ||
python-ulid==2.2.0 | ||
# via portr-admin | ||
pytz==2024.1 | ||
# via apscheduler | ||
# via tortoise-orm | ||
six==1.16.0 | ||
# via apscheduler | ||
sniffio==1.3.0 | ||
# via anyio | ||
# via httpx | ||
starlette==0.36.3 | ||
# via fastapi | ||
text-unidecode==1.3 | ||
# via python-slugify | ||
tortoise-orm==0.20.0 | ||
# via portr-admin | ||
typing-extensions==4.9.0 | ||
# via aiosqlite | ||
# via fastapi | ||
# via pydantic | ||
# via pydantic-core | ||
tzlocal==5.2 | ||
# via apscheduler | ||
unidecode==1.3.8 | ||
# via python-slugify | ||
uvicorn==0.27.1 | ||
# via portr-admin |
Oops, something went wrong.