Skip to content

Commit

Permalink
Merge branch 'main' into usage-more-usage-more-usage-more
Browse files Browse the repository at this point in the history
  • Loading branch information
cofin authored May 31, 2024
2 parents cf020de + 037147a commit dd26a4d
Show file tree
Hide file tree
Showing 79 changed files with 2,259 additions and 2,305 deletions.
4 changes: 2 additions & 2 deletions .env.docker.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SECRET_KEY='secret-key'
LITESTAR_DEBUG=true
LITESTAR_HOST=0.0.0.0
LITESTAR_PORT=8000
APP_URL=http://localhost:8000
APP_URL=http://localhost:${LITESTAR_PORT}

LOG_LEVEL=10
# Database
Expand All @@ -23,7 +23,7 @@ SAQ_WEB_ENABLED=True
SAQ_BACKGROUND_WORKERS=1
SAQ_CONCURRENCY=1

VITE_HOST="localhost"
VITE_HOST=localhost
VITE_PORT=3006
VITE_HOT_RELOAD=True
VITE_DEV_MODE=True
Expand Down
4 changes: 2 additions & 2 deletions .env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SECRET_KEY='secret-key'
LITESTAR_DEBUG=true
LITESTAR_HOST=0.0.0.0
LITESTAR_PORT=8089
APP_URL=http://localhost:8089
APP_URL=http://localhost:${LITESTAR_PORT}

LOG_LEVEL=10
# Database
Expand All @@ -23,7 +23,7 @@ SAQ_WEB_ENABLED=True
SAQ_BACKGROUND_WORKERS=1
SAQ_CONCURRENCY=1

VITE_HOST="localhost"
VITE_HOST=localhost
VITE_PORT=5174
VITE_HOT_RELOAD=True
VITE_DEV_MODE=False
14 changes: 2 additions & 12 deletions .env.testing
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
# App
APP_SECRET_KEY='secret-key'
APP_DEBUG=true
APP_DEV_MODE=false
APP_ENVIRONMENT=testing
LOG_LEVEL=20
APP_NAME=Starlite Application
OPENAPI_CONTACT_EMAIL=admin@app
OPENAPI_CONTACT_NAME="Administrator"
OPENAPI_TITLE="Reference Application for Starlite"
OPENAPI_VERSION=1.0.0
DB_URL=postgresql+asyncpg://postgres:[email protected]:5423/postgres
SECRET_KEY='secret-key'

# Cache
REDIS_URL=redis://localhost:6397/0
Expand All @@ -19,7 +9,7 @@ SAQ_WEB_ENABLED=True
SAQ_BACKGROUND_WORKERS=1
SAQ_CONCURRENCY=1

VITE_HOST="localhost"
VITE_HOST=localhost
VITE_PORT=3006
VITE_HOT_RELOAD=True
VITE_DEV_MODE=True
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ on:
push:
branches:
- main
concurrency:
group: test-${{ github.head_ref }}
cancel-in-progress: true

env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"
jobs:
validate:
runs-on: ubuntu-latest
Expand All @@ -18,6 +24,9 @@ jobs:
with:
python-version: "3.11"

- name: Install base libraries
run: pip install nodeenv cython setuptools pip --upgrade --quiet --user

- uses: pre-commit/[email protected]

test:
Expand All @@ -26,7 +35,7 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.11"]
python-version: ["3.11","3.12"]
steps:
- name: Check out repository
uses: actions/checkout@v4
Expand All @@ -43,7 +52,7 @@ jobs:
name: Set up PDM
with:
python-version: ${{ matrix.python-version }}
allow-python-prereleases: true
allow-python-prereleases: false
cache: true
cache-dependency-path: |
./pdm.lock
Expand All @@ -58,7 +67,8 @@ jobs:
- name: Test with Coverage
run: pdm run pytest tests --cov=app --cov-report=xml

- uses: actions/upload-artifact@v4
- if: matrix.python-version == '3.11'
uses: actions/upload-artifact@v4
with:
name: coverage-xml
path: coverage.xml
Expand All @@ -81,7 +91,7 @@ jobs:
name: Set up PDM
with:
python-version: "3.11"
allow-python-prereleases: true
allow-python-prereleases: false
cache: true

