This is a toy robot simulator web application with:
- A React + Vite frontend (robotsim.client)
- An ASP.NET Core 8 backend (RobotSim.Server)
- A 6x6 grid-based robot simulator
- Green ultra-tech UI theme with light/dark mode support
- Mobile-responsive design
- Node.js 18+ (for npm)
- .NET 8 SDK
- Visual Studio or Visual Studio Code
- Open the solution in Visual Studio
- Right-click the solution and select "Set Startup Projects"
- Select both "RobotSim.Server" and "robotsim.client" as startup projects
- Press F5 to run (will launch backend on https://localhost:7249)
cd RobotSim.Server
dotnet run
# Backend runs on http://localhost:5120 (dev mode uses HTTP to avoid SSL cert issues)cd robotsim.client
npm install
npm run dev
# Frontend runs on http://localhost:5173The Vite dev server is configured to proxy /robot/ API calls to the backend (http://127.0.0.1:5120).
A convenience PowerShell script is included at the repository root to start the backend first, verify it's healthy, then start the frontend dev server and verify it is serving the site.
Usage (from repository root):
PowerShell.exe -ExecutionPolicy Bypass -File .\start-dev.ps1The script will:
- Run
dotnet run --launch-profile httpinRobotSim.Server - Wait until
http://127.0.0.1:5120/robot/healthresponds - Run
npm run devinrobotsim.client - Wait until
http://127.0.0.1:5173/responds - Print the two URLs and keep running while both processes are active
This is the recommended way to run both services locally when you're not using Visual Studio's SPA proxy.
- Place a file named
robot.jpginrobotsim.client/public/folder - If the folder doesn't exist, create it:
robotsim.client/public/ - The image will be displayed at 120px height in the UI
- Backend HTTPS:
https://localhost:7249(from launchSettings.json) - Frontend dev:
http://localhost:5173 - Vite proxy automatically forwards
/robot/...requests to the backend
The backend has CORS enabled for the Vite dev server (http://localhost:5173) to allow API requests.
From the solution root or RobotSim.Server.Tests folder:
dotnet test ./RobotSim.Server.TestsOr from Visual Studio:
- Open Test Explorer (Test > Test Explorer)
- Run all tests in
RobotSim.Server.Tests
All 12 tests should pass (examples a-d, plus edge cases).
PLACE X,Y,DIRECTION- Place robot at (X,Y) facing NORTH|SOUTH|EAST|WESTMOVE- Move one unit forwardLEFT- Rotate 90° leftRIGHT- Rotate 90° rightREPORT- Output current position and direction
- Command input with validation hint
- Output log showing all command results with timestamps
- Command reference panel with example
- "Fill example" button to auto-fill:
PLACE 0,0,NORTH - Dark/light theme toggle
- Mobile-responsive design
- Green ultra-tech theme with neon accents
- Ensure the backend is running on https://localhost:7249
- Check that Vite proxy in
vite.config.jspoints to the correct backend URL - Verify the RobotController is present in RobotSim.Server/Controllers/
- The backend now returns detailed error messages in JSON format
- Check the browser DevTools Network tab to see full error response
- Check the Visual Studio Output window for server logs
- This has been fixed with strong CSS overrides using
!important - If still not white, clear browser cache (Ctrl+Shift+Delete) and reload
- Ensure
robot.jpgexists inrobotsim.client/public/ - The path in the HTML is
/robot.jpg(served from public folder)
- Green ultra-tech theme with neon green (#00ff88) and cyan (#00d9ff) accents
- All text is now white in dark mode with
!importantenforcements - Input and output in separate bordered panels
- Responsive grid layout (3 columns on desktop, 1 column on mobile)
- Enhanced spacing between panels (24px gap)
- Consistent font sizing throughout
- Added CORS support for Vite dev server
- Added global exception handler returning JSON errors
- All HTTP errors now include detailed messages
- Better error visibility in the frontend log
- Full HTTP error details shown in output log (status + body)
- Better error handling and response parsing
- Fill example button at top of command reference
- Improved mobile responsiveness
- Start backend: Visual Studio (F5) or
dotnet run - Start frontend:
npm run devin robotsim.client - Open http://localhost:5173 in browser
- Type commands and press Go or Enter
- Check Output Log for results
cd RobotSim.Server
dotnet publish -c Release -o ./publishcd robotsim.client
npm run build
# Output goes to dist/ folderThen copy the dist/ contents to RobotSim.Server/wwwroot/ for serving as static files.