Skip to content

Commit e3e9408

Browse files
committed
feat: init
0 parents  commit e3e9408

30 files changed

+5909
-0
lines changed

.gitignore

+182
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
.doit.db.db
2+
.DS_Store
3+
db.local
4+
5+
6+
7+
# Created by https://www.toptal.com/developers/gitignore/api/python
8+
# Edit at https://www.toptal.com/developers/gitignore?templates=python
9+
10+
### Python ###
11+
# Byte-compiled / optimized / DLL files
12+
__pycache__/
13+
*.py[cod]
14+
*$py.class
15+
16+
# C extensions
17+
*.so
18+
19+
# Distribution / packaging
20+
.Python
21+
build/
22+
develop-eggs/
23+
dist/
24+
downloads/
25+
eggs/
26+
.eggs/
27+
lib/
28+
lib64/
29+
parts/
30+
sdist/
31+
var/
32+
wheels/
33+
share/python-wheels/
34+
*.egg-info/
35+
.installed.cfg
36+
*.egg
37+
MANIFEST
38+
39+
# PyInstaller
40+
# Usually these files are written by a python script from a template
41+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
42+
*.manifest
43+
*.spec
44+
45+
# Installer logs
46+
pip-log.txt
47+
pip-delete-this-directory.txt
48+
49+
# Unit test / coverage reports
50+
htmlcov/
51+
.tox/
52+
.nox/
53+
.coverage
54+
.coverage.*
55+
.cache
56+
nosetests.xml
57+
coverage.xml
58+
*.cover
59+
*.py,cover
60+
.hypothesis/
61+
.pytest_cache/
62+
cover/
63+
64+
# Translations
65+
*.mo
66+
*.pot
67+
68+
# Django stuff:
69+
*.log
70+
local_settings.py
71+
db.sqlite3
72+
db.sqlite3-journal
73+
74+
# Flask stuff:
75+
instance/
76+
.webassets-cache
77+
78+
# Scrapy stuff:
79+
.scrapy
80+
81+
# Sphinx documentation
82+
docs/_build/
83+
84+
# PyBuilder
85+
.pybuilder/
86+
target/
87+
88+
# Jupyter Notebook
89+
.ipynb_checkpoints
90+
91+
# IPython
92+
profile_default/
93+
ipython_config.py
94+
95+
# pyenv
96+
# For a library or package, you might want to ignore these files since the code is
97+
# intended to run in multiple environments; otherwise, check them in:
98+
# .python-version
99+
100+
# pipenv
101+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
102+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
103+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
104+
# install all needed dependencies.
105+
#Pipfile.lock
106+
107+
# poetry
108+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
109+
# This is especially recommended for binary packages to ensure reproducibility, and is more
110+
# commonly ignored for libraries.
111+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
112+
#poetry.lock
113+
114+
# pdm
115+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
116+
#pdm.lock
117+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
118+
# in version control.
119+
# https://pdm.fming.dev/#use-with-ide
120+
.pdm.toml
121+
122+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
123+
__pypackages__/
124+
125+
# Celery stuff
126+
celerybeat-schedule
127+
celerybeat.pid
128+
129+
# SageMath parsed files
130+
*.sage.py
131+
132+
# Environments
133+
.env
134+
.venv
135+
env/
136+
venv/
137+
ENV/
138+
env.bak/
139+
venv.bak/
140+
141+
# Spyder project settings
142+
.spyderproject
143+
.spyproject
144+
145+
# Rope project settings
146+
.ropeproject
147+
148+
# mkdocs documentation
149+
/site
150+
151+
# mypy
152+
.mypy_cache/
153+
.dmypy.json
154+
dmypy.json
155+
156+
# Pyre type checker
157+
.pyre/
158+
159+
# pytype static type analyzer
160+
.pytype/
161+
162+
# Cython debug symbols
163+
cython_debug/
164+
165+
# PyCharm
166+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
167+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
168+
# and can be added to the global gitignore or merged into this file. For a more nuclear
169+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
170+
#.idea/
171+
172+
### Python Patch ###
173+
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
174+
poetry.toml
175+
176+
# ruff
177+
.ruff_cache/
178+
179+
# LSP config files
180+
pyrightconfig.json
181+
182+
# End of https://www.toptal.com/developers/gitignore/api/python

.pre-commit-config.yaml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.5.0 # Use the ref you want to point at
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-toml
8+
- id: check-yaml
9+
- id: check-added-large-files
10+
11+
12+
- repo: https://github.com/commitizen-tools/commitizen
13+
rev: v3.13.0
14+
hooks:
15+
- id: commitizen
16+
stages: [commit-msg]
17+
18+
19+
- repo: https://github.com/astral-sh/ruff-pre-commit
20+
# Ruff version.
21+
rev: v0.1.7
22+
hooks:
23+
# Run the linter.
24+
- id: ruff
25+
types_or: [ python, pyi, jupyter ]
26+
args: [ --fix ]
27+
# Run the formatter.
28+
- id: ruff-format
29+
types_or: [ python, pyi, jupyter ]
30+
31+
- repo: https://github.com/python-poetry/poetry
32+
rev: '1.7.0' # add version here
33+
hooks:
34+
- id: poetry-check
35+
- id: poetry-lock
36+
#- id: poetry-export
37+
- id: poetry-install
38+
39+
- repo: https://github.com/pre-commit/mirrors-mypy
40+
rev: 'v1.7.1' # add version here
41+
hooks:
42+
- id: mypy
43+
44+
- repo: https://github.com/PyCQA/bandit
45+
rev: '1.7.6' # add version here
46+
hooks:
47+
- id: bandit

.volumes/db/.gitkeep

Whitespace-only changes.

Dockerfile

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM python:3.11-slim
2+
3+
WORKDIR /app
4+
5+
# Install poetry
6+
RUN python3 -m pip install --upgrade pip &&\
7+
python3 -m pip install pipx &&\
8+
python3 -m pipx ensurepath &&\
9+
/bin/bash -c "source /root/.bashrc" &&\
10+
PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install poetry
11+
12+
RUN apt update && apt install parallel -y
13+
14+
15+
16+
COPY pyproject.toml poetry.lock ./
17+
18+
RUN poetry config virtualenvs.create false && \
19+
pipx install poetry && \
20+
poetry install --no-dev --no-interaction --no-ansi
21+
22+
COPY . .
23+
24+
RUN poetry install --with dev --no-interaction --no-ansi

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Commitizen
2+
3+
poetry run pre-commit install --hook-type commit-msg

docker-compose.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: "3.7"
2+
3+
services:
4+
core:
5+
build:
6+
context: .
7+
command: poetry run uvicorn app.app:app --host 0.0.0.0 --reload
8+
entrypoint: ./entrypoint.sh
9+
ports:
10+
- "8000:8000"
11+
volumes:
12+
- .:/app
13+
environment:
14+
- DB_HOST=db

entrypoint.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
ls -l
4+
5+
# Run the database migration first
6+
echo "Running database migration..."
7+
poetry run poe db-push
8+
9+
# Run the commands in parallel
10+
echo "Starting the tailwind build and the main application in the background..."
11+
parallel --ungroup ::: "poetry run poe dev-tailwind" "poetry run uvicorn app.app:app --host 0.0.0.0 --reload"

0 commit comments

Comments
 (0)