Skip to content

Latest commit

 

History

History
90 lines (59 loc) · 1.44 KB

File metadata and controls

90 lines (59 loc) · 1.44 KB

Development

Guidance for developing and extending this Rust authentication project.

Development workflow

  1. Start by ensuring your local environment is configured and migrations are applied.
  2. Modify or add application code under src/.
  3. If you add or change database models, update migrations and schema files.
  4. Run the app locally and verify behavior.

Common commands

Build the project:

cargo build

Run the main application:

cargo run

Run the project in release mode:

cargo run --release

Run tests:

cargo test

Run linting or formatting:

cargo fmt
cargo clippy

Database development commands

Apply migrations:

cargo run --bin migrate

Create a new migration manually:

cargo run --bin makemigrations <migration_name>

List migration status:

cargo run --bin showmigrations

Open the interactive SQL shell:

cargo run --bin shell

Open a native Postgres shell:

cargo run --bin dbshell

Add a new app module

This repository includes a helper to scaffold app modules.

cargo run --bin startapp myapp

Then update the generated module with your models, handlers, and routes.

Notes

  • src/bin/startapp.rs scaffolds a new self-contained app in src/apps/<name>/ and registers it in src/apps/mod.rs.
  • Use cargo makemigrations after model changes to generate SQL migrations from src/apps/*/models.rs.