FastAPI-fastkit 1.0.0__py3-none-any.whl → 1.0.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. fastapi_fastkit/__init__.py +10 -1
  2. fastapi_fastkit/backend/main.py +482 -482
  3. fastapi_fastkit/backend/transducer.py +106 -106
  4. fastapi_fastkit/cli.py +664 -631
  5. fastapi_fastkit/core/settings.py +155 -155
  6. fastapi_fastkit/fastapi_project_template/README.md +90 -90
  7. fastapi_fastkit/fastapi_project_template/fastapi-async-crud/.env-tpl +1 -1
  8. fastapi_fastkit/fastapi_project_template/fastapi-async-crud/.gitignore-tpl +30 -30
  9. fastapi_fastkit/fastapi_project_template/fastapi-async-crud/README.md-tpl +107 -107
  10. fastapi_fastkit/fastapi_project_template/fastapi-async-crud/requirements.txt-tpl +36 -36
  11. fastapi_fastkit/fastapi_project_template/fastapi-async-crud/scripts/format.sh-tpl +5 -5
  12. fastapi_fastkit/fastapi_project_template/fastapi-async-crud/scripts/lint.sh-tpl +5 -5
  13. fastapi_fastkit/fastapi_project_template/fastapi-async-crud/scripts/run-server.sh-tpl +8 -8
  14. fastapi_fastkit/fastapi_project_template/fastapi-async-crud/scripts/test.sh-tpl +6 -6
  15. fastapi_fastkit/fastapi_project_template/fastapi-async-crud/setup.cfg-tpl +14 -14
  16. fastapi_fastkit/fastapi_project_template/fastapi-async-crud/setup.py-tpl +25 -25
  17. fastapi_fastkit/fastapi_project_template/fastapi-async-crud/src/api/api.py-tpl +9 -9
  18. fastapi_fastkit/fastapi_project_template/fastapi-async-crud/src/api/routes/items.py-tpl +57 -57
  19. fastapi_fastkit/fastapi_project_template/fastapi-async-crud/src/core/config.py-tpl +64 -64
  20. fastapi_fastkit/fastapi_project_template/fastapi-async-crud/src/crud/items.py-tpl +21 -21
  21. fastapi_fastkit/fastapi_project_template/fastapi-async-crud/src/main.py-tpl +26 -26
  22. fastapi_fastkit/fastapi_project_template/fastapi-async-crud/src/mocks/mock_items.json-tpl +8 -8
  23. fastapi_fastkit/fastapi_project_template/fastapi-async-crud/src/schemas/items.py-tpl +22 -22
  24. fastapi_fastkit/fastapi_project_template/fastapi-async-crud/tests/conftest.py-tpl +42 -42
  25. fastapi_fastkit/fastapi_project_template/fastapi-async-crud/tests/test_items.py-tpl +48 -48
  26. fastapi_fastkit/fastapi_project_template/fastapi-custom-response/.env-tpl +1 -1
  27. fastapi_fastkit/fastapi_project_template/fastapi-custom-response/.gitignore-tpl +191 -191
  28. fastapi_fastkit/fastapi_project_template/fastapi-custom-response/README.md-tpl +156 -156
  29. fastapi_fastkit/fastapi_project_template/fastapi-custom-response/requirements.txt-tpl +36 -36
  30. fastapi_fastkit/fastapi_project_template/fastapi-custom-response/scripts/format.sh-tpl +5 -5
  31. fastapi_fastkit/fastapi_project_template/fastapi-custom-response/scripts/lint.sh-tpl +5 -5
  32. fastapi_fastkit/fastapi_project_template/fastapi-custom-response/scripts/run-server.sh-tpl +8 -8
  33. fastapi_fastkit/fastapi_project_template/fastapi-custom-response/scripts/test.sh-tpl +6 -6
  34. fastapi_fastkit/fastapi_project_template/fastapi-custom-response/setup.cfg-tpl +12 -12
  35. fastapi_fastkit/fastapi_project_template/fastapi-custom-response/setup.py-tpl +27 -27
  36. fastapi_fastkit/fastapi_project_template/fastapi-custom-response/src/.DS_Store +0 -0
  37. fastapi_fastkit/fastapi_project_template/fastapi-custom-response/src/api/api.py-tpl +9 -9
  38. fastapi_fastkit/fastapi_project_template/fastapi-custom-response/src/api/routes/items.py-tpl +172 -172
  39. fastapi_fastkit/fastapi_project_template/fastapi-custom-response/src/core/config.py-tpl +64 -64
  40. fastapi_fastkit/fastapi_project_template/fastapi-custom-response/src/crud/items.py-tpl +21 -21
  41. fastapi_fastkit/fastapi_project_template/fastapi-custom-response/src/helper/exceptions.py-tpl +103 -103
  42. fastapi_fastkit/fastapi_project_template/fastapi-custom-response/src/helper/pagination.py-tpl +72 -72
  43. fastapi_fastkit/fastapi_project_template/fastapi-custom-response/src/main.py-tpl +39 -39
  44. fastapi_fastkit/fastapi_project_template/fastapi-custom-response/src/mocks/mock_items.json-tpl +8 -8
  45. fastapi_fastkit/fastapi_project_template/fastapi-custom-response/src/schemas/base.py-tpl +49 -49
  46. fastapi_fastkit/fastapi_project_template/fastapi-custom-response/src/schemas/items.py-tpl +22 -22
  47. fastapi_fastkit/fastapi_project_template/fastapi-custom-response/src/utils/documents.py-tpl +20 -20
  48. fastapi_fastkit/fastapi_project_template/fastapi-custom-response/tests/conftest.py-tpl +42 -42
  49. fastapi_fastkit/fastapi_project_template/fastapi-custom-response/tests/test_items.py-tpl +61 -61
  50. fastapi_fastkit/fastapi_project_template/fastapi-default/README.md-tpl +101 -101
  51. fastapi_fastkit/fastapi_project_template/fastapi-default/scripts/run-server.sh-tpl +8 -8
  52. fastapi_fastkit/fastapi_project_template/fastapi-default/setup.py-tpl +22 -22
  53. fastapi_fastkit/fastapi_project_template/fastapi-default/src/mocks/mock_items.json-tpl +8 -8
  54. fastapi_fastkit/fastapi_project_template/fastapi-default/tests/conftest.py-tpl +30 -30
  55. fastapi_fastkit/fastapi_project_template/fastapi-default/tests/test_items.py-tpl +44 -44
  56. fastapi_fastkit/fastapi_project_template/fastapi-dockerized/.env-tpl +1 -1
  57. fastapi_fastkit/fastapi_project_template/fastapi-dockerized/.gitignore-tpl +30 -30
  58. fastapi_fastkit/fastapi_project_template/fastapi-dockerized/Dockerfile-tpl +23 -23
  59. fastapi_fastkit/fastapi_project_template/fastapi-dockerized/README.md-tpl +119 -119
  60. fastapi_fastkit/fastapi_project_template/fastapi-dockerized/requirements.txt-tpl +36 -36
  61. fastapi_fastkit/fastapi_project_template/fastapi-dockerized/scripts/format.sh-tpl +5 -5
  62. fastapi_fastkit/fastapi_project_template/fastapi-dockerized/scripts/lint.sh-tpl +5 -5
  63. fastapi_fastkit/fastapi_project_template/fastapi-dockerized/scripts/run-server.sh-tpl +8 -8
  64. fastapi_fastkit/fastapi_project_template/fastapi-dockerized/scripts/test.sh-tpl +6 -6
  65. fastapi_fastkit/fastapi_project_template/fastapi-dockerized/setup.cfg-tpl +13 -13
  66. fastapi_fastkit/fastapi_project_template/fastapi-dockerized/setup.py-tpl +22 -22
  67. fastapi_fastkit/fastapi_project_template/fastapi-dockerized/src/api/api.py-tpl +6 -6
  68. fastapi_fastkit/fastapi_project_template/fastapi-dockerized/src/api/routes/items.py-tpl +54 -54
  69. fastapi_fastkit/fastapi_project_template/fastapi-dockerized/src/core/config.py-tpl +64 -64
  70. fastapi_fastkit/fastapi_project_template/fastapi-dockerized/src/crud/items.py-tpl +15 -15
  71. fastapi_fastkit/fastapi_project_template/fastapi-dockerized/src/main.py-tpl +26 -26
  72. fastapi_fastkit/fastapi_project_template/fastapi-dockerized/src/mocks/mock_items.json-tpl +8 -8
  73. fastapi_fastkit/fastapi_project_template/fastapi-dockerized/src/schemas/items.py-tpl +19 -19
  74. fastapi_fastkit/fastapi_project_template/fastapi-dockerized/tests/conftest.py-tpl +30 -30
  75. fastapi_fastkit/fastapi_project_template/fastapi-dockerized/tests/test_items.py-tpl +44 -44
  76. fastapi_fastkit/fastapi_project_template/fastapi-empty/.env-tpl +1 -1
  77. fastapi_fastkit/fastapi_project_template/fastapi-empty/setup.py-tpl +22 -22
  78. fastapi_fastkit/fastapi_project_template/fastapi-empty/src/core/config.py-tpl +75 -75
  79. fastapi_fastkit/fastapi_project_template/fastapi-empty/src/main.py-tpl +36 -36
  80. fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/.env-tpl +9 -9
  81. fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/.gitignore-tpl +30 -30
  82. fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/Dockerfile-tpl +23 -23
  83. fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/README.md-tpl +144 -144
  84. fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/alembic.ini-tpl +119 -119
  85. fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/docker-compose.yml-tpl +44 -44
  86. fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/requirements.txt-tpl +41 -41
  87. fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/scripts/format.sh-tpl +5 -5
  88. fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/scripts/lint.sh-tpl +5 -5
  89. fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/scripts/pre-start.sh-tpl +16 -16
  90. fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/scripts/run-server.sh-tpl +8 -8
  91. fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/scripts/test.sh-tpl +10 -10
  92. fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/setup.cfg-tpl +13 -13
  93. fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/setup.py-tpl +25 -25
  94. fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/src/alembic/README-tpl +1 -1
  95. fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/src/alembic/env.py-tpl +85 -85
  96. fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/src/alembic/script.py.mako-tpl +26 -26
  97. fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/src/alembic/versions/bedcdc35b64a_first_alembic.py-tpl +37 -37
  98. fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/src/api/api.py-tpl +11 -11
  99. fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/src/api/deps.py-tpl +19 -19
  100. fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/src/api/routes/items.py-tpl +109 -109
  101. fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/src/core/config.py-tpl +88 -88
  102. fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/src/core/db.py-tpl +53 -53
  103. fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/src/crud/items.py-tpl +102 -102
  104. fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/src/main.py-tpl +45 -45
  105. fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/src/schemas/items.py-tpl +54 -54
  106. fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/src/utils/backend_pre_start.py-tpl +39 -39
  107. fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/src/utils/init_data.py-tpl +23 -23
  108. fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/src/utils/tests_pre_start.py-tpl +39 -39
  109. fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/tests/conftest.py-tpl +63 -63
  110. fastapi_fastkit/fastapi_project_template/fastapi-psql-orm/tests/test_items.py-tpl +44 -44
  111. fastapi_fastkit/fastapi_project_template/modules/api/routes/new_route.py-tpl +64 -64
  112. fastapi_fastkit/fastapi_project_template/modules/crud/new_route.py-tpl +29 -29
  113. fastapi_fastkit/fastapi_project_template/modules/schemas/new_route.py-tpl +23 -23
  114. fastapi_fastkit/logs/fastkit_debug_20250702_161423.log +21 -0
  115. fastapi_fastkit/logs/fastkit_debug_20250702_162706.log +20 -0
  116. fastapi_fastkit/logs/fastkit_debug_20250702_163010.log +21 -0
  117. fastapi_fastkit/logs/fastkit_debug_20250702_163526.log +21 -0
  118. fastapi_fastkit/logs/fastkit_debug_20250702_164053.log +21 -0
  119. fastapi_fastkit/logs/fastkit_debug_20250702_165220.log +21 -0
  120. fastapi_fastkit/logs/fastkit_debug_20250702_165647.log +21 -0
  121. fastapi_fastkit/utils/logging.py +112 -1
  122. fastapi_fastkit/utils/main.py +140 -129
  123. fastapi_fastkit-1.0.2.dist-info/METADATA +320 -0
  124. {fastapi_fastkit-1.0.0.dist-info → fastapi_fastkit-1.0.2.dist-info}/RECORD +127 -119
  125. {fastapi_fastkit-1.0.0.dist-info → fastapi_fastkit-1.0.2.dist-info}/WHEEL +1 -1
  126. {fastapi_fastkit-1.0.0.dist-info → fastapi_fastkit-1.0.2.dist-info}/licenses/LICENSE +21 -21
  127. fastapi_fastkit-1.0.0.dist-info/METADATA +0 -208
  128. {fastapi_fastkit-1.0.0.dist-info → fastapi_fastkit-1.0.2.dist-info}/entry_points.txt +0 -0
