1. Set up and orient yourself
Learn which tools do what and how to open the app through its required Foundry workflow.
Tools in plain language
| Tool | Job |
|---|---|
| C# | Backend language; source files end in .cs |
| .NET SDK | Compiles C#, restores packages, runs projects/tests |
| ASP.NET Core | Web framework that accepts HTTP requests |
| Entity Framework Core (EF Core) | Connects C# objects/queries to a database |
| SQLite | Database in a local file, or in memory for some tests |
| xUnit | Defines and executes automated tests |
| Node.js | Checks JavaScript syntax and prepares Netlify assets |
| Foundry | Assigns engineering work and supervises/records execution |
| Git / GitHub | Local history / remote source hosting |
| Netlify | Hosts static frontend files, not this C# backend |
An SDK includes development tools; a runtime alone cannot build the project. Use Microsoft's .NET SDK downloads. global.json requests SDK 10.0.401, latest-patch roll-forward, and no prerelease SDKs. Installation is human bootstrap, not Foundry build evidence.
Open the checkout
On the owner's Mac:
cd /Users/anthonynarine/Desktop/django-react/miniehr
git status --short --branch
/usr/local/share/dotnet/dotnet --info
node --versionThese inspect state; they do not build/launch. If dotnet is on PATH, use dotnet --info. PATH is the list of directories the shell searches for programs.
For a fresh learning checkout:
git clone --branch agent/frontend/ehr-4-tutorial https://github.com/anthonynarine/miniehr.git
cd miniehrCloning source does not recreate Foundry's signed identity, local state worktree, sessions, or temporary preview. Read lesson 8 before governed work on another machine.
Repository map
| File/directory | Meaning |
|---|---|
MiniEHR.slnx | Solution listing related .NET projects |
Directory.Build.props | Shared project settings |
src/ | Domain, Application, Infrastructure, and Api source |
tests/ | Unit, integration, and readiness tests |
docs/foundry/ | Historical evidence and repair handoffs |
.foundry/ | Engineering configuration/control-plane integration |
AGENTS.md | Repository operating rules |
A .csproj configures one project; a solution groups projects. Shared settings target net10.0, enable nullable analysis and implicit imports, and treat warnings as errors. bin/ and obj/ are generated output ignored by Git.
Use the working Foundry preview
The default sibling CLI currently rejects this project's newer tests config. The observed working preview uses this source path:
export PYTHONPATH=/private/tmp/miniehr-foundry-preview-a03d4a3/tree/src
MINIEHR_FOUNDRY_PYTHON=/Users/anthonynarine/Desktop/django-react/foundry/.venv/bin/python
"$MINIEHR_FOUNDRY_PYTHON" -m foundry status
"$MINIEHR_FOUNDRY_PYTHON" -m foundry recover
"$MINIEHR_FOUNDRY_PYTHON" -m foundry task show EHR-4-m foundry runs the Python module for the engineering tool; the EHR remains C#. If that temporary directory is gone, arrange a reviewed replacement rather than silently loading an incompatible CLI. The paths are specific to this Mac.
Launch the functional local app
Run the following as the human owner in an interactive terminal, after checking EHR-4/frontend is launchable and its assigned checkout contains the intended candidate. Review the exact invocation before signing:
PYTHONPATH=/private/tmp/miniehr-foundry-preview-a03d4a3/tree/src \
/Users/anthonynarine/Desktop/django-react/foundry/.venv/bin/python -m foundry \
run EHR-4 frontend --isolation none --timeout-minutes 20 -- \
/usr/local/share/dotnet/dotnet run --project src/MiniEHR.Api \
--urls http://127.0.0.1:5080 \
--ConnectionStrings:MiniEHR 'Data Source=/private/tmp/miniehr-frontend-synthetic.db'Foundry requires the owner's signature for this host-isolation override. The agent cannot sign it. A previous agent attempt was denied; no running process is assumed. If the state/assignment changed, inspect it and arrange the runtime rather than bypassing Foundry with a direct dotnet run.
--isolation none means logical host isolation, not a container. The timeout is 20 minutes. The synthetic database sits outside the publish directory. ASP.NET applies pending migrations at startup, serves static files and API routes, and seeds no patients.
Confirm an actual running Foundry runtime and inspect its recorded logs. Open http://127.0.0.1:5080/, then check:
curl -i http://127.0.0.1:5080/healthExpected: HTTP 200 and {"status":"ready"}. Connection refused means no reachable server on that port. A page loading alone does not prove database readiness. Retain the runtime ID; use Foundry runtime controls/logs to stop or investigate it.
Checkpoint
Why can local ASP.NET register a patient while the Netlify preview cannot? The local process executes C# and connects to SQLite; the preview only hosts files.
Next: C# basics.