Skip to content

jdevries3133/ptal_stack

Repository files navigation

PTAL Stack

PostgreSQL, Tauri, Actix Web, Leptos. Also, Tailwind CSS and SQLx.

Running the Desktop Client

cd client-tauri; cargo tauri dev

Running the Actix Web Backend

cargo run --bin server

Running them Concurrently

You can run each concurrently in the same terminal with runcc.

You can also use cargo-watch to "live-reload" the actix web server.

cargo install runcc watch
cargo runcc \
  'cd client-tauri; cargo tauri dev' \
  'cargo watch -x "run --bin server"' \
  'make tailwind-dev'

Makefile

There is also a Makefile for setting up and tearing down a local PostgreSQL container in docker. The intention is for dev databases to be ephemeral, and for you to maintain the ./init.sql script to setup tables and mock data as necessary.

Make Rule Description
build (default) Build everything!
start-db Start a PostgreSQL instance on localhost:5432 inside Docker using the Docker CLI
stop-db Stop and destroy the PostgreSQL database
reset-db stop-db, start-db; do this after every change to initdb.sql
watch-db Stream the database logs to your console
tailwind-dev Run tailwind codegen CLI in development ("watch") mode
tailwind-build Build the minified tailwind CSS file

There is also a make dev rule to do the steps mentioned in runninig them concurrently.

.env

There is an env-template file. Out of the box, you can just cp env-template .env and get started. It contains credentials for your local PostgreSQL database, but if you use make start-db to spin up a local PostgreSQL instance inside Docker, it'll be initialized with the same boilerplate variables we provide in the env-template.

Tailwind

There are make rules for tailwind; you shouldn't have to think about this at all. You may customize the tailwind config file at the root of this repo.

About

PTAL: PostgreSQL, Tauri, Actix Web, and Leptos

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published