template-axum-react-spa Tailwind Templates

Template Axum React Spa

Full-stack SPA template using React, TypeScript, and Tailwind. Backed by Rust with Axum and PostgreSQL.

Template: Axum + React SPA

Backend

Frontend

Getting Started

  1. Clone the repository: git clone https://github.com/robertwayne/template-axum-react-spa
  2. Change .env.TEMPLATE to .env and set your Postgres credentials (if not using defaults).
  3. Run the server with cargo run from inside the /server directory.
  4. You should build the client initially with pnpm run build from inside the /client directory. After that, you can use pnpm run dev for hot reloading.
  5. If you're serving from the server, visit http://127.0.0.1:3000 in your browser. If you're using npm dev, visit http://127.0.0.1:8000 in your browser.

Client Notes

  • Async, naive prefetch route links by default.
  • Scripts use pnpm by default.

Server Notes

  • Caches static files by default: HTML, CSS, JS, WEBP, SVG, and WOFF2.
  • Uses tower-http CORS, Compression (gzip by default), and CSP middleware.

GitHub Action Notes

  • Runs (client) tests, eslint, tsc, and prettier on PRs.
  • Runs dependabot weekly. You can manually run combine to squish all dependabot PRs into one PR.
  • Server tests/formatting are not run on PR (yet).

Additional Scripts

Command Action
./update.sh Updates the dependencies of both the client and server projects.

Top categories

Loading Svelte Themes