Sprintlog is also a highly adaptable and pluggable self-hosted solution designed to optimize your team's productivity and streamline agile project management.
It contains most of the boilerplate required for a production web API with features like:
Language :
- Python , Typescript ,Svelte,Tailwind
Framework
- Litestar (2.0) , Sqlalchemy , Sveltekit, TanStackQuery
Repo:
- https://git.hexcode.tech/hexcode-core/sprintlog-backend
- https://git.hexcode.tech/hexcode-core/sprintlog-frontend
Preliminary requirements tutorials for development contribution:
Backend:
- https://docs.litestar.dev/dev/tutorials/todo-app/index.html
- https://docs.litestar.dev/dev/usage/dto.html
- https://docs.litestar.dev/dev/tutorials/dto-tutorial/index.html
- https://docs.litestar.dev/dev/usage/websockets.html
- https://docs.litestar.dev/dev/usage/plugins/sqlalchemy.html
Frontend
- https://www.skeleton.dev/elements/chat
- https://tanstack.com/query/latest/docs/svelte/examples/svelte/auto-refetching
- https://flowbite.com/#components
- Latest Litestar configured with best practices
- Integration with SQLAlchemy 2.0, SAQ (Simple Asynchronous Queue), and Structlog
- Extends built-in Litestar click CLI
- Frontend integrated with ViteJS and includes Jinja2 templates that integrate with Vite websocket/HMR support
- Multi-stage Docker build using a Google Distroless (distroless/cc) Python 3.11 runtime image.
- Pre-configured user model that includes teams and associated team roles
- Examples of using guards for superuser and team-based auth.
❯ poetry run app
Usage: app [OPTIONS] COMMAND [ARGS]...
Litestar Reference Application
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────╮
│ manage Application Management Commands │
│ run Run application services. │
╰──────────────────────────────────────────────────────────────────────────────╯
❯ poetry run app manage
Usage: app manage [OPTIONS] COMMAND [ARGS]...
Application Management Commands
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────╮
│ create-database Creates an empty postgres database and │
│ executes migrations │
│ create-user Create a user │
│ export-openapi Generate an OpenAPI Schema. │
│ export-typescript-types Generate TypeScript specs from the OpenAPI │
│ schema. │
│ generate-random-key Admin helper to generate random character │
│ string. │
│ promote-to-superuser Promotes a user to application superuser │
│ purge-database Drops all tables. │
│ reset-database Executes migrations to apply any outstanding │
│ database structures. │
│ show-current-database-revision Shows the current revision for the database. │
│ upgrade Executes migrations to apply any outstanding │
│ database structures. │
╰──────────────────────────────────────────────────────────────────────────────╯
❯ poetry run app run
Usage: app run [OPTIONS] COMMAND [ARGS]...
Run application services.
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────╮
│ server Starts the application server │
│ worker Starts the background workers │
╰──────────────────────────────────────────────────────────────────────────────╯
To run the application through Uvicorn using the standard Litestar CLI, you can use the following:
❯ poetry run app run server --help
Usage: app run server [OPTIONS]
Starts the application server
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --host Host interface to listen on. Use 0.0.0.0 for all │
│ available interfaces. │
│ (TEXT) │
│ [default: 0.0.0.0] │
│ --port -p Port to bind. (INTEGER) [default: 8000] │
│ --http-workers The number of HTTP worker processes for handling │
│ requests. │
│ (INTEGER RANGE) │
│ [default: 7; 1<=x<=7] │
│ --worker-concurrency The number of simultaneous jobs a worker process │
│ can execute. │
│ (INTEGER RANGE) │
│ [default: 10; x>=1] │
│ --reload -r Enable reload │
│ --verbose -v Enable verbose logging. │
│ --debug -d Enable debugging. │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯
The above command will not start the background workers. Those can be launched separately in another terminal.
Alternately, the run-all
command will automatically start the background workers in separate processes.
❯ poetry run app run worker --help
Usage: app run worker [OPTIONS]
Starts the background workers
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --worker-concurrency The number of simultaneous jobs a worker process │
│ can execute. │
│ (INTEGER RANGE) │
│ [default: 1; x>=1] │
│ --verbose -v Enable verbose logging. │
│ --debug -d Enable debugging. │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯
Commands to help you get this repository running.
Most of the development related tasks are included in the Makefile
. To install an environment with all development packages run:
make install
This command does the following:
- install
pdm
if it is not available in the path. - create a virtual environment with all dependencies configured
- build assets to be hosted by production asset server
There is a sample .env
file located in the root of the repository.
cp .env.example .env
Note SECRET_KEY
, DATABASE_URI
, and REDIS_URL
are the most important config settings. Be sure to set this properly.
You can generate a SECRET_KEY
by running:
❯ poetry run app manage generate-random-key
KEY: 5c5f2230767976c332b6f933b63b483a35148b2218e2cdfd0da992d859feae19
You can run most of the database commands with the integrated CLI tool.
To deploy migration to the database, execute:
poetry run app manage upgrade
This command will remove any existing environment and install a new environment with the latest dependencies.
make install
This command will upgrade all components of the application at the same time. It automatically executes:
pdm upgrade
npm update
pre-commit autoupdate
make upgrade
This command will automatically execute the pre-commit process for the project.
make lint
This command is a shorthand for executing app database make-migrations
.
make migrations
This command is a shorthand for executing app database upgrade
.
make migrate
This command executes all tests for the project.
make test