README.md 2.15 KB

Robot Production System Backend

.NET 8 ASP.NET Core Web API for the robot production frontend mocks. The API uses PostgreSQL, EF Core Code First migrations, JWT Bearer authentication, and camelCase JSON.

Requirements

  • .NET SDK 8
  • Docker or an available PostgreSQL instance

Local PostgreSQL

The included Compose file exposes PostgreSQL on host port 55432 to avoid collisions with an existing local PostgreSQL on 5432.

docker-compose up -d postgres

Development connection string:

Host=localhost;Port=55432;Database=robot_production_system;Username=robot;Password=robot

The base appsettings.json keeps a conventional 5432 connection string for non-development overrides. In deployment, override ConnectionStrings__DefaultConnection.

Migrations

The repo includes a local EF tool manifest.

dotnet tool restore
dotnet restore
dotnet build
dotnet ef database update --project src/RobotProductionSystem.Api --startup-project src/RobotProductionSystem.Api

In Development, the app also applies migrations and runs idempotent seed data on startup.

Run

dotnet run --project src/RobotProductionSystem.Api

The generated launch profile currently listens on http://localhost:5021. Check the console output for the exact URL.

Frontend Integration

Set the frontend runtime API base to the backend URL, for example:

NUXT_PUBLIC_API_BASE=http://localhost:5021

Routes are available both with and without /api:

  • /auth/login and /api/auth/login
  • /work-orders and /api/work-orders
  • /sn, /operations, /dashboard/overview, /settings/*, /customers, /mails, /notifications

Default accounts:

  • admin / 123456 with roles admin, qa_manager
  • operator / 123456 with role operator

Settings password seed:

  • 12345678

Smoke Checks

curl -s -X POST http://localhost:5021/auth/login \
  -H 'Content-Type: application/json' \
  -d '{"username":"admin","password":"123456"}'

curl -s http://localhost:5021/base-info/device-types
curl -s 'http://localhost:5021/dashboard/overview?line=L1-%E8%A3%85%E9%85%8D%E7%BA%BF'
curl -s http://localhost:5021/dashboard/overview/export