-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
96bcf7e
commit 5e9aee5
Showing
33 changed files
with
1,107 additions
and
90 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
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
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,35 @@ | ||
version: "3.9" | ||
|
||
services: | ||
db: | ||
image: postgres:latest | ||
ports: | ||
- "5432:5432" | ||
hostname: db | ||
environment: | ||
POSTGRES_USER: "byte" | ||
POSTGRES_PASSWORD: "bot" | ||
POSTGRES_DB: "byte" | ||
|
||
volumes: | ||
- db-data:/var/lib/postgresql/data | ||
restart: unless-stopped | ||
|
||
logging: | ||
options: | ||
max-size: 10m | ||
max-file: "3" | ||
|
||
healthcheck: | ||
test: | ||
- CMD | ||
- pg_isready | ||
- -U | ||
- app | ||
interval: 2s | ||
timeout: 3s | ||
retries: 40 | ||
|
||
volumes: | ||
db-data: {} | ||
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,13 @@ | ||
======== | ||
Database | ||
======== | ||
|
||
This is the database layer serving all domains in the application. | ||
|
||
.. toctree:: | ||
:titlesonly: | ||
:caption: Database Domain API Reference | ||
:glob: | ||
:hidden: | ||
|
||
* |
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,16 @@ | ||
====== | ||
models | ||
====== | ||
|
||
Model definition for the domain. | ||
|
||
API Reference | ||
------------- | ||
|
||
.. automodule:: src.server.domain.db.models | ||
:members: | ||
|
||
Mermaid Diagram | ||
--------------- | ||
|
||
.. autoclasstree:: src.server.domain.db.models |
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
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,9 @@ | ||
==== | ||
base | ||
==== | ||
|
||
API Reference | ||
------------- | ||
|
||
.. automodule:: src.server.lib.db.base | ||
:members: |
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,13 @@ | ||
================ | ||
Database Library | ||
================ | ||
|
||
Documentation for the Database library. | ||
|
||
|
||
.. toctree:: | ||
:titlesonly: | ||
|
||
base | ||
utils | ||
orm |
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,9 @@ | ||
=== | ||
orm | ||
=== | ||
|
||
API Reference | ||
------------- | ||
|
||
.. automodule:: src.server.lib.db.orm | ||
:members: |
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,9 @@ | ||
===== | ||
utils | ||
===== | ||
|
||
API Reference | ||
------------- | ||
|
||
.. automodule:: src.server.lib.db.utils | ||
:members: |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 @@ | ||
"""Application Entrypoint.""" | ||
from __future__ import annotations | ||
|
||
__all__ = ("run_cli",) | ||
|
||
|
||
def run_cli() -> None: | ||
"""Application Entrypoint.""" | ||
import os | ||
import sys | ||
from pathlib import Path | ||
|
||
current_path = Path(__file__).parent.parent.resolve() | ||
sys.path.append(str(current_path)) | ||
os.environ.setdefault("LITESTAR_APP", "src.app:app") | ||
try: | ||
from litestar.__main__ import run_cli as run_litestar_cli | ||
|
||
except ImportError as exc: | ||
print( # noqa: T201 | ||
"Could not load required libraries. ", | ||
"Please check your installation and make sure you activated any necessary virtual environment", | ||
) | ||
print(exc) # noqa: T201 | ||
sys.exit(1) | ||
run_litestar_cli() | ||
|
||
|
||
if __name__ == "__main__": | ||
run_cli() |
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
"""Domain for database models.""" | ||
from src.server.domain.db import models | ||
|
||
__all__ = ["models"] |
Oops, something went wrong.