Browse Source

chore: make directory structure more standard for web projects

Zubarev Grigoriy 7 months ago
parent
commit
4511a5b775

+ 1 - 1
Dockerfile

@@ -1,5 +1,5 @@
 FROM python:3.12.4-alpine
 RUN --mount=source=dist,target=/dist PYTHONDONTWRITEBYTECODE=1 \
     pip install --no-cache-dir --disable-pip-version-check /dist/*.whl
-CMD [ "uvicorn", "rural_dict.__main__:app", "--no-access-log", "--proxy-headers", \
+CMD [ "uvicorn", "app.__main__:app", "--no-access-log", "--proxy-headers", \
     "--forwarded-allow-ips", "*", "--host", "0.0.0.0", "--port", "5758" ]

+ 3 - 2
README.md

@@ -48,7 +48,7 @@ docker compose up -d
 
 ```sh
 rye sync --no-dev
-rye run uvicorn src.rural_dict.__main__:app --no-access-log --proxy-headers \
+rye run uvicorn app.__main__:app --no-access-log --proxy-headers \
     --forwarded-allow-ips '*' --host 0.0.0.0 --port 5758
 ```
 
@@ -101,7 +101,8 @@ to:
 
 ## 👥 Contributors
 
-- [thirtysix](https://thirtysix.pw), rewrote project in a more modern libraries stack
+- [thirtysix](https://thirtysix.pw), rewrote project in a more modern libraries stack and
+  implemented missing Urban Dictionary features
 - [zortazert](https://codeberg.org/zortazert), created the initial Urban Dictionary frontend using
   JavaScript and helped develop Rural Dictionary
 

+ 0 - 0
src/rural_dict/__init__.py → app/__init__.py


+ 0 - 0
src/rural_dict/__main__.py → app/__main__.py


+ 0 - 0
src/rural_dict/static/css/main.css → app/static/css/main.css


+ 0 - 0
src/rural_dict/static/img/favicon.png → app/static/img/favicon.png


+ 0 - 0
src/rural_dict/static/img/favicon.xcf → app/static/img/favicon.xcf


+ 0 - 0
src/rural_dict/static/img/logo.png → app/static/img/logo.png


+ 0 - 0
src/rural_dict/static/img/logo.xcf → app/static/img/logo.xcf


+ 0 - 0
src/rural_dict/templates/404.html → app/templates/404.html


+ 0 - 0
src/rural_dict/templates/base.html → app/templates/base.html


+ 0 - 0
src/rural_dict/templates/index.html → app/templates/index.html


+ 4 - 4
pyproject.toml

@@ -35,19 +35,19 @@ dev-dependencies = [
 ]
 
 [tool.rye.scripts]
-dev = """uvicorn src.rural_dict.__main__:app --reload --reload-dir src/rural_dict
+dev = """uvicorn app.__main__:app --reload
 --reload-include '**/*.py' --reload-include '**/*.html' --reload-include '**/*.css' --port 5758"""
-start = """uvicorn src.rural_dict.__main__:app --no-access-log --proxy-headers
+start = """uvicorn app.__main__:app --no-access-log --proxy-headers
 --forwarded-allow-ips '*' --host 0.0.0.0 --port 5758"""
 
 [tool.hatch.version]
-path = "src/rural_dict/__init__.py"
+path = "app/__init__.py"
 
 [tool.hatch.metadata]
 allow-direct-references = true
 
 [tool.hatch.build.targets.wheel]
-packages = ["src/rural_dict"]
+packages = ["app"]
 
 [tool.hatch.build.targets.sdist]
 exclude = ["*.xcf"]