Please read and follow the Code of Conduct before participating in issues, pull requests, discussions, and review threads.
- Fork the repository
- Clone your fork:
git clone https://github.com/<your-github-username>/AsterDrive.git cd AsterDrive git remote add upstream https://github.com/AsterCommunity/AsterDrive.git
- Build and run:
# Frontend cd frontend-panel && bun install --frozen-lockfile && bun run build && cd .. # Backend cargo run
feat/<description>- New featuresfix/<description>- Bug fixesrefactor/<description>- Refactoringdocs/<description>- Documentation
Use conventional commits:
feat(storage): add S3 driver support
fix(auth): handle expired refresh token correctly
refactor(api): simplify error response format
docs: update API endpoint documentation
# Backend checks
cargo fmt --all -- --check
cargo check
cargo test --test test_auth
cargo clippy --workspace --all-targets --all-features -- -D warnings
# Frontend checks
cd frontend-panel
bun run check
bun run buildReplace test_auth with the integration test that covers your change. Prefer a targeted
cargo test --lib <filter> or cargo test --test <name> <filter> while iterating; run a
broader suite when the change crosses service, database, storage, or protocol boundaries.
If an OpenAPI schema changes, also run:
cargo test --features openapi --test generate_openapi
cd frontend-panel
bun run generate-api- Internal:
AsterErrorvariants exposeE001-style internal codes for logs and debugging - API:
ApiErrorCodeexposes stable string wire codes such assuccess,auth.credentials_failed, andstorage.driver_error
- All DB enum fields use
DeriveActiveEnum(UserRole, UserStatus, DriverType) - No magic strings for enum values
TokenTypeis a plain Rust enum (not stored in DB)
- Each module exports
pub fn routes()returningScopeorimpl HttpServiceFactory - Use
impl HttpServiceFactorywhen.wrap()is needed - Frontend routes registered last (SPA fallback)
{ "code": "success", "msg": "", "data": { ... } }
{ "code": "auth.credentials_failed", "msg": "Invalid Credentials" }- Type checking: TypeScript 7 native
tscwith incremental project caches - Linting:
biome, not ESLint - No TS enums (
erasableSyntaxOnly), useas constobjects - Type imports must use
import type(verbatimModuleSyntax) - shadcn/ui components use
renderprop (notasChild)
See the developer documentation and architecture overview for the current module and runtime boundaries.
By contributing, you agree that your contributions will be licensed under the MIT License.