A production-ready template for building modern web applications with a Rust (Axum) backend and a Vue.js (Vite) frontend.
- Backend: Rust with Axum
- Frontend: Vue.js with Vite and TypeScript
- Database: PostgreSQL (with
sqlx
) - Styling: Tailwind CSS
This repository is a monorepo containing two main packages:
/backend
: The Rust (Axum) API server./frontend
: The Vue.js (Vite) client-side application.
Before you begin, ensure you have the following installed on your system:
- Rust: Install Rust and Cargo
- Node.js and npm: Install Node.js (npm is included)
This project is a monorepo. You will need to install dependencies for the root, the backend, and the frontend.
-
Clone the repository:
git clone <your-new-repository-url> cd <your-project-name>
-
Install Root Dependencies: This installs
concurrently
, the tool used to run both servers at once.npm install
-
Set up the Backend (Axum): Navigate to the backend directory and build the project to download and compile all necessary crates.
cd backend cargo build cd ..
-
Set up the Frontend (Vue): Navigate to the frontend directory and install the npm packages.
cd frontend npm install cd ..
The backend requires environment variables to run.
- Navigate to the
backend
directory. - Create a
.env
file by copying the example file:cp .env.example .env
- Edit the new
.env
file and fill in your local configuration values (e.g., your database password and a newJWT_SECRET
).
To run the entire application for local development, you can use a single command from the project's root directory.
-
Run the Development Server: Make sure you are in the project's root directory.
npm run dev
This command uses
concurrently
to start both the Axum backend API and the Vue frontend development server in the same terminal. -
Access the application: Open your web browser and navigate to the frontend URL:
http://localhost:5173
. The Vue application will automatically communicate with the Axum API.
If you'd like to contribute to this template, please fork the repository and create a pull request.
This project is licensed under the MIT License. See the LICENSE
file for details.