Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ PureFreshMilk keeps an exact record of a household's daily milk deliveries: who
and which mornings the milk didn't come. Monthly totals, charges, payments and outstanding
balances come next.

> **Project status: foundation.** The repository structure, architecture and tooling are in place.
> The **Today** screen is a working visual prototype on **synthetic demo data**. Nothing is saved
> yet, and billing, accounts and persistence are not implemented.
> **Project status: daily recording works locally.** With the API and PostgreSQL running, you can
> set up a household, manage recipients and milk prices, record deliveries, and review past days.
> Without an API address, Today and Recipients show clearly labelled synthetic demo data.
> Billing and accounts are not implemented yet.
> See [what is not implemented yet](docs/architecture/overview.md#what-is-not-implemented-yet).

## Tech stack
Expand Down Expand Up @@ -54,7 +55,9 @@ npm run dev # http://localhost:3000
```bash
cp .env.example .env # set POSTGRES_PASSWORD
docker compose up -d --wait # PostgreSQL on localhost:5432
bash scripts/migrate-db.sh # apply both migrations (or: pwsh scripts/migrate-db.ps1)
bash scripts/run-api.sh # API on http://localhost:5080 (or: pwsh scripts/run-api.ps1)
# in a second terminal:
cd apps/web && cp .env.example .env.local && npm run dev
```

Expand Down
100 changes: 50 additions & 50 deletions apps/web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"dependencies": {
"clsx": "^2.1.1",
"lucide-react": "^1.64.0",
"next": "16.4.3",
"next": "16.4.6",
"react": "19.3.1",
"react-dom": "19.3.1",
"tailwind-merge": "^3.7.0"
Expand All @@ -39,7 +39,7 @@
"@types/react-dom": "^19.3.0",
"@vitejs/plugin-react": "^6.1.2",
"eslint": "^9.39.5",
"eslint-config-next": "16.4.3",
"eslint-config-next": "16.4.6",
"jsdom": "^30.1.3",
"prettier": "^3.9.10",
"tailwindcss": "^4.3.3",
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/(auth)/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function LoginPage() {
href="/app/today"
className="font-semibold text-accent underline-offset-4 hover:underline"
>
try the Today screen with demo data
open the Today screen
</Link>
</p>
</>
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/(auth)/signup/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function SignupPage() {
href="/app/today"
className="font-semibold text-accent underline-offset-4 hover:underline"
>
try the Today screen with demo data
open the Today screen
</Link>
</p>
</>
Expand Down
14 changes: 14 additions & 0 deletions apps/web/src/app/app/history/[date]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { Metadata } from "next";
import { notFound } from "next/navigation";
import { ConnectedDayScreen } from "@/features/today/connected-day-screen";
import { isIsoDate } from "@/lib/dates";

export const metadata: Metadata = { title: "Day record" };
// The date is a request-time route parameter; this page renders when navigated to.
export const instant = false;

export default async function DayRecordPage({ params }: { params: Promise<{ date: string }> }) {
const { date } = await params;
if (!isIsoDate(date)) notFound();
return <ConnectedDayScreen date={date} />;
}
20 changes: 2 additions & 18 deletions apps/web/src/app/app/history/page.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
import type { Metadata } from "next";
import { History } from "lucide-react";
import { PageHeader } from "@/components/layout/page-header";
import { PlaceholderPanel } from "@/components/ui/placeholder-panel";
import { HistoryScreen } from "@/features/history/history-screen";

export const metadata: Metadata = { title: "History" };

export default function HistoryPage() {
return (
<>
<PageHeader title="History" />
<PlaceholderPanel
icon={History}
title="History isn't built yet"
description="Past days will appear here once deliveries are saved to your household's record."
planned={[
"Every recorded day, newest first",
"Payments shown alongside deliveries",
"The balance outstanding at the end of each month",
]}
/>
</>
);
return <HistoryScreen />;
}
4 changes: 2 additions & 2 deletions apps/web/src/app/app/settings/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ export default function SettingsPage() {
<HouseholdSettings />
<PlaceholderPanel
icon={CalendarOff}
title="Delivery days and pauses aren't built yet"
title="Delivery pauses aren't built yet"
description="This is where days without deliveries, such as a trip away, will be managed."
planned={["Delivery days and pauses"]}
planned={["Delivery pauses"]}
/>
<ApiStatusCard />
</div>
Expand Down
11 changes: 8 additions & 3 deletions apps/web/src/app/app/today/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import type { Metadata } from "next";
import { TodayScreen } from "@/features/today/today-screen";
import { ConnectedDayScreen } from "@/features/today/connected-day-screen";
import { DEMO_RECIPIENTS } from "@/lib/demo-household";
import { getApiBaseUrl } from "@/services/api-client";

export const metadata: Metadata = { title: "Today" };

// Demo data for now. When persistence lands, this page will load the household's
// recipients and today's entries from the API instead.
// Without an API address, the explicitly labelled demo remains available.
export default function TodayPage() {
return <TodayScreen recipients={DEMO_RECIPIENTS} />;
return getApiBaseUrl() ? (
<ConnectedDayScreen date="today" />
) : (
<TodayScreen recipients={DEMO_RECIPIENTS} />
);
}
2 changes: 1 addition & 1 deletion apps/web/src/components/layout/site-footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Link from "next/link";
import { BrandMark } from "./brand";

const links = [
{ href: "/app/today", label: "Today (demo)" },
{ href: "/app/today", label: "Today" },
{ href: "/login", label: "Log in" },
{ href: "/signup", label: "Sign up" },
];
Expand Down
Loading