Files
la-huasca-ts/README.md
T

44 lines
1.3 KiB
Markdown

# la-huasca-ts
TypeScript + Next.js version of La Huasca.
A minimal Next.js 14+ App Router scaffold using TypeScript, with [`@chenglou/pretext`](https://github.com/chenglou/pretext) installed. The landing page demonstrates a Pretext-based text measurement in a client component (`src/components/MeasuredText.tsx`).
## Getting started
```bash
npm install
npm run dev
```
Open [http://localhost:3000](http://localhost:3000).
## Project structure
```
package.json
next.config.js
tsconfig.json
src/app/layout.tsx
src/app/page.tsx
src/components/MeasuredText.tsx
README.md
```
## Authentication
The app now includes simple browser-local authentication with two hardcoded accounts:
- `admin` / `admin` — Admin portal (`/admin`)
- `user` / `user` — User portal (`/user`)
The logged-in role is stored in `localStorage`. The **Login / Logout** control lives in the Navbar.
## Admin portal
Visit `/admin` after logging in as `admin` to upload images. Images are previewed in a gallery and can be deleted individually. For now, uploaded images are stored as base64 strings in the browser's `localStorage` under the key `la-huasca-admin-images` — they are not persisted on a server.
## User portal
Visit `/user` after logging in as `user` to see a member portal with mock reservations, discount coupons, offers, the WiFi password, and a list of benefits.