Skip to content

Commit 7ad990c

Browse files
authored
Initial commit
0 parents  commit 7ad990c

34 files changed

Lines changed: 9294 additions & 0 deletions

.github/workflows/auto_deploy.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: deploy
2+
on:
3+
push:
4+
branches: ["main"]
5+
paths:
6+
- "vue-front/**"
7+
- ".github/workflows/auto_deploy.yml"
8+
env:
9+
VUE_APP_BACKEND_ROOT_ENDPOINT: ${{ vars.VUE_APP_BACKEND_ROOT_ENDPOINT }}
10+
11+
jobs:
12+
deploy:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-node@v3
17+
with:
18+
node-version: 19.x
19+
cache: "yarn"
20+
cache-dependency-path: ./vue-front/yarn.lock
21+
22+
- name: setup git auth
23+
run: |
24+
git config --global credential.helper store
25+
echo "https://${{ secrets.ACCESS_TOKEN }}:x-oauth-basic@github.com" > ~/.git-credentials
26+
git config --global user.name $user_name
27+
git config --global user.email $user_email
28+
env:
29+
user_name: "ArielMAJ"
30+
user_email: "ariel.maj@hotmail.comm"
31+
- name: deploy to gh-pages
32+
run: |
33+
cd vue-front
34+
yarn
35+
mkdir tmp
36+
cd tmp
37+
git init
38+
git remote add origin "https://github.com/${{ github.repository }}.git"
39+
git fetch origin gh-pages
40+
git checkout gh-pages
41+
find . -maxdepth 1 -type f ! -name "CNAME" -exec rm -v {} \;
42+
find . -maxdepth 1 -type d ! -name ".git" -exec rm -rv {} \;
43+
cd ..
44+
NODE_ENV=production yarn run build
45+
mv dist/* tmp
46+
cd tmp
47+
if [[ ! $(git status --porcelain) ]]; then
48+
echo "No changes to commit. Skipping deployment."
49+
exit 0
50+
fi
51+
git add -A
52+
git commit -m "🚀 Deploy id ${GITHUB_RUN_ID}"
53+
git push origin gh-pages

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.9.13

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Ariel Almeida
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. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
ifneq ("$(wildcard .env)","")
2+
include .env
3+
export
4+
endif
5+
6+
API_DIR = api
7+
VUE_FRONT_DIR = vue-front
8+
9+
MAKE_API = $(MAKE) -C $(API_DIR)
10+
MAKE_VUE_FRONT = $(MAKE) -C $(VUE_FRONT_DIR)
11+
12+
up-api:
13+
$(MAKE_API) up-api
14+
15+
up-vue:
16+
$(MAKE_VUE_FRONT) up-vue
17+
18+
install:
19+
$(MAKE_API) install
20+
$(MAKE_VUE_FRONT) install
21+
22+
pre-commit:
23+
$(MAKE_API) pre-commit
24+
25+
patch: pre-commit
26+
$(MAKE_API) patch
27+
$(MAKE_VUE_FRONT) patch
28+
29+
minor: pre-commit
30+
$(MAKE_API) minor
31+
$(MAKE_VUE_FRONT) minor

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# front-back-integration-template
2+
3+
A head start template for fullstack projects with integrated Vue front-end and FastAPI back-end.

api/.env-sample

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
APPLICATION_HOST=127.0.0.1
2+
APPLICATION_PORT=3000
3+
4+
APPLICATION_ROOT=

api/.gitignore

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

api/.pre-commit-config.yaml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
repos:
2+
- repo: https://github.com/python-poetry/poetry
3+
rev: "1.7.0"
4+
hooks:
5+
- id: poetry-check
6+
args: [--directory=api]
7+
- id: poetry-lock
8+
args: [--directory=api]
9+
- id: poetry-install
10+
args: [--directory=api]
11+
- id: poetry-export
12+
args:
13+
[
14+
--directory=api,
15+
--without-hashes,
16+
-o,
17+
requirements.txt,
18+
-f,
19+
requirements.txt,
20+
]
21+
- repo: https://github.com/pre-commit/pre-commit-hooks
22+
rev: v4.5.0
23+
hooks:
24+
- id: trailing-whitespace
25+
- id: end-of-file-fixer
26+
exclude: ^.*\.egg-info/
27+
- id: check-merge-conflict
28+
- id: check-case-conflict
29+
- id: check-json
30+
- id: check-toml
31+
exclude: tests/fixtures/invalid_lock/poetry\.lock
32+
- id: check-yaml
33+
- id: check-ast
34+
- id: debug-statements
35+
- id: check-docstring-first
36+
37+
- repo: https://github.com/psf/black
38+
rev: 23.12.0
39+
hooks:
40+
- id: black
41+
language_version: python3.11
42+
args:
43+
[
44+
--line-length=88,
45+
--target-version=py311,
46+
--exclude=\.venv/,
47+
--exclude=\.nox/,
48+
--exclude=\.tox/,
49+
--exclude=\.eggs/,
50+
--exclude=build/,
51+
--exclude=dist/,
52+
--exclude=docs/,
53+
--exclude=\.mypy_cache/,
54+
--exclude=\.pytest_cache/,
55+
--exclude=\.git/,
56+
--exclude=\.github/,
57+
--exclude=\.vscode/,
58+
--exclude=\.pyright/,
59+
--exclude=\.pylint_cache/,
60+
--exclude=\.hypothesis/,
61+
--exclude=\.mypy/,
62+
--exclude=\.coverage/,
63+
]
64+
65+
- repo: https://github.com/pycqa/flake8
66+
rev: 6.1.0
67+
hooks:
68+
- id: flake8
69+
args: [--max-line-length=88, --ignore=E203]
70+
71+
- repo: https://github.com/myint/autoflake
72+
rev: v2.2.1
73+
hooks:
74+
- id: autoflake
75+
args:
76+
[
77+
"--in-place",
78+
"--remove-all-unused-imports",
79+
"--remove-unused-variables",
80+
"--remove-duplicate-keys",
81+
".",
82+
]
83+
84+
- repo: https://github.com/pycqa/isort
85+
rev: 5.13.2
86+
hooks:
87+
- id: isort
88+
args: [--filter-files, --profile=black, --src-path=src, --gitignore]
89+
90+
- repo: https://github.com/pre-commit/mirrors-prettier
91+
rev: v4.0.0-alpha.6
92+
hooks:
93+
- id: prettier
94+
additional_dependencies:
95+
- prettier@2.8.1
96+
97+
- repo: https://github.com/pre-commit/pre-commit
98+
rev: v3.6.0
99+
hooks:
100+
- id: validate_manifest
101+
102+
- repo: https://github.com/astral-sh/ruff-pre-commit
103+
rev: v0.1.8
104+
hooks:
105+
- id: ruff
106+
107+
- repo: local
108+
hooks:
109+
- id: export-requirements
110+
name: Export requeriments.txt
111+
language: system
112+
pass_filenames: false
113+
entry: poetry export --without-hashes -o requirements.txt
114+
files: ^(pyproject\.toml|poetry\.lock)$

0 commit comments

Comments
 (0)