summaryrefslogtreecommitdiff
path: root/apps/web/README.md
blob: 15bddc2208ca4c770d3901f25a9425caae6872cc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# asa.news web

Next.js 16 frontend for the asa.news RSS reader.

## Prerequisites

- Node.js 22+
- pnpm 10+
- A Supabase project with the schema applied (see `supabase/schema.sql`)
- Stripe account (for billing features)
- Go worker running (see `services/worker/`)

## Environment Variables

Copy `.env.example` to `.env.local` and fill in the values:

| Variable | Description |
|---|---|
| `NEXT_PUBLIC_SUPABASE_URL` | Supabase project URL |
| `NEXT_PUBLIC_SUPABASE_ANON_KEY` | Supabase anonymous/public key |
| `SUPABASE_SERVICE_ROLE_KEY` | Supabase service role key (server-side only) |
| `STRIPE_SECRET_KEY` | Stripe secret key |
| `STRIPE_WEBHOOK_SECRET` | Stripe webhook signing secret |
| `STRIPE_PRO_MONTHLY_PRICE_IDENTIFIER` | Stripe price ID for Pro monthly |
| `STRIPE_PRO_YEARLY_PRICE_IDENTIFIER` | Stripe price ID for Pro yearly |
| `STRIPE_DEVELOPER_MONTHLY_PRICE_IDENTIFIER` | Stripe price ID for Developer monthly |
| `STRIPE_DEVELOPER_YEARLY_PRICE_IDENTIFIER` | Stripe price ID for Developer yearly |

## Development

```bash
pnpm install
pnpm dev
```

The app runs on `http://localhost:3000`. The Go worker (`services/worker/`) must be running separately for feed fetching.

## Scripts

| Command | Description |
|---|---|
| `pnpm dev` | Start development server |
| `pnpm build` | Production build (uses webpack for service worker generation) |
| `pnpm lint` | Run ESLint |
| `pnpm test` | Run vitest unit tests |

## Architecture

- **Framework**: Next.js 16 (App Router) with React 19
- **Styling**: Tailwind CSS 4
- **State**: Zustand (client), TanStack Query (server)
- **Auth**: Supabase Auth with cookie-based sessions
- **Billing**: Stripe Checkout + Customer Portal
- **PWA**: Serwist service worker with offline support
- **Deployment**: Vercel

## Project Structure

```
app/
  (auth)/          sign-in, sign-up, reset-password, forgot-password
  (marketing)/     landing page
  reader/          main reader UI (entry list, detail panel, settings)
  shared/          public shared entry pages
  api/             API routes (billing, webhooks, data export, v1 API)
lib/
  hooks/           custom React hooks
  queries/         TanStack Query hooks
  stores/          Zustand stores
  supabase/        Supabase client factories
```