Snapicat is a monorepo for a Worldcat OCLC workflow app: upload Excel data, search variables against the OCLC API, and generate MARC/MARCXML for cataloging. It consists of a Vite + React frontend and an Azure Functions (Python) backend that talk to the OCLC Worldcat Metadata API. The backend can also be ran as a web server through utilizing Fastapi via app.py file.
- Upload — Users upload Excel/CSV files; the app parses rows and displays them in a query table.
- Search — Rows are sent to the backend in batches; the backend builds OCLC search queries, calls the API, and returns brief-bib data (e.g. OCLC number, title, author). Results are shown alongside original data (including “retrieved” vs “original” columns).
- Process — Successful rows can be marked and moved to a “Processed” view. Processed records are stored locally (IndexedDB).
- Generate XML — From the Processed page, users can generate MARC or MARCXML for selected OCLC numbers and download a single file.
Authentication is Azure AD (Microsoft) via MSAL; the backend validates JWT and uses OCLC WSKey credentials to call the Worldcat API.
| Layer | Tech |
|---|---|
| Client | React 19, Vite 7, TypeScript, TanStack Query, MSAL (Azure AD), Dexie (IndexedDB), Tailwind CSS, shadcn-style UI |
| Server | Python 3.12, Azure Functions (or FastAPI standalone), OCLC API (OAuth + search/bibs) |
| Path | Description |
|---|---|
apps/client |
Frontend. Own package.json and node_modules. |
apps/server |
Backend. Own venv and requirements.txt. |
No NX or Turborepo; client and server are independent.
- Node.js 20.x and Yarn (for the client)
- Python 3.12 (for the server; do not use 3.10, 3.11, or 3.13+ due to grpcio compatibility)
- OCLC WSKey + secret and Azure AD app registration (tenant ID, client IDs for frontend and backend)
git clone <repo-url>
cd snapicatUse per-app env files to avoid tooling and path issues (Vite and the standalone server each load .env from their own directory; a single root .env can cause wrong paths or missing variables).
- Client:
cd apps/clientthen copyapps/client/.env.exampletoapps/client/.envand set theVITE_*variables (see docs/client.md). - Server:
- Azure Functions: copy
apps/server/local.settings.json.exampletoapps/server/local.settings.jsonand setOCLC_WSKEY,OCLC_SECRET,AZURE_CLIENT_ID,AZURE_TENANT_ID, etc. (see docs/server.md). - Standalone (app.py): copy
apps/server/.env.exampletoapps/server/.envand fill in the same variables.
- Azure Functions: copy
cd apps/client
yarn install
yarn devApp runs at http://localhost:5174 (or the port in vite.config). Point VITE_API_BASE_URL at your backend (e.g. http://localhost:8080/api).
cd apps/server
python3.12 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
func start --port 8080 --cors http://localhost:5174Functions are at http://localhost:8080/api/search_books and http://localhost:8080/api/generate_xml.
Alternatively, run the standalone FastAPI server (see docs/server.md):
cd apps/server
source venv/bin/activate
pip install -r requirements.txt
python app.py- Open the client in the browser and sign in with Azure AD (an account with the required app roles).
- Upload an Excel file on the home page.
- Run “Search” to query OCLC; results fill into the table.
- Process selected rows; they appear on the Processed page.
- On the Processed page, generate MARC/MARCXML and download.
| Doc | Contents |
|---|---|
| docs/client.md | Client setup, env vars, core logic (MSAL/auth, IndexedDB, storage, pagination), and where to make edits. |
| docs/server.md | Server setup (venv, Azure Functions, standalone), core logic (OCLC token manager, OCLC service, auth validation, APIs), and where to make edits. |
| docs/infrastructure.md | Azure components (Storage static website, Front Door/CDN, Function App, Entra ID), custom domain flow, and how they connect. |
| docs/deployment.md | CI/CD (GitHub Actions), triggers and environments, required GitHub vars/secrets, and post-deploy (CORS, custom domain, Entra redirect URIs). |
| docs/contribution.md | Branch naming, commit messages, PR guidelines, and Biome setup (client). |
Workflows: .github/workflows/deploy-client.yml and .github/workflows/deploy-server.yml.