template-axum-solidjs-spa
template-axum-solidjs-spa copied to clipboard
Full-stack SPA template using SolidJS, TypeScript, and Tailwind. Backed by Rust with Axum and PostgreSQL.
Template: Axum / SolidJS SPA
Backend
Frontend
Getting Started
- Clone the repository:
git clone https://github.com/robertwayne/template-axum-solidjs-spa - Change
.env.TEMPLATEto.envand set your Postgres credentials (if not using defaults). - Install your dependencies with
bun i. - Build the client with
bun run buildfrom inside the/clientdirectory. Alternatively, you can usebun run devto run the client with the vite dev server. - Run the server with
cargo runfrom inside the/serverdirectory.- If you're serving from axum, visit
http://127.0.0.1:3000. - If you're serving from vite, visit
http://127.0.0.1:8000.
- If you're serving from axum, visit
Client Notes
- Async, naive prefetching for route links.
- Light/Dark mode themes built-in.
- Responsive navigation menu built-in.
Server Notes
- Sets default Cache-Control headers via a middleware function.
- Uses tower-http CORS and Compression (brotli) middleware.
Additional Scripts
| Command | Action |
|---|---|
| ./update.sh | Updates the dependencies of both the client and server projects. |