@@ -1,119 +1,119 @@
1
- # A generic, single database configuration.
2
-
3
- [alembic]
4
- # path to migration scripts
5
- # Use forward slashes (/) also on windows to provide an os agnostic path
6
- script_location = src/alembic
7
-
8
- # template used to generate migration file names; The default value is %%(rev)s_%%(slug)s
9
- # Uncomment the line below if you want the files to be prepended with date and time
10
- # see https://alembic.sqlalchemy.org/en/latest/tutorial.html#editing-the-ini-file
11
- # for all available tokens
12
- # file_template = %%(year)d_%%(month).2d_%%(day).2d_%%(hour).2d%%(minute).2d-%%(rev)s_%%(slug)s
13
-
14
- # sys.path path, will be prepended to sys.path if present.
15
- # defaults to the current working directory.
16
- ; prepend_sys_path = .
17
-
18
- # timezone to use when rendering the date within the migration file
19
- # as well as the filename.
20
- # If specified, requires the python>=3.9 or backports.zoneinfo library and tzdata library.
21
- # Any required deps can installed by adding `alembic[tz]` to the pip requirements
22
- # string value is passed to ZoneInfo()
23
- # leave blank for localtime
24
- # timezone =
25
-
26
- # max length of characters to apply to the "slug" field
27
- # truncate_slug_length = 40
28
-
29
- # set to 'true' to run the environment during
30
- # the 'revision' command, regardless of autogenerate
31
- # revision_environment = false
32
-
33
- # set to 'true' to allow .pyc and .pyo files without
34
- # a source .py file to be detected as revisions in the
35
- # versions/ directory
36
- # sourceless = false
37
-
38
- # version location specification; This defaults
39
- # to alembic/versions. When using multiple version
40
- # directories, initial revisions must be specified with --version-path.
41
- # The path separator used here should be the separator specified by "version_path_separator" below.
42
- # version_locations = %(here)s/bar:%(here)s/bat:alembic/versions
43
-
44
- # version path separator; As mentioned above, this is the character used to split
45
- # version_locations. The default within new alembic.ini files is "os", which uses os.pathsep.
46
- # If this key is omitted entirely, it falls back to the legacy behavior of splitting on spaces and/or commas.
47
- # Valid values for version_path_separator are:
48
- #
49
- # version_path_separator = :
50
- # version_path_separator = ;
51
- # version_path_separator = space
52
- # version_path_separator = newline
53
- #
54
- # Use os.pathsep. Default configuration used for new projects.
55
- ; version_path_separator = os
56
-
57
- # set to 'true' to search source files recursively
58
- # in each "version_locations" directory
59
- # new in Alembic version 1.10
60
- # recursive_version_locations = false
61
-
62
- # the output encoding used when revision files
63
- # are written from script.py.mako
64
- # output_encoding = utf-8
65
-
66
- ; sqlalchemy.url = driver://user:pass@localhost/dbname
67
-
68
-
69
- [post_write_hooks]
70
- # post_write_hooks defines scripts or Python functions that are run
71
- # on newly generated revision scripts. See the documentation for further
72
- # detail and examples
73
-
74
- # format using "black" - use the console_scripts runner, against the "black" entrypoint
75
- # hooks = black
76
- # black.type = console_scripts
77
- # black.entrypoint = black
78
- # black.options = -l 79 REVISION_SCRIPT_FILENAME
79
-
80
- # lint with attempts to fix using "ruff" - use the exec runner, execute a binary
81
- # hooks = ruff
82
- # ruff.type = exec
83
- # ruff.executable = %(here)s/.venv/bin/ruff
84
- # ruff.options = --fix REVISION_SCRIPT_FILENAME
85
-
86
- # Logging configuration
87
- [loggers]
88
- keys = root,sqlalchemy,alembic
89
-
90
- [handlers]
91
- keys = console
92
-
93
- [formatters]
94
- keys = generic
95
-
96
- [logger_root]
97
- level = WARNING
98
- handlers = console
99
- qualname =
100
-
101
- [logger_sqlalchemy]
102
- level = WARNING
103
- handlers =
104
- qualname = sqlalchemy.engine
105
-
106
- [logger_alembic]
107
- level = INFO
108
- handlers =
109
- qualname = alembic
110
-
111
- [handler_console]
112
- class = StreamHandler
113
- args = (sys.stderr,)
114
- level = NOTSET
115
- formatter = generic
116
-
117
- [formatter_generic]
118
- format = %(levelname)-5.5s [%(name)s] %(message)s
119
- datefmt = %H:%M:%S
1
+ # A generic, single database configuration.
2
+
3
+ [alembic]
4
+ # path to migration scripts
5
+ # Use forward slashes (/) also on windows to provide an os agnostic path
6
+ script_location = src/alembic
7
+
8
+ # template used to generate migration file names; The default value is %%(rev)s_%%(slug)s
9
+ # Uncomment the line below if you want the files to be prepended with date and time
10
+ # see https://alembic.sqlalchemy.org/en/latest/tutorial.html#editing-the-ini-file
11
+ # for all available tokens
12
+ # file_template = %%(year)d_%%(month).2d_%%(day).2d_%%(hour).2d%%(minute).2d-%%(rev)s_%%(slug)s
13
+
14
+ # sys.path path, will be prepended to sys.path if present.
15
+ # defaults to the current working directory.
16
+ ; prepend_sys_path = .
17
+
18
+ # timezone to use when rendering the date within the migration file
19
+ # as well as the filename.
20
+ # If specified, requires the python>=3.9 or backports.zoneinfo library and tzdata library.
21
+ # Any required deps can installed by adding `alembic[tz]` to the pip requirements
22
+ # string value is passed to ZoneInfo()
23
+ # leave blank for localtime
24
+ # timezone =
25
+
26
+ # max length of characters to apply to the "slug" field
27
+ # truncate_slug_length = 40
28
+
29
+ # set to 'true' to run the environment during
30
+ # the 'revision' command, regardless of autogenerate
31
+ # revision_environment = false
32
+
33
+ # set to 'true' to allow .pyc and .pyo files without
34
+ # a source .py file to be detected as revisions in the
35
+ # versions/ directory
36
+ # sourceless = false
37
+
38
+ # version location specification; This defaults
39
+ # to alembic/versions. When using multiple version
40
+ # directories, initial revisions must be specified with --version-path.
41
+ # The path separator used here should be the separator specified by "version_path_separator" below.
42
+ # version_locations = %(here)s/bar:%(here)s/bat:alembic/versions
43
+
44
+ # version path separator; As mentioned above, this is the character used to split
45
+ # version_locations. The default within new alembic.ini files is "os", which uses os.pathsep.
46
+ # If this key is omitted entirely, it falls back to the legacy behavior of splitting on spaces and/or commas.
47
+ # Valid values for version_path_separator are:
48
+ #
49
+ # version_path_separator = :
50
+ # version_path_separator = ;
51
+ # version_path_separator = space
52
+ # version_path_separator = newline
53
+ #
54
+ # Use os.pathsep. Default configuration used for new projects.
55
+ ; version_path_separator = os
56
+
57
+ # set to 'true' to search source files recursively
58
+ # in each "version_locations" directory
59
+ # new in Alembic version 1.10
60
+ # recursive_version_locations = false
61
+
62
+ # the output encoding used when revision files
63
+ # are written from script.py.mako
64
+ # output_encoding = utf-8
65
+
66
+ ; sqlalchemy.url = driver://user:pass@localhost/dbname
67
+
68
+
69
+ [post_write_hooks]
70
+ # post_write_hooks defines scripts or Python functions that are run
71
+ # on newly generated revision scripts. See the documentation for further
72
+ # detail and examples
73
+
74
+ # format using "black" - use the console_scripts runner, against the "black" entrypoint
75
+ # hooks = black
76
+ # black.type = console_scripts
77
+ # black.entrypoint = black
78
+ # black.options = -l 79 REVISION_SCRIPT_FILENAME
79
+
80
+ # lint with attempts to fix using "ruff" - use the exec runner, execute a binary
81
+ # hooks = ruff
82
+ # ruff.type = exec
83
+ # ruff.executable = %(here)s/.venv/bin/ruff
84
+ # ruff.options = --fix REVISION_SCRIPT_FILENAME
85
+
86
+ # Logging configuration
87
+ [loggers]
88
+ keys = root,sqlalchemy,alembic
89
+
90
+ [handlers]
91
+ keys = console
92
+
93
+ [formatters]
94
+ keys = generic
95
+
96
+ [logger_root]
97
+ level = WARNING
98
+ handlers = console
99
+ qualname =
100
+
101
+ [logger_sqlalchemy]
102
+ level = WARNING
103
+ handlers =
104
+ qualname = sqlalchemy.engine
105
+
106
+ [logger_alembic]
107
+ level = INFO
108
+ handlers =
109
+ qualname = alembic
110
+
111
+ [handler_console]
112
+ class = StreamHandler
113
+ args = (sys.stderr,)
114
+ level = NOTSET
115
+ formatter = generic
116
+
117
+ [formatter_generic]
118
+ format = %(levelname)-5.5s [%(name)s] %(message)s
119
+ datefmt = %H:%M:%S
@@ -1,44 +1,44 @@
1
- version: '3'
2
-
3
- services:
4
- db:
5
- image: postgres:16-alpine
6
- volumes:
7
- - postgres_data:/var/lib/postgresql/data/
8
- env_file:
9
- - ./.env
10
- environment:
11
- - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
12
- - POSTGRES_USER=${POSTGRES_USER}
13
- - POSTGRES_DB=${POSTGRES_DB}
14
- ports:
15
- - "5432:5432"
16
- healthcheck:
17
- test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
18
- interval: 5s
19
- timeout: 5s
20
- retries: 5
21
-
22
- app:
23
- build: .
24
- depends_on:
25
- db:
26
- condition: service_healthy
27
- env_file:
28
- - ./.env
29
- environment:
30
- - POSTGRES_SERVER=db
31
- - ENVIRONMENT=${ENVIRONMENT}
32
- ports:
33
- - "8000:8000"
34
- volumes:
35
- - ./:/app/
36
- command: >
37
- bash -c "
38
- chmod +x ./scripts/pre-start.sh &&
39
- ./scripts/pre-start.sh &&
40
- uvicorn src.main:app --host 0.0.0.0 --port 8000 --reload
41
- "
42
-
43
- volumes:
44
- postgres_data:
1
+ version: '3'
2
+
3
+ services:
4
+ db:
5
+ image: postgres:16-alpine
6
+ volumes:
7
+ - postgres_data:/var/lib/postgresql/data/
8
+ env_file:
9
+ - ./.env
10
+ environment:
11
+ - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
12
+ - POSTGRES_USER=${POSTGRES_USER}
13
+ - POSTGRES_DB=${POSTGRES_DB}
14
+ ports:
15
+ - "5432:5432"
16
+ healthcheck:
17
+ test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
18
+ interval: 5s
19
+ timeout: 5s
20
+ retries: 5
21
+
22
+ app:
23
+ build: .
24
+ depends_on:
25
+ db:
26
+ condition: service_healthy
27
+ env_file:
28
+ - ./.env
29
+ environment:
30
+ - POSTGRES_SERVER=db
31
+ - ENVIRONMENT=${ENVIRONMENT}
32
+ ports:
33
+ - "8000:8000"
34
+ volumes:
35
+ - ./:/app/
36
+ command: >
37
+ bash -c "
38
+ chmod +x ./scripts/pre-start.sh &&
39
+ ./scripts/pre-start.sh &&
40
+ uvicorn src.main:app --host 0.0.0.0 --port 8000 --reload
41
+ "
42
+
43
+ volumes:
44
+ postgres_data:
@@ -1,41 +1,41 @@
1
- alembic==1.14.1
2
- annotated-types==0.7.0
3
- anyio==4.8.0
4
- black==25.1.0
5
- certifi==2025.1.31
6
- click==8.1.8
7
- fastapi==0.115.8
8
- h11==0.14.0
9
- httpcore==1.0.7
10
- httptools==0.6.4
11
- httpx==0.28.1
12
- idna==3.10
13
- iniconfig==2.0.0
14
- isort==6.0.0
15
- Mako==1.3.9
16
- MarkupSafe==3.0.2
17
- mypy==1.15.0
18
- mypy-extensions==1.0.0
19
- packaging==24.2
20
- pathspec==0.12.1
21
- platformdirs==4.3.6
22
- pluggy==1.5.0
23
- psycopg==3.2.5
24
- psycopg-binary==3.2.5
25
- pydantic==2.10.6
26
- pydantic-settings==2.7.1
27
- pydantic_core==2.27.2
28
- pytest==8.3.4
29
- python-dotenv==1.0.1
30
- PyYAML==6.0.2
31
- setuptools==75.8.0
32
- sniffio==1.3.1
33
- SQLAlchemy==2.0.38
34
- sqlmodel==0.0.22
35
- starlette==0.45.3
36
- tenacity==9.0.0
37
- typing_extensions==4.12.2
38
- uvicorn==0.34.0
39
- uvloop==0.21.0
40
- watchfiles==1.0.4
41
- websockets==15.0
1
+ alembic==1.14.1
2
+ annotated-types==0.7.0
3
+ anyio==4.8.0
4
+ black==25.1.0
5
+ certifi==2025.1.31
6
+ click==8.1.8
7
+ fastapi==0.115.8
8
+ h11==0.14.0
9
+ httpcore==1.0.7
10
+ httptools==0.6.4
11
+ httpx==0.28.1
12
+ idna==3.10
13
+ iniconfig==2.0.0
14
+ isort==6.0.0
15
+ Mako==1.3.9
16
+ MarkupSafe==3.0.2
17
+ mypy==1.15.0
18
+ mypy-extensions==1.0.0
19
+ packaging==24.2
20
+ pathspec==0.12.1
21
+ platformdirs==4.3.6
22
+ pluggy==1.5.0
23
+ psycopg==3.2.5
24
+ psycopg-binary==3.2.5
25
+ pydantic==2.10.6
26
+ pydantic-settings==2.7.1
27
+ pydantic_core==2.27.2
28
+ pytest==8.3.4
29
+ python-dotenv==1.0.1
30
+ PyYAML==6.0.2
31
+ setuptools==75.8.0
32
+ sniffio==1.3.1
33
+ SQLAlchemy==2.0.38
34
+ sqlmodel==0.0.22
35
+ starlette==0.45.3
36
+ tenacity==9.0.0
37
+ typing_extensions==4.12.2
38
+ uvicorn==0.34.0
39
+ uvloop==0.21.0
40
+ watchfiles==1.0.4
41
+ websockets==15.0
@@ -1,5 +1,5 @@
1
- #!/usr/bin/env bash
2
- set -x
3
-
4
- black .
5
- isort .
1
+ #!/usr/bin/env bash
2
+ set -x
3
+
4
+ black .
5
+ isort .
@@ -1,5 +1,5 @@
1
- #!/usr/bin/env bash
2
- set -x
3
-
4
- black . --check
5
- mypy src
1
+ #!/usr/bin/env bash
2
+ set -x
3
+
4
+ black . --check
5
+ mypy src
@@ -1,16 +1,16 @@
1
- #! /usr/bin/env bash
2
-
3
- set -e
4
- set -x
5
-
6
- # Let the DB start
7
- python src/utils/backend_pre_start.py
8
-
9
- # Ensure tables exist
10
- python -c "from src.core.db import create_db_and_tables; create_db_and_tables()"
11
-
12
- # Run migrations
13
- alembic upgrade head
14
-
15
- # Create initial data in DB
16
- python src/utils/init_data.py
1
+ #! /usr/bin/env bash
2
+
3
+ set -e
4
+ set -x
5
+
6
+ # Let the DB start
7
+ python src/utils/backend_pre_start.py
8
+
9
+ # Ensure tables exist
10
+ python -c "from src.core.db import create_db_and_tables; create_db_and_tables()"
11
+
12
+ # Run migrations
13
+ alembic upgrade head
14
+
15
+ # Create initial data in DB
16
+ python src/utils/init_data.py
@@ -1,8 +1,8 @@
1
- #!/usr/bin/env bash
2
-
3
- set -e
4
- set -x
5
-
6
- source .venv/bin/activate
7
-
8
- uvicorn src.main:app --reload
1
+ #!/usr/bin/env bash
2
+
3
+ set -e
4
+ set -x
5
+
6
+ source .venv/bin/activate
7
+
8
+ uvicorn src.main:app --reload
@@ -1,10 +1,10 @@
1
- #!/usr/bin/env bash
2
-
3
- set -e
4
- set -x
5
-
6
- export PYTHONPATH=$PYTHONPATH:$(pwd)
7
-
8
- python src/utils/tests_pre_start.py
9
-
10
- pytest
1
+ #!/usr/bin/env bash
2
+
3
+ set -e
4
+ set -x
5
+
6
+ export PYTHONPATH=$PYTHONPATH:$(pwd)
7
+
8
+ python src/utils/tests_pre_start.py
9
+
10
+ pytest
@@ -1,13 +1,13 @@
1
- [mypy]
2
- warn_unused_configs = true
3
- ignore_missing_imports = true
4
-
5
- [isort]
6
- profile = black
7
- line_length=100
8
- virtual_env=.venv
9
-
10
- [tool:pytest]
11
- pythonpath = src
12
- testpaths = tests
13
- python_files = test_*.py
1
+ [mypy]
2
+ warn_unused_configs = true
3
+ ignore_missing_imports = true
4
+
5
+ [isort]
6
+ profile = black
7
+ line_length=100
8
+ virtual_env=.venv
9
+
10
+ [tool:pytest]
11
+ pythonpath = src
12
+ testpaths = tests
13
+ python_files = test_*.py
@@ -1,25 +1,25 @@
1
- # --------------------------------------------------------------------------
2
- # package setup module
3
- # --------------------------------------------------------------------------
4
- from setuptools import find_packages, setup
5
-
6
- install_requires: list[str] = [
7
- "fastapi",
8
- "uvicorn",
9
- "pydantic",
10
- "pydantic-settings",
11
- "python-dotenv",
12
- "sqlmodel",
13
- "SQLAlchemy",
14
- "alembic",
15
- ]
16
-
17
- setup(
18
- name="<project_name>",
19
- description="[FastAPI-fastkit templated] <description>",
20
- author="<author>",
21
- author_email=f"<author_email>",
22
- packages=find_packages(where="src"),
23
- requires=["python (>=3.12)"],
24
- install_requires=install_requires,
25
- )
1
+ # --------------------------------------------------------------------------
2
+ # package setup module
3
+ # --------------------------------------------------------------------------
4
+ from setuptools import find_packages, setup
5
+
6
+ install_requires: list[str] = [
7
+ "fastapi",
8
+ "uvicorn",
9
+ "pydantic",
10
+ "pydantic-settings",
11
+ "python-dotenv",
12
+ "sqlmodel",
13
+ "SQLAlchemy",
14
+ "alembic",
15
+ ]
16
+
17
+ setup(
18
+ name="<project_name>",
19
+ description="[FastAPI-fastkit templated] <description>",
20
+ author="<author>",
21
+ author_email=f"<author_email>",
22
+ packages=find_packages(where="src"),
23
+ requires=["python (>=3.12)"],
24
+ install_requires=install_requires,
25
+ )
@@ -1 +1 @@
1
- Generic single-database configuration.
1
+ Generic single-database configuration.