Skip to content

Commit

Permalink
Merge pull request #4 from iLevyTate/project-layout
Browse files Browse the repository at this point in the history
Refactor project layout and add docker
  • Loading branch information
iLevyTate committed Jun 28, 2023
2 parents 2abdba4 + 5a0c22b commit 82be214
Show file tree
Hide file tree
Showing 84 changed files with 7,414 additions and 375 deletions.
23 changes: 23 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/backend"
schedule:
interval: "weekly"
labels:
- skip-changelog
- dependencies
- package-ecosystem: "npm"
directory: "/frontend"
schedule:
interval: "weekly"
labels:
- skip-changelog
- dependencies
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
labels:
- skip-changelog
- dependencies
27 changes: 27 additions & 0 deletions .github/release_draft_template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name-template: "v$RESOLVED_VERSION"
tag-template: "v$RESOLVED_VERSION"
exclude-labels:
- "dependencies"
- "skip-changelog"
version-resolver:
minor:
labels:
- "breaking-change"
- "enhancement"
- "feature"
default: patch
categories:
- title: "Features"
labels:
- "feature"
- "enhancement"
- title: "Bug Fixes"
labels:
- "bug"
- title: "⚠ Breaking changes"
label: "breaking-change"
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
template: |
## Changes
$CHANGES
16 changes: 16 additions & 0 deletions .github/workflows/release_drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Release Drafter

on:
push:
branches:
- main

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
with:
config-name: release_draft_template.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
124 changes: 124 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: Testing

on:
push:
branches:
- main
pull_request:
jobs:
backend-linting:
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install just
uses: taiki-e/install-action@just
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Get full Python version
id: full-python-version
run: echo version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") >> $GITHUB_OUTPUT
- name: Install Poetry
run: |
python -m pip install pipx
pipx install poetry
- name: Configure poetry
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Cache poetry venv
uses: actions/cache@v3
id: poetry-cache
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
- name: Ensure cache is healthy
if: steps.poetry-cache.outputs.cache-hit == 'true'
shell: bash
run: timeout 10s poetry run pip --version || rm -rf .venv
- name: Install Dependencies
run: just install-backend
- name: Black check
run: just black-ci
- name: Lint with ruff
run: just ruff-ci
- name: mypy check
run: just mypy

backend-testing:
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install just
uses: taiki-e/install-action@just
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Get full Python version
id: full-python-version
run: echo version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") >> $GITHUB_OUTPUT
- name: Install Poetry
run: |
python -m pip install pipx
pipx install poetry
- name: Configure poetry
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Cache poetry venv
uses: actions/cache@v3
id: poetry-cache
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
- name: Ensure cache is healthy
if: steps.poetry-cache.outputs.cache-hit == 'true'
shell: bash
run: timeout 10s poetry run pip --version || rm -rf .venv
- name: Install Dependencies
run: just install-backend
- name: Test with pytest
run: just backend-test

frontend-linting:
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install just
uses: taiki-e/install-action@just
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Install Dependencies
run: just install-frontend
- name: Lint
run: just frontend-lint
- name: Check
run: just frontend-check

frontend-testing:
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install just
uses: taiki-e/install-action@just
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Install Dependencies
run: just install-frontend
- name: Frontend Tests
run: just frontend-test
155 changes: 155 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# OS Files
*.swp
*.DS_Store

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# editors
.idea
.vscode


### frontend

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist-ssr
coverage
*.local

test-results/
playwright-report/
36 changes: 30 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,33 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-added-large-files
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
language_version: python3
args: [--line-length=100]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.4.1
hooks:
- id: mypy
additional_dependencies: [pydantic]
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.275
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.9-for-vscode
hooks:
- id: prettier
additional_dependencies:
- prettier@2.8.0
- prettier-plugin-svelte@v2.8.1
- svelte@v3.54.0
Loading

0 comments on commit 82be214

Please sign in to comment.