API Connection Error on Dashboard
If the MatchLogic dashboard shows a "Connection Error," fails to load projects, or displays blank panels where data should appear, the frontend cannot communicate with the backend API. This is almost always a server availability or configuration issue rather than a data problem.
1. Verify the API Is Running
The MatchLogic frontend requires the .NET backend API to be running and accessible. If the API is not running, no data will load.
To check: Open a browser and navigate to:
[API_URL]/api/HealthCheck
The default URL when running locally is http://localhost:7122/api/HealthCheck. A successful response will return a 200 status and a short message confirming the API is up. If the page fails to load or returns an error, the API is not running.
Fix: Start the MatchLogic API. If running locally, open the solution in Visual Studio and press F5, or run dotnet run from the src/MatchLogic.Api/ directory. Check the console output for any startup errors.
2. Verify the API URL Configuration
The frontend uses the NEXT_PUBLIC_API_URL environment variable to determine where to send API requests. If this is set to the wrong address, all requests will fail.
Fix: Check the .env or .env.local file in the MatchLogic frontend project root. Confirm the value matches the actual address and port where the API is running. After changing the environment variable, restart the frontend application for the change to take effect.
http://localhost:7122/api. If you are running the API on a different port or a remote server, update NEXT_PUBLIC_API_URL accordingly.
3. CORS Error in Browser Console
If you see a CORS (Cross-Origin Resource Sharing) error in the browser's developer console (usually visible in the Network or Console tab), the API is running but is blocking requests from the frontend's origin.
Fix: By default, MatchLogic allows all origins. A CORS error usually indicates a reverse proxy or load balancer is stripping or modifying headers. Verify that any intermediate proxy is forwarding the Origin header and not adding restrictive CORS headers of its own.
4. MongoDB Not Running
The API may start successfully but fail to serve requests if it cannot connect to its MongoDB database. In this case, the health check may return an error, or individual data requests will fail even though the API process is running.
Fix: Verify MongoDB is running on the configured address (default: mongodb://localhost:27017). Check the API startup logs for database connection errors. Restart MongoDB if it has stopped.
5. Firewall or Network Blocking the Port
On some machines, a local or network firewall may block port 7122 (the default API port). This can cause the frontend to be unable to reach the API even when it is running.
Fix: Add a firewall exception for port 7122, or configure the API to run on an unrestricted port and update NEXT_PUBLIC_API_URL to match.
6. Restart the API
If the API was running but has crashed or become unresponsive, restart it:
- Stop the existing process (Ctrl+C in the terminal, or stop the service).
- Check the API logs for any error that occurred before the crash.
- Fix the underlying issue if one is identified.
- Restart the API and verify the health check endpoint returns 200.
- Refresh the MatchLogic frontend.