# Tech-Realm/starter-fullstack as a LogicPacks pack

A minimal React\u202f+\u202fVite + FastAPI starter with SQLite and a simple auth stub, runnable with one command or as a single Docker container.

Source: https://github.com/Tech-Realm/starter-fullstack at commit `7541aebaacfb`. No account needed. Everything below runs on this machine with your own agent.
A digest tells an agent what the code is; a pack also gives it the keys, the rules and the purpose to work on it safely.

## Keys this app needs

| Key | Needed | Service | Without a key |
|---|---|---|---|
| `COOKIE_SECURE` | optional | - | local mock |
| `SESSION_SECRET` | optional | - | local mock |

Ask the person for these keys first. With real keys the app runs against the real services (keys stay in the local LogicPacks vault,
the app sees placeholders). Without them it runs against a local, stateful mock with demo data.

## Run it locally

```sh
uvx logicpacks@latest add github.com/Tech-Realm/starter-fullstack --clone   # or: pipx run logicpacks add ...  (Python 3.9+)
cd starter-fullstack
# real keys (optional, hidden prompt, stored only in the local vault):  uvx logicpacks@latest key add <KEY_NAME>
./lp-mock.sh &                                    # local stateful mock for keys you don't have
./lp-run.sh <the repo's dev command>              # see LOGICPACKS.md in the clone for the exact commands
```

`logicpacks add --clone` clones the repo, writes `.env.lp` (mock keys and placeholders, never real values), points the SDKs at the
local mock (base-URL env vars, and hardcoded API URLs in the local copy only), and writes `LOGICPACKS.md` (purpose, commands,
playbooks, rules). Re-run it after adding real keys.

## More

- Purpose and how it works: https://logicpacks.io/Tech-Realm/starter-fullstack (tab "Purpose & rebuild")
- Full digest (tree + files, token-counted): https://convert.logicpacks.io/api/snapshots/se5df592ebf6/digest.txt
- Pack files as JSON: https://convert.logicpacks.io/api/repo/Tech-Realm/starter-fullstack/bundle
- The owner can add private files, env and logs, and share access: open https://logicpacks.io/Tech-Realm/starter-fullstack in a browser.

## Add a contributor (owner, one step)

`uvx logicpacks@latest invite <github-user> --repo Tech-Realm/starter-fullstack` on the owner's machine: GitHub collaborator invite with the owner's
own gh login (LogicPacks never holds a GitHub token), this pack, optional scoped keys (expiry, endpoints, limits; values stay
on the owner's machine) and an access link the contributor's agent verifies. `uvx logicpacks@latest offboard <github-user>`
removes all of it (logicpacks 1.0.22 or newer). Details: https://logicpacks.io/Tech-Realm/starter-fullstack/invite.md

## Edit this app (make your own flavour)

`uvx logicpacks@latest remix github.com/Tech-Realm/starter-fullstack` forks it to the user's GitHub (their own gh login), clones it, builds this pack
on local mocks and adds a "Remixed from Tech-Realm/starter-fullstack" credit line. The owner's keys are never shared: live services use the user's own
keys. Licence and remix count: https://logicpacks.io/Tech-Realm/starter-fullstack/edit.md

## Core logic and purpose

- Provides a minimal full‑stack starter with React + Vite frontend and FastAPI backend.
- Stores data in a local SQLite file and uses a simple email/password authentication stub.
- Development mode runs FastAPI on port 8000 and Vite on port 5173 with `/api` proxied to the backend.
- Production mode builds the UI once and serves it from the same FastAPI process on a single port (8000).
- Key modules:
  - `frontend/` – React components (`App.jsx`, `SignIn.jsx`, `Notes.jsx`), API helper (`api.js`), styling (`nova.css`).
  - `backend/main.py` – FastAPI entry point, mounts static UI, includes auth routes.
  - `backend/auth.py` – Password hashing (PBKDF2‑HMAC‑SHA256) and signed session cookie logic.
  - `backend/db.py` – SQLite connection and simple user/note tables.
  - `backend/tests/` – Unit tests for API endpoints.
  - `Dockerfile` – Multi‑stage build: UI compiled with Node, then Python runtime serving API and static files.
  - `dev.sh` / `start.sh` – Scripts to run dev and production modes.
- Intended for developers who need a quick starter to prototype full‑stack apps.
