Skip to content

infralovers/training-cc4e-vault-web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

training-cc4e-vault-web

A minimal web client for training-cc4e-vault.

This repo is the frontend half of Module 10 in the Claude Code for Enterprise training: Build It: One Spec, Two Repos. The lab builds out a small Vault feature that touches both repos at once, walking every beat from Modules 1 to 8 in a single cross-repo task.

Stack

  • FastAPI — thin HTTP layer
  • Jinja2 — server-side templates
  • HTMX — interactive UX without a JavaScript build step
  • pytest + httpx — tests
  • uv — dependency manager (same as training-cc4e-vault)

No npm. No webpack. No Node toolchain.

Architecture

              ┌────────────────────────┐
   browser ── │  vault-web (FastAPI)   │ ── HTTP ─┐
              │  templates/, app/      │          │
              └────────────────────────┘          ▼
                                       ┌────────────────────────┐
                                       │  vault (this repo's    │
                                       │  upstream HTTP API)    │
                                       └────────────────────────┘
                                                  │
                                                  ▼
                                              notes/*.md

The web layer never touches the filesystem directly. It calls the Vault's HTTP API for every read and write. Two repos, one API contract.

Quickstart

# Get the matching Vault running on :8001
git clone --branch main https://github.com/infralovers/training-cc4e-vault
cd training-cc4e-vault
uv sync
uv run vault serve --port 8001 &
cd ..

# Run the web client on :8000
git clone --branch main https://github.com/infralovers/training-cc4e-vault-web
cd training-cc4e-vault-web
uv sync
uv run uvicorn app.main:app --reload --port 8000

Open http://localhost:8000 in your browser.

What Is Deliberately Missing

This is a training stub. The following gaps are the lab:

  • The /notes endpoint exists but only renders a hardcoded list.
  • There is no source_url field anywhere.
  • The form on the index page has no submit handler.
  • Tests are minimal; coverage is on the contract layer only.

Module 10 fills these in, step by step, across both repos.

Layout

training-cc4e-vault-web/
├── app/
│   ├── __init__.py
│   ├── main.py            # FastAPI app, routes
│   ├── vault_client.py    # Thin client for the vault HTTP API
│   └── models.py          # Pydantic models for the API contract
├── templates/
│   ├── base.html          # Jinja2 base layout
│   ├── index.html         # Home: list + new-note form
│   └── partials/
│       └── note_list.html # HTMX swap target
├── static/
│   └── styles.css         # Minimal CSS
├── tests/
│   ├── test_main.py       # Route smoke tests
│   └── test_vault_client.py
├── CLAUDE.md              # Project memory for Claude Code
├── pyproject.toml
└── README.md

License

Internal Infralovers training material. See trainings repo root for licence terms.

About

A minimal web client for the Vault. FastAPI + Jinja2 + HTMX, no JavaScript framework. Built during Module 10 of Claude Code for Enterprise as the cross-repo lab.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors