Development Server
Start the development server with:- Backend server on
http://localhost:8080 - Vite dev server on
http://localhost:5173(for frontend assets)
Backend Only Mode
If you only need the Rust backend (no frontend):Custom Ports
Configure ports using environment variables:Project Structure
A typical Kit project structure:Development Workflow
1. Make Changes
Edit your Rust code insrc/ or React code in frontend/src/.
2. Automatic Recompilation
Kit watches for changes:- Rust changes: Recompiles automatically
- React changes: Hot module replacement (instant updates)
3. Test Your Changes
Visithttp://localhost:8080 to see your changes.
Database Development
Running Migrations
Syncing Entities
After modifying migrations, regenerate entity files:Fresh Database
Reset and re-run all migrations:Code Generation
Kit provides generators to scaffold common components:Environment Configuration
Configure your app using.env:
Debugging
Logging
Kit uses Rust’s standard logging. Enable debug output:Database Queries
Enable SQL query logging:Testing
Run your test suite:Frontend Tests
Building for Production
Build the Backend
Build the Frontend
Run Production Server
Useful Commands
| Command | Description |
|---|---|
kit serve | Start dev server |
kit serve --backend-only | Start without Vite |
kit migrate | Run migrations |
kit migrate:fresh | Reset database |
kit db:sync | Regenerate entities |
kit make:controller <name> | Create controller |
kit make:model <name> | Create model |
kit generate-types | Generate TS types |
cargo build --release | Production build |