Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: CI workflow

on:
push:
branches: [main]
pull_request:

jobs:
backend:
name: Backend(Python)
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
steps:
- name: Download code
uses: actions/checkout@v4

- name: Set up python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: backend/requirements.txt


#update pip first and then install requirements
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r requirements.txt
pip install ruff mypy pytest


- name: Ruff(using lint)
run: ruff check .
continue-on-error: true

- name: MyPy(using type check)
run: mypy app
continue-on-error: true

- name: PyTest
run: pytest || true




frontend:
name: Frontend(Vue)
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- name: Download code
uses: actions/checkout@v4


- name: setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "24"
cache: pnpm
cache-dependency-path: frontend/pnpm-lock.yaml

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: run EsLint
run: |
pnpm exec eslint . || echo "::warning:: ESlint was skipped as not installed, add eslint and config to enable this check"
continue-on-error: true

- name: TypeCheck
run: |
pnpm exec vue-tsc --noEmit || echo "::warning:: Type check was skipped as not installed, add vue-tsc and config to enable this check"
continue-on-error: true
- name: ViTest
run: |
pnpm exec vitest run --passWithNoTests || echo "::warning:: Vitest was skipped as not installed, add vitest and config to enable this check"
continue-on-error: true

2 changes: 0 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ repos:
args: ["--explicit-package-bases", "backend"]
pass_filenames: false
additional_dependencies:
- django-stubs
- types-dj-database-url
- python-dotenv

- repo: https://github.com/psf/black-pre-commit-mirror
Expand Down
1 change: 1 addition & 0 deletions backend/app/api/v1/endpoints/health.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from fastapi import APIRouter

from app.core.config import settings

router = APIRouter()
Expand Down
5 changes: 3 additions & 2 deletions backend/app/core/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import List

from decouple import config


class Settings:
# Basic settings
PROJECT_NAME: str = "FastAPI Vue SPA Boilerplate"
Expand All @@ -19,7 +20,7 @@ class Settings:
DATABASE_URL: str = config("DATABASE_URL", default="postgresql://user:password@localhost/dbname")

# CORS
BACKEND_CORS_ORIGINS: List[str] = config(
BACKEND_CORS_ORIGINS: list[str] = config(
"BACKEND_CORS_ORIGINS",
default="http://localhost:3000,http://localhost:5173",
cast=lambda v: [i.strip() for i in v.split(",")]
Expand Down
1 change: 0 additions & 1 deletion backend/app/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from decouple import config

from app.api.v1.api import api_router
from app.core.config import settings
Expand Down
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ combine-as-imports = true

[tool.mypy]
python_version = "3.12"
plugins = ["mypy_django_plugin.main"]
explicit_package_bases = true
files = ["backend"]
ignore_missing_imports = true
Expand All @@ -29,5 +28,4 @@ warn_unused_ignores = true
warn_redundant_casts = true


[tool.django-stubs]
django_settings_module = "backend.config.settings.dev"