- name: Install dependencies
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ temp/
# built files from the web UI
src/app/domain/web/public
src/app/domain/web/public/hot
public
.vite
src/app/domain/web/static
public/hot
Expand Down
15 changes: 8 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-ast
- id: check-case-conflict
Expand All @@ -11,7 +11,7 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.2.2
rev: v0.4.6
hooks:
- id: ruff
args:
Expand All @@ -22,24 +22,25 @@ repos:
- id: prettier
exclude: templates|migrations|scripts|docs|dist|.venv|public
- repo: https://github.com/ariebovenberg/slotscheck
rev: v0.17.3
rev: v0.19.0
hooks:
- id: slotscheck
exclude: test_*|docs|migrations|scripts
entry: env PYTHONPATH=src slotscheck
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
rev: v1.10.0
hooks:
- id: mypy
exclude: scripts/
additional_dependencies:
- passlib[argon2]
- asyncpg
- asyncpg-stubs
- litestar[cli,jinja,jwt,redis,sqlalchemy,standard,structlog]
- litestar-vite
- litestar[jinja,jwt,redis,structlog]
- advanced-alchemy[uuid]>=0.10.0
- litestar-granian
- litestar-vite>=0.1.21
- litestar-saq
- types-freezegun
- types-python-jose
- types-click
- types-redis
Expand Down
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"christian-kohler.path-intellisense",
"ms-python.vscode-pylance",
"ms-python.python",
"charliermarsh.ruff"
"charliermarsh.ruff",
"ms-python.mypy-type-checker"
]
}
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
| --------- | :-- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| CI/CD | | [![Tests and Linting](https://github.com/litestar-org/litestar-fullstack/actions/workflows/ci.yaml/badge.svg)](https://github.com/litestar-org/litestar-fullstack/actions/workflows/ci.yaml) [![Documentation Building](https://github.com/litestar-org/litestar-fullstack/actions/workflows/docs.yaml/badge.svg)](https://github.com/litestar-org/litestar-fullstack/actions/workflows/docs.yaml) |
| Quality | | [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar-fullstack&metric=coverage)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar-fullstack&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar-fullstack&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar-fullstack&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar-fullstack&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar) |
| Community | | [![Reddit](https://img.shields.io/reddit/subreddit-subscribers/litestarapi?label=r%2FLitestar&logo=reddit&labelColor=202235&color=edb641&logoColor=edb641)](https://reddit.com/r/litestarapi) [![Discord](https://img.shields.io/discord/919193495116337154?labelColor=202235&color=edb641&label=chat%20on%20discord&logo=discord&logoColor=edb641)](https://discord.gg/litestar-919193495116337154) [![Matrix](https://img.shields.io/badge/chat%20on%20Matrix-bridged-202235?labelColor=202235&color=edb641&logo=matrix&logoColor=edb641)](https://matrix.to/#/#litestar:matrix.org) [![Medium](https://img.shields.io/badge/Medium-202235?labelColor=202235&color=edb641&logo=medium&logoColor=edb641)](https://blog.litestar.dev) [![Twitter](https://img.shields.io/twitter/follow/LitestarAPI?labelColor=202235&color=edb641&logo=twitter&logoColor=edb641&style=flat)](https://twitter.com/LitestarAPI) [![Blog](https://img.shields.io/badge/Blog-litestar.dev-202235?logo=blogger&labelColor=202235&color=edb641&logoColor=edb641)](https://blog.litestar.dev) |
| Community | | [![Reddit](https://img.shields.io/reddit/subreddit-subscribers/litestarapi?label=r%2FLitestar&logo=reddit&labelColor=202235&color=edb641&logoColor=edb641)](https://reddit.com/r/litestarapi) [![Discord](https://img.shields.io/discord/919193495116337154?labelColor=202235&color=edb641&label=chat%20on%20discord&logo=discord&logoColor=edb641)](https://discord.gg/litestar) [![Matrix](https://img.shields.io/badge/chat%20on%20Matrix-bridged-202235?labelColor=202235&color=edb641&logo=matrix&logoColor=edb641)](https://matrix.to/#/#litestar:matrix.org) [![Medium](https://img.shields.io/badge/Medium-202235?labelColor=202235&color=edb641&logo=medium&logoColor=edb641)](https://blog.litestar.dev) [![Twitter](https://img.shields.io/twitter/follow/LitestarAPI?labelColor=202235&color=edb641&logo=twitter&logoColor=edb641&style=flat)](https://twitter.com/LitestarAPI) [![Blog](https://img.shields.io/badge/Blog-litestar.dev-202235?logo=blogger&labelColor=202235&color=edb641&logoColor=edb641)](https://blog.litestar.dev) |
| Meta | | [![Litestar Project](https://img.shields.io/badge/Litestar%20Org-%E2%AD%90%20Litestar-202235.svg?logo=python&labelColor=202235&color=edb641&logoColor=edb641)](https://github.com/litestar-org/litestar) [![types - Mypy](https://img.shields.io/badge/types-Mypy-202235.svg?logo=python&labelColor=202235&color=edb641&logoColor=edb641)](https://github.com/python/mypy) [![License - MIT](https://img.shields.io/badge/license-MIT-202235.svg?logo=python&labelColor=202235&color=edb641&logoColor=edb641)](https://spdx.org/licenses/) [![Litestar Sponsors](https://img.shields.io/badge/Sponsor-%E2%9D%A4-%23edb641.svg?&logo=github&logoColor=edb641&labelColor=202235)](https://github.com/sponsors/litestar-org) [![linting - Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json&labelColor=202235)](https://github.com/astral-sh/ruff) [![code style - Black](https://img.shields.io/badge/code%20style-black-000000.svg?logo=python&labelColor=202235&logoColor=edb641)](https://github.com/psf/black) [![All Contributors](https://img.shields.io/github/all-contributors/litestar-org/litestar?labelColor=202235&color=edb641&logoColor=edb641)](#contributors-) |

<!-- prettier-ignore-end -->
Expand Down Expand Up @@ -63,6 +63,14 @@ pdm run stop-infra
docker compose up
```

### Details

We have documented the process to help you get the repository up and running.
Check out the [documentation][docs] for more information.

[//]: # "links"
[docs]: https://docs.fullstack.litestar.dev/

<details>

<summary>Command Examples</summary>
Expand Down Expand Up @@ -291,11 +299,3 @@ Loading environment configuration from .env
╰──────────────────────────────────────────────────────────────────────────────╯
```
### Details
We have documented the process to help you get the repository up and running.
Check out the [documentation][docs] for more information.
[//]: # "links"
[docs]: https://docs.fullstack.litestar.dev/
1 change: 1 addition & 0 deletions deploy/docker/dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ COPY pyproject.toml pdm.lock README.md .pre-commit-config.yaml LICENSE Makefile
tailwind.config.cjs postcss.config.cjs components.json \
./
COPY scripts ./scripts/
COPY public ./public/
COPY resources ./resources/
RUN python -m venv --copies /workspace/app/.venv \
&& /workspace/app/.venv/bin/pip install cython pdm nodeenv \
Expand Down
1 change: 1 addition & 0 deletions deploy/docker/run/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ COPY pyproject.toml pdm.lock README.md .pre-commit-config.yaml LICENSE Makefile
tailwind.config.cjs postcss.config.cjs components.json \
./
COPY scripts ./scripts/
COPY public ./public/
COPY resources ./resources/
RUN python -m venv --copies /workspace/app/.venv \
&& /workspace/app/.venv/bin/pip install --quiet pdm nodeenv cython \
Expand Down
1 change: 1 addition & 0 deletions deploy/docker/run/Dockerfile.distroless
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ COPY pyproject.toml pdm.lock README.md .pre-commit-config.yaml LICENSE Makefile
RUN python -m venv --copies /workspace/app/.venv \
&& /workspace/app/.venv/bin/pip install --quiet pdm nodeenv cython mypy
COPY scripts ./scripts/
COPY public ./public/
COPY resources ./resources/
RUN pdm install ${PDM_INSTALL_ARGS} --no-self \
&& pdm export ${PDM_INSTALL_ARGS} --without-hashes --prod --output=requirements.txt
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ x-development-volumes: &development-volumes
- ./tsconfig.json:/workspace/app/tsconfig.json
- ./tsconfig.node.json:/workspace/app/tsconfig.node.json
- ./package.json:/workspace/app/package.json
- ./package-lock.json:/workspace/app/package-lock.json
- ./vite.config.ts:/workspace/app/vite.config.ts
- ./resources:/workspace/app/resources
- ./public:/workspace/app/public
- ./components.json:/workspace/app/components.json
- ./tailwind.config.cjs:/workspace/app/tailwind.config.cjs
- ./postcss.config.cjs:/workspace/app/postcss.config.cjs
Expand Down
7 changes: 4 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@ and as a reference for how to build a large scale fullstack Litestar application
You can take pieces as needed, or use the entire thing as a starting point for your project.
It includes the following capabilities out of the box:

.. seealso:: It is built on the `Litestar <https://litestar.dev>`_, VueJS, `Vite <https://vitejs.dev/>`_,
.. seealso:: It is built on the `Litestar <https://litestar.dev>`_, ReactJS, `Vite <https://vitejs.dev/>`_,
:doc:`SAQ <saq:index>`, `TailwindCSS <https://tailwindcss.com/>`_ and comes with great features to reference:

- User creation, authentication, and authorization
- Job/Task Queues via :doc:`SAQ <saq:index>`
- Fully featured frontend stack with VueJS and native Vite integration via
- Fully featured frontend stack with ReactJS (supports Vue, Angular, and all other JS frameworks) and native Vite integration via
the `litestar-vite <https://github.com/cofin/litestar-vite>`_ plugin
- Fully featured backend API with Litestar
- Includes the utilization of :doc:`Guards <litestar:usage/security/guards>` and team-based authentication,
- Extensive CLI
- Advanced logging with :doc:`structlog <structlog:index>`
- SQLAlchemy ORMs, inlcuding the :doc:`Advanced Alchemy <advanced-alchemy:index>` helper library by `Jolt <https://jolt.rs>`_
- SQLAlchemy ORMs, including the :doc:`Advanced Alchemy <advanced-alchemy:index>` helper library by `Jolt <https://jolt.rs>`_
- UUIDv7 based Primary Keys using `uuid-utils`
- AioSQL for raw queries without the ORM
- Alembic migrations
- Dockerized development and production environments
Expand Down
Loading

0 comments on commit dd26a4d

Please sign in to comment.