{"id":14184608,"url":"https://github.com/starlite-api/starlite-pg-redis-docker","last_synced_at":"2025-08-08T04:32:12.262Z","repository":{"id":38288892,"uuid":"445305001","full_name":"litestar-org/litestar-pg-redis-docker","owner":"litestar-org","description":"Example Litestar project using Postgresql, Redis and Docker","archived":false,"fork":false,"pushed_at":"2023-11-29T06:27:31.000Z","size":1352,"stargazers_count":156,"open_issues_count":10,"forks_count":25,"subscribers_count":9,"default_branch":"main","last_synced_at":"2024-08-13T08:08:25.747Z","etag":null,"topics":["api","asgi","docker","hacktoberfest","litestar","litestar-api","litestar-framework","litestar-template","postgresql","python","redis"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/litestar-org.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":["litestar-org"],"open_collective":"litestar","custom":"https://polar.sh/litestar-org"}},"created_at":"2022-01-06T20:42:10.000Z","updated_at":"2024-08-10T04:43:08.000Z","dependencies_parsed_at":"2023-11-29T07:30:10.740Z","dependency_job_id":"42828b36-63dc-47b1-bf56-a8e3ff15bf67","html_url":"https://github.com/litestar-org/litestar-pg-redis-docker","commit_stats":null,"previous_names":["litestar-org/litestar-pg-redis-docker","starlite-api/starlite-pg-redis-docker"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litestar-org%2Flitestar-pg-redis-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litestar-org%2Flitestar-pg-redis-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litestar-org%2Flitestar-pg-redis-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litestar-org%2Flitestar-pg-redis-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/litestar-org","download_url":"https://codeload.github.com/litestar-org/litestar-pg-redis-docker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":215875670,"owners_count":15943134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","asgi","docker","hacktoberfest","litestar","litestar-api","litestar-framework","litestar-template","postgresql","python","redis"],"created_at":"2024-08-18T14:00:25.805Z","updated_at":"2024-08-18T14:01:11.454Z","avatar_url":"https://github.com/litestar-org.png","language":"Python","funding_links":["https://github.com/sponsors/litestar-org","https://opencollective.com/litestar","https://polar.sh/litestar-org"],"categories":["Starter Templates"],"sub_categories":["Full Stack"],"readme":"\u003e [!WARNING]\n\u003e This repository has not been updated recently and will be receiving some TLC.\n\u003e Please see: [Discord discussion on litestar-pg-redis-docker](https://discord.com/channels/919193495116337154/1154552571025956985/1154552571025956985)\n\u003e \n\u003e If you would like to help, feel free to discuss in Discord or open a pull request.\n\n\u003c!-- markdownlint-disable --\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/litestar-org/branding/blob/main/assets/Branding%20-%20SVG%20-%20Transparent/Logo%20-%20Banner%20-%20Inline%20-%20Light.svg#gh-light-mode-only\" alt=\"Litestar Logo - Light\" width=\"100%\" height=\"auto\" /\u003e\n  \u003cimg src=\"https://github.com/litestar-org/branding/blob/5c46ce93092faa36d0ba572f931b5d579ae75ad3/assets/Branding%20-%20SVG%20-%20Transparent/Logo%20-%20Banner%20-%20Inline%20-%20Dark.svg#gh-dark-mode-only\" alt=\"Litestar Logo - Dark\" width=\"100%\" height=\"auto\" /\u003e\n\u003c/p\u003e\n\u003c!-- markdownlint-restore --\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar-pg-redis-docker\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar-pg-redis-docker)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar-pg-redis-docker\u0026metric=coverage)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar-pg-redis-docker)\n[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar-pg-redis-docker\u0026metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar-pg-redis-docker)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar-pg-redis-docker\u0026metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar-pg-redis-docker)\n[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar-pg-redis-docker\u0026metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar-pg-redis-docker)\n[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar-pg-redis-docker\u0026metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar-pg-redis-docker)\n[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar-pg-redis-docker\u0026metric=bugs)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar-pg-redis-docker)\n\n[![Discord](https://img.shields.io/discord/919193495116337154?color=202235\u0026label=%20Discord\u0026logo=discord)](https://discord.gg/X3FJqy8d2j)\n[![Matrix](https://img.shields.io/badge/%5Bm%5D%20Matrix-bridged-blue?color=202235)](https://matrix.to/#/#litestarspace:matrix.org)\n[![Reddit](https://img.shields.io/reddit/subreddit-subscribers/litestar?label=r%2FLitestar\u0026logo=reddit)](https://reddit.com/r/litestar)\n\n\u003c/div\u003e\n\n# litestar-pg-redis-docker\n\nThis is an example [Litestar](https://github.com/litestar-api/litestar) project using SQLAlchemy + Alembic + postgresql,\nRedis, SAQ and Docker.\n\n## Litestar\n\nLitestar is a light and flexible ASGI API framework.\n\n[Litestar documentation 📚](https://litestar-api.github.io/litestar/)\n\n## Run the application\n\n### Setup\n\n- `$ cp .env.example .env`\n- `$ docker compose build`\n- `$ docker compose run --rm app alembic upgrade head`\n\n### Run\n\n`$ docker compose up --build`\n\n### Async Worker Emails\n\nTo demonstrate usage of the asynchronous `SAQ` workers, when an `Author` is created we trigger a\nworker function that sends an email.\n\n`mailhog` is included in `docker-compose.yaml`, and includes a GUI that can be accessed at\n`http://localhost:8025`.\n\nCreate an `Author`:\n\n```bash\n$ curl -w \"\\n\" -X POST -H \"Content-Type: application/json\" -d '{\"name\": \"James Patterson\", \"dob\": \"1974-3-22\"}' http://localhost:8000/v1/authors\n{\"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\"}\n```\n\nThen check the `mailhog` GUI to see the email that has been sent by the worker.\n\n## Development\n\n### Install pre-commit hooks\n\n- `pre-commit install`\n\n### Migrations\n\n#### Revision\n\n`$ docker compose run --rm app alembic revision --autogenerate -m \"revision description\"`\n\n#### Migration\n\n`$ docker compose run --rm app alembic upgrade head`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstarlite-api%2Fstarlite-pg-redis-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstarlite-api%2Fstarlite-pg-redis-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstarlite-api%2Fstarlite-pg-redis-docker/lists"}