Frontend dashboard for managing trains, lines, and tracks.
The app reads the backend base URL from:
VITE_API_URL=http://localhost:3000/apiUpdate .env if your API runs on a different host or port. Keep .env.example
in sync when adding new environment variables.
pnpm install
pnpm run dev
pnpm run build
pnpm run lintBuild and run the production frontend container:
docker compose up --buildThe app is served on http://localhost:5173 by default. Override the exposed
port with FRONTEND_PORT.
Vite embeds VITE_API_URL at build time, so rebuild the image after changing
the backend URL:
VITE_API_URL=http://localhost:3000/api docker compose up --buildAxios is configured in src/api/client.ts. If the backend is unavailable, the
stores fall back to seeded local data so the UI remains usable during frontend
development.
Authentication requests use:
POST /auth/register
POST /auth/login
GET /auth/me
Register and login send:
{
"email": "user@email.com",
"password": "password123"
}Login should return:
{
"access_token": "jwt_token",
"token_type": "bearer"
}After login, the frontend calls GET /auth/me to load the authenticated user.
The JWT is stored locally and sent on protected API calls as:
Authorization: Bearer <token>