fastapi-forge-cli 0.1.0__tar.gz

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 (188) hide show
  1. fastapi_forge_cli-0.1.0/LICENSE +18 -0
  2. fastapi_forge_cli-0.1.0/MANIFEST.in +8 -0
  3. fastapi_forge_cli-0.1.0/PKG-INFO +225 -0
  4. fastapi_forge_cli-0.1.0/README.md +200 -0
  5. fastapi_forge_cli-0.1.0/pyproject.toml +52 -0
  6. fastapi_forge_cli-0.1.0/setup.cfg +4 -0
  7. fastapi_forge_cli-0.1.0/src/fastapi_forge/__init__.py +7 -0
  8. fastapi_forge_cli-0.1.0/src/fastapi_forge/__main__.py +6 -0
  9. fastapi_forge_cli-0.1.0/src/fastapi_forge/cli.py +211 -0
  10. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/Dockerfile +31 -0
  11. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/README.md +121 -0
  12. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/_dockerignore +16 -0
  13. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/_github/workflows/ci.yml +23 -0
  14. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/_gitignore +19 -0
  15. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/alembic/README +1 -0
  16. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/alembic/__init__.py +1 -0
  17. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/alembic/env.py +51 -0
  18. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/alembic/script.py.mako +28 -0
  19. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/alembic/versions/2255ba4f9604_fresh_baseline.py +204 -0
  20. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/alembic.ini +35 -0
  21. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/__init__.py +1 -0
  22. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/__init__.py +1 -0
  23. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/v1/__init__.py +1 -0
  24. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/v1/api.py +34 -0
  25. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/v1/audit_logs/__init__.py +1 -0
  26. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/v1/audit_logs/repository.py +38 -0
  27. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/v1/audit_logs/router.py +50 -0
  28. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/v1/audit_logs/schema.py +21 -0
  29. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/v1/auth/__init__.py +0 -0
  30. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/v1/auth/repository.py +179 -0
  31. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/v1/auth/router.py +209 -0
  32. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/v1/auth/schema.py +98 -0
  33. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/v1/auth/service.py +383 -0
  34. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/v1/health/__init__.py +3 -0
  35. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/v1/health/router.py +23 -0
  36. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/v1/health/schema.py +5 -0
  37. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/v1/health/service.py +25 -0
  38. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/v1/permissions/__init__.py +0 -0
  39. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/v1/permissions/repository.py +80 -0
  40. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/v1/permissions/router.py +151 -0
  41. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/v1/permissions/schema.py +40 -0
  42. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/v1/permissions/service.py +156 -0
  43. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/v1/roles/__init__.py +1 -0
  44. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/v1/roles/repository.py +161 -0
  45. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/v1/roles/router.py +169 -0
  46. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/v1/roles/schema.py +51 -0
  47. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/v1/roles/service.py +319 -0
  48. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/v1/schema.py +7 -0
  49. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/v1/users/__init__.py +1 -0
  50. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/v1/users/repository.py +181 -0
  51. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/v1/users/router.py +146 -0
  52. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/v1/users/schema.py +112 -0
  53. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/api/v1/users/service.py +291 -0
  54. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/core/__init__.py +1 -0
  55. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/core/config.py +131 -0
  56. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/core/dependencies.py +131 -0
  57. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/core/exceptions.py +162 -0
  58. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/core/logging.py +231 -0
  59. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/core/middleware.py +188 -0
  60. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/core/responses.py +108 -0
  61. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/core/security.py +115 -0
  62. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/db/__init__.py +1 -0
  63. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/db/base.py +5 -0
  64. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/db/models/__init__.py +16 -0
  65. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/db/models/audit_log.py +58 -0
  66. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/db/models/auth_token.py +72 -0
  67. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/db/models/notification.py +49 -0
  68. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/db/models/permission.py +174 -0
  69. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/db/models/revoked_token.py +21 -0
  70. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/db/models/user.py +53 -0
  71. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/db/schemas/__init__.py +8 -0
  72. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/db/schemas/common.py +70 -0
  73. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/db/schemas/names.py +9 -0
  74. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/db/session.py +86 -0
  75. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/helper/__init__.py +1 -0
  76. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/helper/pagination_helper.py +44 -0
  77. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/helper/search.py +51 -0
  78. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/helper/sorting.py +77 -0
  79. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/main.py +66 -0
  80. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/repositories/__init__.py +1 -0
  81. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/repositories/base.py +347 -0
  82. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/services/__init__.py +1 -0
  83. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/services/audit.py +58 -0
  84. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/services/email.py +118 -0
  85. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/services/notification.py +82 -0
  86. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/templates/email/notification.html +7 -0
  87. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/templates/email/password_reset.html +7 -0
  88. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/templates/email/verify_email.html +7 -0
  89. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/templates/email/welcome.html +6 -0
  90. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/app/utils/casing.py +31 -0
  91. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/compose.yaml +33 -0
  92. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/pyproject.toml +14 -0
  93. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/requirements-dev.txt +5 -0
  94. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/requirements.txt +16 -0
  95. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/sample.env +42 -0
  96. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/scripts/seed_first_user.py +166 -0
  97. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/tests/test_audit.py +42 -0
  98. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/tests/test_config.py +27 -0
  99. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/tests/test_generator.py +20 -0
  100. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/tests/test_permissions.py +36 -0
  101. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/with_rbac/tests/test_security.py +68 -0
  102. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/Dockerfile +31 -0
  103. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/README.md +106 -0
  104. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/_dockerignore +16 -0
  105. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/_github/workflows/ci.yml +23 -0
  106. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/_gitignore +19 -0
  107. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/alembic/README +1 -0
  108. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/alembic/__init__.py +1 -0
  109. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/alembic/env.py +51 -0
  110. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/alembic/script.py.mako +28 -0
  111. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/alembic/versions/2255ba4f9604_fresh_baseline.py +125 -0
  112. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/alembic.ini +35 -0
  113. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/__init__.py +1 -0
  114. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/api/__init__.py +1 -0
  115. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/api/v1/__init__.py +1 -0
  116. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/api/v1/api.py +29 -0
  117. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/api/v1/audit_logs/__init__.py +1 -0
  118. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/api/v1/audit_logs/repository.py +38 -0
  119. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/api/v1/audit_logs/router.py +45 -0
  120. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/api/v1/audit_logs/schema.py +21 -0
  121. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/api/v1/auth/__init__.py +0 -0
  122. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/api/v1/auth/repository.py +127 -0
  123. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/api/v1/auth/router.py +207 -0
  124. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/api/v1/auth/schema.py +96 -0
  125. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/api/v1/auth/service.py +373 -0
  126. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/api/v1/health/__init__.py +3 -0
  127. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/api/v1/health/router.py +23 -0
  128. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/api/v1/health/schema.py +5 -0
  129. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/api/v1/health/service.py +25 -0
  130. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/api/v1/schema.py +7 -0
  131. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/api/v1/users/__init__.py +1 -0
  132. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/api/v1/users/repository.py +69 -0
  133. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/api/v1/users/router.py +94 -0
  134. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/api/v1/users/schema.py +50 -0
  135. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/api/v1/users/service.py +92 -0
  136. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/core/__init__.py +1 -0
  137. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/core/config.py +131 -0
  138. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/core/dependencies.py +71 -0
  139. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/core/exceptions.py +162 -0
  140. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/core/logging.py +231 -0
  141. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/core/middleware.py +188 -0
  142. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/core/responses.py +108 -0
  143. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/core/security.py +115 -0
  144. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/db/__init__.py +1 -0
  145. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/db/base.py +5 -0
  146. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/db/models/__init__.py +10 -0
  147. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/db/models/audit_log.py +58 -0
  148. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/db/models/auth_token.py +72 -0
  149. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/db/models/notification.py +49 -0
  150. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/db/models/revoked_token.py +21 -0
  151. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/db/models/user.py +33 -0
  152. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/db/schemas/__init__.py +8 -0
  153. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/db/schemas/common.py +70 -0
  154. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/db/schemas/names.py +5 -0
  155. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/db/session.py +86 -0
  156. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/helper/__init__.py +1 -0
  157. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/helper/pagination_helper.py +44 -0
  158. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/helper/search.py +51 -0
  159. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/helper/sorting.py +77 -0
  160. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/main.py +66 -0
  161. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/repositories/__init__.py +1 -0
  162. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/repositories/base.py +347 -0
  163. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/services/__init__.py +1 -0
  164. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/services/audit.py +58 -0
  165. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/services/email.py +118 -0
  166. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/services/notification.py +82 -0
  167. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/templates/email/notification.html +7 -0
  168. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/templates/email/password_reset.html +7 -0
  169. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/templates/email/verify_email.html +7 -0
  170. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/templates/email/welcome.html +6 -0
  171. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/app/utils/casing.py +31 -0
  172. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/compose.yaml +33 -0
  173. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/pyproject.toml +14 -0
  174. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/requirements-dev.txt +5 -0
  175. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/requirements.txt +16 -0
  176. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/sample.env +42 -0
  177. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/scripts/seed_first_user.py +51 -0
  178. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/tests/test_audit.py +42 -0
  179. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/tests/test_config.py +27 -0
  180. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/tests/test_generator.py +20 -0
  181. fastapi_forge_cli-0.1.0/src/fastapi_forge/templates/without_rbac/tests/test_security.py +68 -0
  182. fastapi_forge_cli-0.1.0/src/fastapi_forge_cli.egg-info/PKG-INFO +225 -0
  183. fastapi_forge_cli-0.1.0/src/fastapi_forge_cli.egg-info/SOURCES.txt +186 -0
  184. fastapi_forge_cli-0.1.0/src/fastapi_forge_cli.egg-info/dependency_links.txt +1 -0
  185. fastapi_forge_cli-0.1.0/src/fastapi_forge_cli.egg-info/entry_points.txt +2 -0
  186. fastapi_forge_cli-0.1.0/src/fastapi_forge_cli.egg-info/requires.txt +6 -0
  187. fastapi_forge_cli-0.1.0/src/fastapi_forge_cli.egg-info/top_level.txt +1 -0
  188. fastapi_forge_cli-0.1.0/tests/test_cli.py +140 -0
