63 lines
1.6 KiB
Markdown
63 lines
1.6 KiB
Markdown
# Base
|
|
|
|
Svelte 5 + SvelteKit project with shadcn-svelte and PocketBase (auth), using Bun. Homepage with links to prism, tasgrid, stackq, and hrm.
|
|
|
|
## Stack
|
|
|
|
- **Svelte 5** with SvelteKit 2
|
|
- **Tailwind CSS v4** via `@tailwindcss/vite`
|
|
- **shadcn-svelte** (new-york style, slate base)
|
|
- **PocketBase** — auth at `https://pocketbase.ccllc.pro`
|
|
|
|
## Develop
|
|
|
|
```bash
|
|
bun install # if needed
|
|
bun run dev
|
|
```
|
|
|
|
Open http://localhost:5173. Unauthenticated users are redirected to `/login`.
|
|
|
|
## Login
|
|
|
|
- **Login:** `/login` — email + password.
|
|
- **Logout:** header dropdown → “Log out” or visit `/logout`.
|
|
- Auth is stored in a `pb_auth` cookie and restored in `src/hooks.server.ts`.
|
|
|
|
## PocketBase
|
|
|
|
- **Client:** `import { pb } from '$lib/pocketbase'` for browser-side API.
|
|
- **Server:** use `event.locals.pb` and `event.locals.user` in load functions and form actions.
|
|
- Configure URL via `VITE_POCKETBASE_URL` (build/env) and in `src/lib/pocketbase.ts` / `src/hooks.server.ts`.
|
|
|
|
## Homepage
|
|
|
|
Links to:
|
|
|
|
- https://prism.ccllc.pro
|
|
- https://tasgrid.ccllc.pro
|
|
- https://stackq.ccllc.pro
|
|
- https://hrm.ccllc.pro
|
|
|
|
## Add more components
|
|
|
|
```bash
|
|
bunx shadcn-svelte@latest add <component-name>
|
|
```
|
|
|
|
## Build
|
|
|
|
```bash
|
|
bun run build
|
|
bun run preview # preview production build
|
|
```
|
|
|
|
## CI
|
|
|
|
`.github/workflows/ci.yml` runs on push/PR to `main`:
|
|
|
|
- **PRs:** build only (Bun, `bun run build`).
|
|
- **Push to main:** build, then deploy via rsync and restart with pm2 (app name `base`).
|
|
|
|
Set repo secrets: `DEPLOY_USER`, `DEPLOY_PASSWORD`, `DEPLOY_HOST` (or use env `DEPLOY_HOST`), `DEPLOY_PATH` (or env), `DEPLOY_SSH_PORT` (optional), `VITE_POCKETBASE_URL` (optional).
|