Two sections start here
First, how the app decides what a visitor is allowed to see and do — the routing and guard logic that sits between every page and the data behind it. Then, how to actually serve this folder and point it at a running API.
Section 1
How the UI Is Put Together
App startup, hash-based routing, the login/admin guards that protect each route, and the shared form for the admin create/edit/delete screens.
Section 2
Running It Locally
Serving metals_ui/ with a plain static server, pointing it at the API through runtime-config.js, and the order to start everything in.
Who can see what the big picture
Three levels of access, each one strictly a superset of the one before it. The UI is what steers a visitor toward the right page, but it isn't what actually enforces any of this — that's still the API's job, exactly as covered in the Metals API tutorial.
| Visitor | Can see | Can change |
|---|---|---|
| Unauthenticated | The landing page, log in, register | Nothing — the catalog isn't shown at all |
| Customer | Elements, alloys, and coins | Nothing — browsing only |
| Admin | Everything a Customer sees, plus the admin section | Elements, alloys, coins, and other users' Admin permission |
Every route, and who's allowed on it reference
Routes live after the # in the URL, so the browser never sends them to a server — the router in js/router.js reads window.location.hash and renders a view entirely on the client.
| Route | Audience | Purpose |
|---|---|---|
| #/ | Everyone | Landing page introducing the catalog. |
| #/login | Everyone | Log in with an existing account. |
| #/register | Everyone | Create a new Customer account. |
| #/elements | Logged in | Browse and filter elements. |
| #/alloys | Logged in | Browse alloys and their compositions. |
| #/coins | Logged in | Browse coins and the alloy each was minted from. |
| #/admin | Admin | Administration landing page. |
| #/admin/elements | Admin | Create, edit, and delete elements. |
| #/admin/alloys | Admin | Create, edit, and delete alloys. |
| #/admin/coins | Admin | Create, edit, and delete coins. |
| #/admin/users | Admin | View users and grant or revoke the Admin role. |