@@ -0,0 +1,18 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 FastAPI Forge Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18
+
@@ -0,0 +1,8 @@
1
+ include README.md
2
+ include LICENSE
3
+ recursive-include src/fastapi_forge/templates *
4
+ prune src/fastapi_forge/templates/with_rbac/.pytest_cache
5
+ prune src/fastapi_forge/templates/with_rbac/.ruff_cache
6
+ prune src/fastapi_forge/templates/without_rbac/.pytest_cache
7
+ prune src/fastapi_forge/templates/without_rbac/.ruff_cache
8
+ global-exclude *.py[cod]
@@ -0,0 +1,225 @@
1
+ Metadata-Version: 2.4
2
+ Name: fastapi-forge-cli
3
+ Version: 0.1.0
4
+ Summary: Generate production-oriented FastAPI projects with optional RBAC.
5
+ Author: FastAPI Forge Contributors
6
+ License-Expression: MIT
7
+ Keywords: fastapi,boilerplate,generator,rbac,cli
8
+ Classifier: Development Status :: 3 - Alpha
9
+ Classifier: Environment :: Console
10
+ Classifier: Framework :: FastAPI
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.9
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Requires-Python: >=3.9
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Provides-Extra: dev
20
+ Requires-Dist: build<2.0,>=1.2; extra == "dev"
21
+ Requires-Dist: pytest<9.0,>=8.0; extra == "dev"
22
+ Requires-Dist: ruff<1.0,>=0.8; extra == "dev"
23
+ Requires-Dist: twine<7.0,>=5.1; extra == "dev"
24
+ Dynamic: license-file
25
+
26
+ # FastAPI Forge
27
+
28
+ FastAPI Forge is a zero-runtime-dependency CLI that generates production-oriented FastAPI projects with PostgreSQL, Alembic migrations, JWT authentication, audit logging, and optional role-based access control (RBAC).
29
+
30
+ ## Generated features
31
+
32
+ - Access and rotating refresh tokens, revocation, and session management
33
+ - Password reset and email verification flows
34
+ - PostgreSQL with sync and async SQLAlchemy sessions
35
+ - Alembic migrations and an idempotent first-user seed command
36
+ - Structured logs, request IDs, rate limiting, CORS, trusted hosts, and security headers
37
+ - Liveness, readiness, and database health endpoints
38
+ - A multi-stage, non-root Docker image and local Compose stack
39
+ - Pytest tests, Ruff checks, and GitHub Actions CI
40
+
41
+ The RBAC variant adds hierarchical roles, permissions, per-user permissions, protected administration APIs, and RBAC seed data. The non-RBAC variant uses `is_superuser` for administrative authorization.
42
+
43
+ ## Requirements
44
+
45
+ - Python 3.9+ for the generator
46
+ - Python 3.12+ and PostgreSQL 14+ for generated applications
47
+ - Docker with Compose v2 for the optional container workflow
48
+
49
+ ## Install
50
+
51
+ Install the CLI in an isolated environment from a published package:
52
+
53
+ ```bash
54
+ pipx install fastapi-forge-cli
55
+ ```
56
+
57
+ Or install it into the current Python environment:
58
+
59
+ ```bash
60
+ python -m pip install fastapi-forge-cli
61
+ ```
62
+
63
+ The PyPI distribution is named `fastapi-forge-cli` because `fastapi-forge` is
64
+ already used by another project. The installed terminal command remains
65
+ `fastapi-forge`, and the Python import remains `fastapi_forge`.
66
+
67
+ For development from a source checkout:
68
+
69
+ ```bash
70
+ cd fastapi-forge
71
+ python3 -m venv .venv
72
+ source .venv/bin/activate
73
+ python -m pip install --upgrade pip
74
+ pip install -e .
75
+ ```
76
+
77
+ For generator development, run `pip install -e ".[dev]"`. On Windows PowerShell, activate with `.venv\\Scripts\\Activate.ps1`.
78
+
79
+ ## Generate a project
80
+
81
+ ```bash
82
+ # With RBAC
83
+ fastapi-forge create "Inventory API" --with-rbac
84
+
85
+ # Without RBAC
86
+ fastapi-forge create "Inventory API" --without-rbac
87
+
88
+ # Select a parent directory
89
+ fastapi-forge create "Inventory API" --with-rbac --output-dir ./projects
90
+ ```
91
+
92
+ The same generator is available as a Python library:
93
+
94
+ ```python
95
+ from pathlib import Path
96
+
97
+ from fastapi_forge import create_project
98
+
99
+ project = create_project(
100
+ name="Inventory API",
101
+ output_dir=Path("./projects"),
102
+ with_rbac=True,
103
+ )
104
+ print(project)
105
+ ```
106
+
107
+ Generation is staged before installation at the destination. Existing projects are
108
+ preserved unless `--force` is explicitly supplied, and symbolic-link destinations
109
+ are never replaced.
110
+
111
+ If neither RBAC option is supplied, an interactive terminal asks which variant to use. Non-interactive environments default to RBAC. Existing destinations are protected; `--force` permanently replaces the matching generated-project directory.
112
+
113
+ ```text
114
+ usage: fastapi-forge create [-h] [--output-dir OUTPUT_DIR]
115
+ [--with-rbac | --without-rbac] [--force]
116
+ name
117
+ ```
118
+
119
+ ## Getting help
120
+
121
+ Discover available commands:
122
+
123
+ ```bash
124
+ fastapi-forge --help
125
+ ```
126
+
127
+ See every project-generation option:
128
+
129
+ ```bash
130
+ fastapi-forge create --help
131
+ ```
132
+
133
+ Print copy-ready examples:
134
+
135
+ ```bash
136
+ fastapi-forge examples
137
+ ```
138
+
139
+ Common commands include:
140
+
141
+ ```bash
142
+ fastapi-forge create "Inventory API" --with-rbac
143
+ fastapi-forge create "Public API" --without-rbac
144
+ fastapi-forge create "Billing API" --with-rbac --output-dir ./projects
145
+ ```
146
+
147
+ ## Run a generated project
148
+
149
+ ### Python
150
+
151
+ Create the PostgreSQL database described by `sample.env`, then:
152
+
153
+ ```bash
154
+ cd inventory-api
155
+ python3.12 -m venv .venv
156
+ source .venv/bin/activate
157
+ python -m pip install --upgrade pip
158
+ pip install -r requirements-dev.txt
159
+ cp sample.env .env
160
+ alembic upgrade head
161
+ python scripts/seed_first_user.py \
162
+ --email admin@example.com \
163
+ --password 'ChangeMe123!' \
164
+ --full-name 'System Administrator'
165
+ uvicorn app.main:app --reload
166
+ ```
167
+
168
+ Open `http://localhost:8000/docs`. Run `pytest` and `ruff check .` before committing.
169
+
170
+ ### Docker
171
+
172
+ ```bash
173
+ cd inventory-api
174
+ cp sample.env .env
175
+ docker compose up --build
176
+ ```
177
+
178
+ In another terminal:
179
+
180
+ ```bash
181
+ docker compose exec api python scripts/seed_first_user.py \
182
+ --email admin@example.com \
183
+ --password 'ChangeMe123!' \
184
+ --full-name 'System Administrator'
185
+ ```
186
+
187
+ The Compose file is for local development; it uses development credentials and a bind mount.
188
+
189
+ ## Production deployment checklist
190
+
191
+ 1. Set `APP_ENV=production`.
192
+ 2. Supply a unique `SECRET_KEY` of at least 32 characters from a secret manager.
193
+ 3. Set explicit `ALLOWED_HOSTS` and HTTPS `ALLOWED_ORIGINS` values.
194
+ 4. Use managed PostgreSQL credentials and `PG_SSLMODE=require`, `verify-ca`, or `verify-full`.
195
+ 5. Configure Redis when rate limits must be shared across replicas.
196
+ 6. Configure SMTP and `FRONTEND_URL` for account emails.
197
+ 7. Run `alembic upgrade head` as one release job before starting new replicas.
198
+ 8. Terminate TLS at a trusted load balancer or reverse proxy.
199
+ 9. Send stdout/stderr to centralized logging. Enable file logs only with persistent storage.
200
+ 10. Monitor `/api/v1/health/live` and `/api/v1/health/ready`.
201
+ 11. Back up PostgreSQL, test restores, rotate secrets, and define rollback procedures.
202
+
203
+ Production mode refuses startup with a default/short secret, wildcard hosts or origins, or a non-TLS database mode. Interactive API documentation is disabled.
204
+
205
+ ```bash
206
+ docker build -t inventory-api:1.0.0 .
207
+ docker run --rm --env-file .env inventory-api:1.0.0 alembic upgrade head
208
+ docker run --rm --env-file .env -p 8000:8000 inventory-api:1.0.0
209
+ ```
210
+
211
+ Do not run migrations independently from every application replica.
212
+
213
+ ## Generator development and release
214
+
215
+ ```bash
216
+ pytest
217
+ python -m build
218
+ python -m twine check dist/*
219
+ ```
220
+
221
+ Review generated output from both variants whenever templates change.
222
+
223
+ ## License
224
+
225
+ MIT
@@ -0,0 +1,200 @@
1
+ # FastAPI Forge
2
+
3
+ FastAPI Forge is a zero-runtime-dependency CLI that generates production-oriented FastAPI projects with PostgreSQL, Alembic migrations, JWT authentication, audit logging, and optional role-based access control (RBAC).
4
+
5
+ ## Generated features
6
+
7
+ - Access and rotating refresh tokens, revocation, and session management
8
+ - Password reset and email verification flows
9
+ - PostgreSQL with sync and async SQLAlchemy sessions
10
+ - Alembic migrations and an idempotent first-user seed command
11
+ - Structured logs, request IDs, rate limiting, CORS, trusted hosts, and security headers
12
+ - Liveness, readiness, and database health endpoints
13
+ - A multi-stage, non-root Docker image and local Compose stack
14
+ - Pytest tests, Ruff checks, and GitHub Actions CI
15
+
16
+ The RBAC variant adds hierarchical roles, permissions, per-user permissions, protected administration APIs, and RBAC seed data. The non-RBAC variant uses `is_superuser` for administrative authorization.
17
+
18
+ ## Requirements
19
+
20
+ - Python 3.9+ for the generator
21
+ - Python 3.12+ and PostgreSQL 14+ for generated applications
22
+ - Docker with Compose v2 for the optional container workflow
23
+
24
+ ## Install
25
+
26
+ Install the CLI in an isolated environment from a published package:
27
+
28
+ ```bash
29
+ pipx install fastapi-forge-cli
30
+ ```
31
+
32
+ Or install it into the current Python environment:
33
+
34
+ ```bash
35
+ python -m pip install fastapi-forge-cli
36
+ ```
37
+
38
+ The PyPI distribution is named `fastapi-forge-cli` because `fastapi-forge` is
39
+ already used by another project. The installed terminal command remains
40
+ `fastapi-forge`, and the Python import remains `fastapi_forge`.
41
+
42
+ For development from a source checkout:
43
+
44
+ ```bash
45
+ cd fastapi-forge
46
+ python3 -m venv .venv
47
+ source .venv/bin/activate
48
+ python -m pip install --upgrade pip
49
+ pip install -e .
50
+ ```
51
+
52
+ For generator development, run `pip install -e ".[dev]"`. On Windows PowerShell, activate with `.venv\\Scripts\\Activate.ps1`.
53
+
54
+ ## Generate a project
55
+
56
+ ```bash
57
+ # With RBAC
58
+ fastapi-forge create "Inventory API" --with-rbac
59
+
60
+ # Without RBAC
61
+ fastapi-forge create "Inventory API" --without-rbac
62
+
63
+ # Select a parent directory
64
+ fastapi-forge create "Inventory API" --with-rbac --output-dir ./projects
65
+ ```
66
+
67
+ The same generator is available as a Python library:
68
+
69
+ ```python
70
+ from pathlib import Path
71
+
72
+ from fastapi_forge import create_project
73
+
74
+ project = create_project(
75
+ name="Inventory API",
76
+ output_dir=Path("./projects"),
77
+ with_rbac=True,
78
+ )
79
+ print(project)
80
+ ```
81
+
82
+ Generation is staged before installation at the destination. Existing projects are
83
+ preserved unless `--force` is explicitly supplied, and symbolic-link destinations
84
+ are never replaced.
85
+
86
+ If neither RBAC option is supplied, an interactive terminal asks which variant to use. Non-interactive environments default to RBAC. Existing destinations are protected; `--force` permanently replaces the matching generated-project directory.
87
+
88
+ ```text
89
+ usage: fastapi-forge create [-h] [--output-dir OUTPUT_DIR]
90
+ [--with-rbac | --without-rbac] [--force]
91
+ name
92
+ ```
93
+
94
+ ## Getting help
95
+
96
+ Discover available commands:
97
+
98
+ ```bash
99
+ fastapi-forge --help
100
+ ```
101
+
102
+ See every project-generation option:
103
+
104
+ ```bash
105
+ fastapi-forge create --help
106
+ ```
107
+
108
+ Print copy-ready examples:
109
+
110
+ ```bash
111
+ fastapi-forge examples
112
+ ```
113
+
114
+ Common commands include:
115
+
116
+ ```bash
117
+ fastapi-forge create "Inventory API" --with-rbac
118
+ fastapi-forge create "Public API" --without-rbac
119
+ fastapi-forge create "Billing API" --with-rbac --output-dir ./projects
120
+ ```
121
+
122
+ ## Run a generated project
123
+
124
+ ### Python
125
+
126
+ Create the PostgreSQL database described by `sample.env`, then:
127
+
128
+ ```bash
129
+ cd inventory-api
130
+ python3.12 -m venv .venv
131
+ source .venv/bin/activate
132
+ python -m pip install --upgrade pip
133
+ pip install -r requirements-dev.txt
134
+ cp sample.env .env
135
+ alembic upgrade head
136
+ python scripts/seed_first_user.py \
137
+ --email admin@example.com \
138
+ --password 'ChangeMe123!' \
139
+ --full-name 'System Administrator'
140
+ uvicorn app.main:app --reload
141
+ ```
142
+
143
+ Open `http://localhost:8000/docs`. Run `pytest` and `ruff check .` before committing.
144
+
145
+ ### Docker
146
+
147
+ ```bash
148
+ cd inventory-api
149
+ cp sample.env .env
150
+ docker compose up --build
151
+ ```
152
+
153
+ In another terminal:
154
+
155
+ ```bash
156
+ docker compose exec api python scripts/seed_first_user.py \
157
+ --email admin@example.com \
158
+ --password 'ChangeMe123!' \
159
+ --full-name 'System Administrator'
160
+ ```
161
+
162
+ The Compose file is for local development; it uses development credentials and a bind mount.
163
+
164
+ ## Production deployment checklist
165
+
166
+ 1. Set `APP_ENV=production`.
167
+ 2. Supply a unique `SECRET_KEY` of at least 32 characters from a secret manager.
168
+ 3. Set explicit `ALLOWED_HOSTS` and HTTPS `ALLOWED_ORIGINS` values.
169
+ 4. Use managed PostgreSQL credentials and `PG_SSLMODE=require`, `verify-ca`, or `verify-full`.
170
+ 5. Configure Redis when rate limits must be shared across replicas.
171
+ 6. Configure SMTP and `FRONTEND_URL` for account emails.
172
+ 7. Run `alembic upgrade head` as one release job before starting new replicas.
173
+ 8. Terminate TLS at a trusted load balancer or reverse proxy.
174
+ 9. Send stdout/stderr to centralized logging. Enable file logs only with persistent storage.
175
+ 10. Monitor `/api/v1/health/live` and `/api/v1/health/ready`.
176
+ 11. Back up PostgreSQL, test restores, rotate secrets, and define rollback procedures.
177
+
178
+ Production mode refuses startup with a default/short secret, wildcard hosts or origins, or a non-TLS database mode. Interactive API documentation is disabled.
179
+
180
+ ```bash
181
+ docker build -t inventory-api:1.0.0 .
182
+ docker run --rm --env-file .env inventory-api:1.0.0 alembic upgrade head
183
+ docker run --rm --env-file .env -p 8000:8000 inventory-api:1.0.0
184
+ ```
185
+
186
+ Do not run migrations independently from every application replica.
187
+
188
+ ## Generator development and release
189
+
190
+ ```bash
191
+ pytest
192
+ python -m build
193
+ python -m twine check dist/*
194
+ ```
195
+
196
+ Review generated output from both variants whenever templates change.
197
+
198
+ ## License
199
+
200
+ MIT
@@ -0,0 +1,52 @@
1
+ [build-system]
2
+ requires = ["setuptools>=69", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "fastapi-forge-cli"
7
+ version = "0.1.0"
8
+ description = "Generate production-oriented FastAPI projects with optional RBAC."
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = "MIT"
12
+ authors = [{name = "FastAPI Forge Contributors"}]
13
+ keywords = ["fastapi", "boilerplate", "generator", "rbac", "cli"]
14
+ classifiers = [
15
+ "Development Status :: 3 - Alpha",
16
+ "Environment :: Console",
17
+ "Framework :: FastAPI",
18
+ "Programming Language :: Python :: 3",
19
+ "Programming Language :: Python :: 3.9",
20
+ "Programming Language :: Python :: 3.10",
21
+ "Programming Language :: Python :: 3.11",
22
+ "Programming Language :: Python :: 3.12",
23
+ ]
24
+ dependencies = []
25
+
26
+ [project.optional-dependencies]
27
+ dev = [
28
+ "build>=1.2,<2.0",
29
+ "pytest>=8.0,<9.0",
30
+ "ruff>=0.8,<1.0",
31
+ "twine>=5.1,<7.0",
32
+ ]
33
+
34
+ [project.scripts]
35
+ fastapi-forge = "fastapi_forge.cli:main"
36
+
37
+ [tool.setuptools]
38
+ package-dir = {"" = "src"}
39
+ include-package-data = true
40
+
41
+ [tool.setuptools.packages.find]
42
+ where = ["src"]
43
+
44
+ [tool.setuptools.package-data]
45
+ fastapi_forge = [
46
+ "templates/**/*",
47
+ "templates/**/_*",
48
+ "templates/**/_github/**/*",
49
+ ]
50
+
51
+ [tool.pytest.ini_options]
52
+ testpaths = ["tests"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,7 @@
1
+ """FastAPI Forge project generator."""
2
+
3
+ from fastapi_forge.cli import ForgeError, create_project, project_slug
4
+
5
+ __version__ = "0.1.0"
6
+
7
+ __all__ = ["ForgeError", "__version__", "create_project", "project_slug"]
@@ -0,0 +1,6 @@
1
+ """Module entry point for ``python -m fastapi_forge``."""
2
+
3
+ from fastapi_forge.cli import main
4
+
5
+ if __name__ == "__main__":
6
+ raise SystemExit(main())