Actix Svelte Template

Actix-web template that uses SvelteKit built and served as an embeded static files.

Features

Setup

Dev Requirements

Debug

Frontend

cd client
npm run dev

Backend

cargo run

Build

You can build the project with cargo. The build.rs will automatically compile the frontend to static files in the ./client/build directory.

cargo build --release

Create SQlite Database

Make sure that sqlx-cli was installed
cargo install sqlx-cli

Make sure database URL in environment variable
DATABASE_URL="sqlite:database.db"

Create the databae
    cargo sqlx database create

Run sql migrations
    cargo sqlx migrate run --source database/migrations

Add sql migration
    cargo sqlx migrate add <name>

Windows Service

Create service

sc.exe create "actix_example" binPath= "C:\Users\sfalcon\code\actix-svelte\target\release\actix-svelte.exe" type= own

Start Server

sc.exe start "actix_example"

Pause Server

sc.exe pause "actix_example"

Continue Server

sc.exe continue "actix_example"

Stop Actix Server

sc.exe stop "actix_example"

Delete Service

sc.exe delete "actix_example"

Top categories

svelte logo

Need a Svelte website built?

Hire a professional Svelte developer today.
Loading Svelte Themes