feat: production tracker loads real order (markets/volume) + proper repo README
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,33 +1,60 @@
|
||||
# ui-0pt-app
|
||||
# 0pt — your data
|
||||
|
||||
This is a [Next.js](https://nextjs.org) project bootstrapped with [v0](https://v0.app).
|
||||
Data services on demand for the Nordics + Europe. Compose a data job, pay 50 % to start,
|
||||
watch production live, validate with full provenance, deliver anywhere. Owned by **SIAX
|
||||
Technology AB**. Honest accuracy is the moat: every field carries source, freshness and
|
||||
confidence; nothing is guessed.
|
||||
|
||||
## Built with v0
|
||||
**Live:** https://0pt.app · **Contract:** [`CLAUDE.md`](CLAUDE.md) + [`docs/`](docs/)
|
||||
|
||||
This repository is linked to a [v0](https://v0.app) project. You can continue developing by visiting the link below -- start new chats to make changes, and v0 will push commits directly to this repo. Every merge to `main` will automatically deploy.
|
||||
## Two planes (see [docs/02-architecture.md](docs/02-architecture.md))
|
||||
|
||||
[Continue working on v0 →](https://v0.app/chat/projects/prj_1WhbVElqQczWizy5KBtieIPNN3m8)
|
||||
- **Edge (Vercel, this app)** — marketing, catalog, the order lifecycle, customer portal,
|
||||
admin portal, and the API route handlers. Defers to the data engine when `ENGINE_URL` is set.
|
||||
- **Engine (`services/api`, runs on a VPS)** — FastAPI orchestrator + worker pipeline doing
|
||||
the **compliant** sourcing (official API → bulk → authorized web → licensed → else level 0).
|
||||
Never on Vercel (long jobs). Bypass/stealth/proxy-rotation/fake-account paths are excluded
|
||||
by design (CLAUDE.md §1).
|
||||
|
||||
## Getting Started
|
||||
## Routes
|
||||
|
||||
First, run the development server:
|
||||
| Area | Routes |
|
||||
|---|---|
|
||||
| Marketing | `/` (hero, filosofi, katalog, motorn, visualiseringar, täckning, editorial, bevis, priser, footer) |
|
||||
| Catalog | `/katalog`, `/katalog/[id]` |
|
||||
| Sourcing map | `/kallor` |
|
||||
| Order lifecycle | `/bestall` → `/bestall/forskott` → `/order/[id]` → `/order/[id]/validera` |
|
||||
| Customer portal | `/portal`, `/portal/subscriptions`, `/portal/files`, `/portal/integrationer`, `/portal/settings` |
|
||||
| Admin portal | `/admin`, `/admin/sources`, `/admin/jobs`, `/admin/customers` |
|
||||
| API | `/api/{health,estimates,catalog,sources,orders,orders/[id],subscriptions,admin/metrics,uploads,auth/*,payments/*,webhooks/stripe,connections/db-grant}` |
|
||||
|
||||
## Design system
|
||||
Mono/editorial, light, radius 0, Inter + JetBrains Mono, single red `#e40014`, animated grain,
|
||||
scroll-reveal motion. **No photography** — imagery is rendered data (`DataArtifact`). Every fact
|
||||
shows a provenance square (`ProvenanceBadge`). Full spec: [docs/05-design-system.md](docs/05-design-system.md).
|
||||
|
||||
## Run locally
|
||||
```bash
|
||||
npm run dev
|
||||
# or
|
||||
yarn dev
|
||||
# or
|
||||
pnpm dev
|
||||
pnpm install
|
||||
pnpm dev # Next.js on http://localhost:3000
|
||||
|
||||
# data engine (separate, optional)
|
||||
cd services/api && pip install -r requirements.txt && uvicorn orchestrator.main:app --reload
|
||||
```
|
||||
|
||||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
||||
## Deploy
|
||||
- **Frontend** → Vercel (project `0pt`, scope *Simon Axelsson's projects*), domain `0pt.app`.
|
||||
- **Engine + DB + embeds** → one VPS via [`infra/docker-compose.yml`](infra/docker-compose.yml) (Postgres+pgvector, Redis, api, worker, NocoDB, Metabase, Caddy).
|
||||
- Env inventory: [`.env.example`](.env.example).
|
||||
|
||||
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
|
||||
## Status
|
||||
Frontend, full order lifecycle, customer + admin portals, edge API, payment/auth/embed
|
||||
infrastructure, the compliant data engine, schema and infra are all in place and building green.
|
||||
Integrations are env-guarded and activate when their keys/DB are provided:
|
||||
|
||||
## Learn More
|
||||
1. **Database** — Vercel → Storage → Postgres (sets `POSTGRES_URL`) → durable persistence (schema in [`sql/001_init.sql`](sql/001_init.sql)).
|
||||
2. **Stripe + Resend** keys → payments + email.
|
||||
3. **VPS** for the engine → set `ENGINE_URL`.
|
||||
4. **`AUTH_SECRET` + `DEV_LOGIN_KEY`** → login (full OAuth via Auth.js lands with the DB).
|
||||
|
||||
To learn more, take a look at the following resources:
|
||||
|
||||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
||||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
||||
- [v0 Documentation](https://v0.app/docs) - learn about v0 and how to use it.
|
||||
© 2026 SIAX Technology AB. Not affiliated with Protosell.
|
||||
|
||||
+10
-1
@@ -35,6 +35,13 @@ export default function ProductionPage() {
|
||||
const [feed, setFeed] = useState<{ t: string; msg: string; kind: "ok" | "run" }[]>([]);
|
||||
const timer = useRef<ReturnType<typeof setInterval> | null>(null);
|
||||
const tick = useRef(0);
|
||||
const [order, setOrder] = useState<{ markets: string[]; volume: number } | null>(null);
|
||||
useEffect(() => {
|
||||
fetch(`/api/orders/${id}`)
|
||||
.then((r) => (r.ok ? r.json() : null))
|
||||
.then((o) => { if (o?.config) setOrder({ markets: o.config.markets ?? [], volume: o.config.volume ?? 0 }); })
|
||||
.catch(() => {});
|
||||
}, [id]);
|
||||
|
||||
const finish = () => {
|
||||
setProgress([100, 100, 100, 100, 100]);
|
||||
@@ -105,7 +112,9 @@ export default function ProductionPage() {
|
||||
Se det hända.
|
||||
</h1>
|
||||
<p className="reveal delay-2 mt-5 font-mono text-sm text-muted-foreground">
|
||||
Live. Källa för källa.
|
||||
{order
|
||||
? `${order.markets.join(" · ") || "—"} · ${new Intl.NumberFormat("sv-SE").format(order.volume)} poster`
|
||||
: "Live. Källa för källa."}
|
||||
</p>
|
||||
</header>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user