Skip to content

Commit ec6f581

Browse files
committed
feature: Refactor app, add users and auth
1 parent 3ade83d commit ec6f581

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1173
-108
lines changed

.env.sample

Lines changed: 0 additions & 6 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var/
2828
*.egg
2929
.venv/
3030
venv/
31-
.env
31+
.envs/
3232

3333
# Python debug
3434
pdb/

.pre-commit-config.yaml

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
1-
exclude: 'docs|node_modules|migrations|.git|.tox|.mypy_cache|frontend'
1+
---
2+
exclude: docs|node_modules|migrations|.git|.tox|.mypy_cache|frontend
23
default_stages: [commit]
34
fail_fast: true
45

56
repos:
6-
- repo: https://github.com/pre-commit/pre-commit-hooks
7-
rev: v4.5.0
8-
hooks:
9-
- id: trailing-whitespace
10-
- id: end-of-file-fixer
11-
- id: check-yaml
12-
- id: requirements-txt-fixer
13-
- id: check-merge-conflict
14-
- repo: https://github.com/myint/autoflake
15-
rev: v1.4
16-
hooks:
17-
- id: autoflake
18-
args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variables', '--ignore-init-module-imports']
19-
- repo: https://github.com/psf/black
20-
rev: 23.11.0
21-
hooks:
22-
- id: black
23-
- repo: https://github.com/PyCQA/bandit
24-
rev: '1.7.5'
25-
hooks:
26-
- id: bandit
7+
- repo: https://github.com/pre-commit/pre-commit-hooks
8+
rev: v4.6.0
9+
hooks:
10+
- id: trailing-whitespace
11+
- id: end-of-file-fixer
12+
- id: check-yaml
13+
- id: requirements-txt-fixer
14+
- id: check-merge-conflict
15+
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
16+
rev: 0.2.3 # or other specific tag
17+
hooks:
18+
- id: yamlfmt
19+
- repo: https://github.com/astral-sh/ruff-pre-commit
20+
# Ruff version.
21+
rev: v0.4.10
22+
hooks:
23+
# Run the linter.
24+
- id: ruff
25+
args: [--fix]
26+
# Run the formatter.
27+
- id: ruff-format
28+
- repo: https://github.com/PyCQA/bandit
29+
rev: 1.7.9
30+
hooks:
31+
- id: bandit

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Edgecutters
2+
3+
Simple FastAPI template with users and auth.

alembic.ini

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# A generic, single database configuration.
2+
3+
[alembic]
4+
# path to migration scripts
5+
script_location = src/database/migrations
6+
7+
# template used to generate migration file names; The default value is %%(rev)s_%%(slug)s
8+
# Uncomment the line below if you want the files to be prepended with date and time
9+
# file_template = %%(year)d_%%(month).2d_%%(day).2d_%%(hour).2d%%(minute).2d-%%(rev)s_%%(slug)s
10+
11+
# sys.path path, will be prepended to sys.path if present.
12+
# defaults to the current working directory.
13+
prepend_sys_path = .
14+
15+
# timezone to use when rendering the date within the migration file
16+
# as well as the filename.
17+
# If specified, requires the python>=3.9 or backports.zoneinfo library.
18+
# Any required deps can installed by adding `alembic[tz]` to the pip requirements
19+
# string value is passed to ZoneInfo()
20+
# leave blank for localtime
21+
# timezone =
22+
23+
# max length of characters to apply to the
24+
# "slug" field
25+
# truncate_slug_length = 40
26+
27+
# set to 'true' to run the environment during
28+
# the 'revision' command, regardless of autogenerate
29+
# revision_environment = false
30+
31+
# set to 'true' to allow .pyc and .pyo files without
32+
# a source .py file to be detected as revisions in the
33+
# versions/ directory
34+
# sourceless = false
35+
36+
# version location specification; This defaults
37+
# to src/database/migrations/versions. When using multiple version
38+
# directories, initial revisions must be specified with --version-path.
39+
# The path separator used here should be the separator specified by "version_path_separator" below.
40+
# version_locations = %(here)s/bar:%(here)s/bat:src/database/migrations/versions
41+
42+
# version path separator; As mentioned above, this is the character used to split
43+
# version_locations. The default within new alembic.ini files is "os", which uses os.pathsep.
44+
# If this key is omitted entirely, it falls back to the legacy behavior of splitting on spaces and/or commas.
45+
# Valid values for version_path_separator are:
46+
#
47+
# version_path_separator = :
48+
# version_path_separator = ;
49+
# version_path_separator = space
50+
version_path_separator = os # Use os.pathsep. Default configuration used for new projects.
51+
52+
# set to 'true' to search source files recursively
53+
# in each "version_locations" directory
54+
# new in Alembic version 1.10
55+
# recursive_version_locations = false
56+
57+
# the output encoding used when revision files
58+
# are written from script.py.mako
59+
# output_encoding = utf-8
60+
61+
;sqlalchemy.url = driver://user:pass@localhost/dbname
62+
63+
64+
[post_write_hooks]
65+
# post_write_hooks defines scripts or Python functions that are run
66+
# on newly generated revision scripts. See the documentation for further
67+
# detail and examples
68+
69+
# format using "black" - use the console_scripts runner, against the "black" entrypoint
70+
# hooks = black
71+
# black.type = console_scripts
72+
# black.entrypoint = black
73+
# black.options = -l 79 REVISION_SCRIPT_FILENAME
74+
75+
# lint with attempts to fix using "ruff" - use the exec runner, execute a binary
76+
# hooks = ruff
77+
# ruff.type = exec
78+
# ruff.executable = %(here)s/.venv/bin/ruff
79+
# ruff.options = --fix REVISION_SCRIPT_FILENAME
80+
81+
# Logging configuration
82+
[loggers]
83+
keys = root,sqlalchemy,alembic
84+
85+
[handlers]
86+
keys = console
87+
88+
[formatters]
89+
keys = generic
90+
91+
[logger_root]
92+
level = WARN
93+
handlers = console
94+
qualname =
95+
96+
[logger_sqlalchemy]
97+
level = WARN
98+
handlers =
99+
qualname = sqlalchemy.engine
100+
101+
[logger_alembic]
102+
level = INFO
103+
handlers =
104+
qualname = alembic
105+
106+
[handler_console]
107+
class = StreamHandler
108+
args = (sys.stderr,)
109+
level = NOTSET
110+
formatter = generic
111+
112+
[formatter_generic]
113+
format = %(levelname)-5.5s [%(name)s] %(message)s
114+
datefmt = %H:%M:%S

app/api/endpoints.py

Lines changed: 0 additions & 24 deletions
This file was deleted.

app/api/routers.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

app/config/base.py

Lines changed: 0 additions & 25 deletions
This file was deleted.

app/config/keycloak.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

app/main.py

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)