commit 20684655d72654650e9147d23b4c932e9a25836c Author: Ashwin Kumar Date: Mon Mar 16 22:23:58 2026 +0100 chore: bootstrap rust backend workspace and migration master plan diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..3cb6564 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,36 @@ +[workspace] +resolver = "2" +members = [ + "apps/gateway", + "apps/users", + "apps/companies", + "apps/customers", + "apps/professionals", + "apps/jobseekers", + "crates/contracts", + "crates/config", + "crates/errors", + "crates/db", + "crates/observability", + "crates/auth", +] + +[workspace.package] +edition = "2021" +license = "Proprietary" +authors = ["NXTGAUGE Team"] + +[workspace.dependencies] +anyhow = "1" +axum = "0.8" +serde = { version = "1", features = ["derive"] } +serde_json = "1" +thiserror = "2" +tokio = { version = "1", features = ["full"] } +tracing = "0.1" +tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] } +tonic = "0.12" +prost = "0.13" +sqlx = { version = "0.8", features = ["runtime-tokio-rustls", "postgres", "uuid", "chrono", "json"] } +uuid = { version = "1", features = ["serde", "v4"] } +chrono = { version = "0.4", features = ["serde"] } diff --git a/README.md b/README.md new file mode 100644 index 0000000..cf98aa7 --- /dev/null +++ b/README.md @@ -0,0 +1,18 @@ +# NXTGAUGE Backend Rust + +Rust migration target for `nxtgauge-nov-2025-backend`, preserving the same microservices and request flow. + +## Target Service Topology +- `gateway` (HTTP API) +- `users` (identity, runtime roles, onboarding, approvals) +- `companies` +- `customers` +- `professionals` +- `jobseekers` + +## Migration Policy +- Keep contracts stable (REST + proto semantics). +- Keep runtime-config and onboarding schema behavior unchanged during parity phases. +- Replace service implementations one by one. + +See `docs/MIGRATION_MASTER_PLAN.md` for full staged plan. diff --git a/docs/MIGRATION_MASTER_PLAN.md b/docs/MIGRATION_MASTER_PLAN.md new file mode 100644 index 0000000..933b678 --- /dev/null +++ b/docs/MIGRATION_MASTER_PLAN.md @@ -0,0 +1,37 @@ +# Backend Rust Migration Master Plan + +## Goal +Re-implement backend services in Rust while preserving architecture, service boundaries, data flow, and runtime behavior. + +## Current-to-Target Mapping +- NestJS gateway -> Rust gateway +- NestJS users -> Rust users +- NestJS companies -> Rust companies +- NestJS customers -> Rust customers +- NestJS professionals -> Rust professionals +- NestJS jobseekers -> Rust jobseekers + +## Hard Constraints +1. Same microservice boundaries. +2. Same role/runtime-config flow. +3. Same onboarding state transitions and schema lookup behavior. +4. Same auth/session behavior at gateway boundary. +5. No contract-breaking change unless explicitly versioned. + +## Stage Sequence +1. Freeze contracts and DB assumptions. +2. Implement Rust shared crates (`config`, `errors`, `db`, `auth`, `observability`, `contracts`). +3. Implement Rust gateway with parity adapters to existing services. +4. Migrate `users` service to Rust and switch gateway client to Rust users. +5. Migrate `companies` service to Rust. +6. Migrate `customers` service to Rust. +7. Migrate `professionals` service to Rust. +8. Migrate `jobseekers` service to Rust. +9. Remove legacy Nest services after full parity signoff. + +## Phase Exit Checklist (Apply Every Stage) +- Build passes. +- Contract tests pass. +- Runtime-config and onboarding smoke tests pass. +- No P0/P1 behavior regressions. +- Rollback path validated.