• Stars
    star
    147
  • Rank 250,410 (Top 5 %)
  • Language
    Python
  • License
    MIT License
  • Created over 2 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Example Litestar project using Postgresql, Redis and Docker

Litestar Logo - Light Litestar Logo - Dark

Quality Gate Status Coverage Technical Debt Maintainability Rating Reliability Rating Vulnerabilities Bugs

Discord Matrix Reddit

litestar-pg-redis-docker

This is an example Litestar project using SQLAlchemy + Alembic + postgresql, Redis, SAQ and Docker.

Litestar

Litestar is a light and flexible ASGI API framework.

Litestar documentation πŸ“š

Run the application

Setup

  • $ cp .env.example .env
  • $ docker compose build
  • $ docker compose run --rm app alembic upgrade head

Run

$ docker compose up --build

Async Worker Emails

To demonstrate usage of the asynchronous SAQ workers, when an Author is created we trigger a worker function that sends an email.

mailhog is included in docker-compose.yaml, and includes a GUI that can be accessed at http://localhost:8025.

Create an Author:

$ curl -w "\n" -X POST -H "Content-Type: application/json" -d '{"name": "James Patterson", "dob": "1974-3-22"}' http://localhost:8000/v1/authors
{"id":"6f395bdf-3e77-481d-98b2-3471c2342654","created":"2022-10-09T23:18:10","updated":"2022-10-09T23:18:10","name":"James Patterson","dob":"1974-03-22"}

Then check the mailhog GUI to see the email that has been sent by the worker.

Development

Install pre-commit hooks

  • pre-commit install

Migrations

Revision

$ docker compose run --rm app alembic revision --autogenerate -m "revision description"

Migration

$ docker compose run --rm app alembic upgrade head

More Repositories

1

litestar

Production-ready, Light, Flexible and Extensible ASGI API framework | Effortlessly Build Performant APIs
Python
5,383
star
2

polyfactory

Simple and powerful factories for mock data generation
Python
1,011
star
3

litestar-fullstack

Litestar Fullstack Reference Application with React, Vite, SQLAlchemy, Docker, Task Queues, and more!
Python
308
star
4

advanced-alchemy

A carefully crafted, thoroughly tested, optimized companion library for SQLAlchemy
Python
222
star
5

awesome-litestar

A curated list of resources related to Litestar.
Makefile
67
star
6

api-performance-tests

Benchmarking Litestar vs other ASGI API framework
Python
35
star
7

fast-query-parsers

Ultra-fast query string and url-encoded form-data parsers
Rust
30
star
8

pytest-databases

Reusable database fixtures for any and all databases.
Python
18
star
9

litestar-hello-world-stale

The minimum Litestar application
Python
17
star
10

litestar-vite

Vite Plugin for Litestar
Python
16
star
11

pydantic-factories

Simple and powerful mock data generation using pydantic or dataclasses
Python
13
star
12

starlite-jwt

JWT Auth toolkit for Starlite
Python
12
star
13

pydantic-openapi-schema

Generate OpenAPI 3.x.x using Pydantic
Python
11
star
14

type-lens

Runtime type introspection utilities
Python
11
star
15

litestar-hello-world

A minimal implementation of a Litestar application
Makefile
11
star
16

dtos

Domain modelling at the edge.
Python
10
star
17

project-template

Template repository for packages belonging to the Litestar Organization
Python
9
star
18

starlite-multipart

Toolkit for working with multipart/formdata
Python
8
star
19

vite-plugin

Litestar Adapter for Vite
TypeScript
8
star
20

litestar-asyncpg

Database connection management plugin for Litestar and asyncpg
Python
7
star
21

starlite-sessions

Simple sessions authentication for Starlite
Python
6
star
22

starlite-oidc

OpenID Connect (OIDC) authentication toolkit for Starlite
Python
5
star
23

litestar-oracledb

An Oracle Database plugin for Litestar
Python
5
star
24

starlite-cli

CLI for Starlite
Python
3
star
25

litestar-fullstack-inertia

A fully-functional reference application using Litestar, Inertia JS, and Advanced Alchemy
Python
3
star
26

litestar-piccolo

Litestar plugin for the Piccolo ORM
Python
3
star
27

litestar-oidc

WIP - OIDC Implementation for Litestar applications
Python
2
star
28

litestar.dev

Source code for litestar.dev
HTML
2
star
29

starlite-websockets-hello-world

MInimal example of websockets with Starlite
Python
1
star
30

branding

Branding for the @litestar-org organization and project
CSS
1
star