Skip to content

Seed data ​

A fresh tenant has empty tables. The seed service in backend/seed/api.ts ships two endpoints that populate everything you need to walk through the product end-to-end.

EndpointWhat it creates
POST /seed/adminA single verified admin user, using AdminEmail / AdminPassword from local secrets.
POST /seed/fleet-south-korea20 drivers, 20 trucks and an active route board across 10 Korean cities.

Internal-only

Both endpoints are declared { expose: false }. They are not reachable from the public gateway — only from the Encore dev dashboard or encore call. This prevents anyone from triggering them in production.

Running the seeds ​

Option 1 — Encore dev dashboard ​

While encore run is up:

  1. Open http://localhost:9400.
  2. Pick the seed service from the service graph.
  3. Find seedAdmin (or seedFleetSouthKorea) in the API explorer.
  4. Click Call with an empty body.

Option 2 — encore call ​

From any terminal with the backend running:

bash
# Create the admin
encore call seed.seedAdmin --raw

# Populate 20 drivers, 20 trucks and a route board
encore call seed.seedFleetSouthKorea --raw

You should see JSON responses indicating which records were created.

What the fleet seed creates ​

  • Drivers — Minjun Kim, Seojoon Yoon, … 20 names total. Emails follow seed.kr.driver.NN@n2e.local, license numbers KR-SEED-LIC-NN.
  • Trucks — KR-SEED-TRK-01 through KR-SEED-TRK-20, mixed Hyundai / Kia / Volvo / MAN / Scania / Xcient models, VIN KRSEEDVIN1000NN.
  • Routes — a board of active and scheduled routes between Seoul, Busan, Incheon, Daegu, Daejeon, Gwangju, Suwon, Ulsan, Changwon and Jeonju.
  • Telemetry — minimal initial readings so the AI risk dashboard isn't empty.

After running both seeds, the Dashboard, Drivers, Truck Management, and Dispatch pages all light up with realistic data.

Resetting ​

The fleet seed is idempotent — it cleans up its own previous data (anything matching seed.kr.driver.% or the KR-SEED-TRK- prefix) before reinserting. You can run it as often as you like.

To wipe everything and start over:

bash
# From backend/
encore db reset auth driver truck dispatch telemetry_store
encore run
encore call seed.seedAdmin --raw
encore call seed.seedFleetSouthKorea --raw

Seeded driver password ​

Every seeded driver gets the password SeedDriver!2026. This is hard-coded in seed/api.ts and is intentional — you can sign in as any seeded driver to test the driver-facing flows.

Do not run in production

Never call these endpoints against a production environment. They wipe and re-insert specific rows. The expose: false flag protects the public gateway, but encore call against a production environment will still execute them.

N2E Fleet Management User Guide.