feat: add deployment guide, nginx/systemd configs, switch to adapter-node
- Add docs/DEPLOYMENT.md: step-by-step Proxmox LXC guide (Debian 13, PostgreSQL, nginx reverse proxy, systemd services) - Add nginx/innercontext.conf: proxy /api/ → uvicorn, /mcp/ → uvicorn with SSE streaming support, / → SvelteKit Node server - Add systemd/innercontext.service and innercontext-node.service - Switch frontend from adapter-auto to adapter-node (required for +page.server.ts form actions); install adapter-node 5.5.4 - Update README.md: add frontend, MCP sections; fix /skin-snapshots → /skincare; update repo layout - Replace frontend/README.md generic Svelte template with project docs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
142fbe8530
commit
95fbdeb212
9 changed files with 649 additions and 47 deletions
|
|
@ -1,42 +1,74 @@
|
|||
# sv
|
||||
# innercontext — frontend
|
||||
|
||||
Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).
|
||||
SvelteKit web UI for innercontext. Provides a browser interface for managing skincare products, routines, health data, and skin condition snapshots.
|
||||
|
||||
## Creating a project
|
||||
## Stack
|
||||
|
||||
If you're seeing this, you've probably already done this step. Congrats!
|
||||
- **Framework:** SvelteKit 2, Svelte 5 (Runes)
|
||||
- **Language:** TypeScript
|
||||
- **Styles:** Tailwind CSS v4
|
||||
- **Components:** shadcn-svelte (bits-ui)
|
||||
- **Adapter:** `@sveltejs/adapter-node` (required — uses `+page.server.ts` form actions)
|
||||
|
||||
```sh
|
||||
# create a new project
|
||||
npx sv create my-app
|
||||
## Development
|
||||
|
||||
```bash
|
||||
# Install dependencies
|
||||
pnpm install
|
||||
|
||||
# Start dev server (API proxied to localhost:8000)
|
||||
pnpm dev
|
||||
```
|
||||
|
||||
To recreate this project with the same configuration:
|
||||
The backend must be running at `http://localhost:8000`. See `../backend/` for setup instructions.
|
||||
|
||||
```sh
|
||||
# recreate this project
|
||||
pnpm dlx sv create --template minimal --types ts --install pnpm frontend
|
||||
## Environment variables
|
||||
|
||||
| Variable | Description | Default |
|
||||
|---|---|---|
|
||||
| `PUBLIC_API_BASE` | Base URL of the FastAPI backend | `http://localhost:8000` |
|
||||
|
||||
Set `PUBLIC_API_BASE` at **build time** for production:
|
||||
|
||||
```bash
|
||||
PUBLIC_API_BASE=http://innercontext.lan/api pnpm build
|
||||
```
|
||||
|
||||
## Developing
|
||||
## Building for production
|
||||
|
||||
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
|
||||
|
||||
```sh
|
||||
npm run dev
|
||||
|
||||
# or start the server and open the app in a new browser tab
|
||||
npm run dev -- --open
|
||||
```bash
|
||||
pnpm build
|
||||
# Output: build/
|
||||
```
|
||||
|
||||
## Building
|
||||
Run the production server:
|
||||
|
||||
To create a production version of your app:
|
||||
|
||||
```sh
|
||||
npm run build
|
||||
```bash
|
||||
node build/index.js
|
||||
```
|
||||
|
||||
You can preview the production build with `npm run preview`.
|
||||
Or use the provided systemd service: `../systemd/innercontext-node.service`.
|
||||
|
||||
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
|
||||
## Routes
|
||||
|
||||
| Route | Description |
|
||||
|---|---|
|
||||
| `/` | Dashboard |
|
||||
| `/products` | Product list |
|
||||
| `/products/new` | Add product |
|
||||
| `/products/[id]` | Product detail / edit |
|
||||
| `/routines` | Routine list |
|
||||
| `/routines/new` | Create routine |
|
||||
| `/routines/[id]` | Routine detail |
|
||||
| `/health/medications` | Medications |
|
||||
| `/health/lab-results` | Lab results |
|
||||
| `/skin` | Skin condition snapshots |
|
||||
|
||||
## Key files
|
||||
|
||||
| File | Purpose |
|
||||
|---|---|
|
||||
| `src/lib/api.ts` | API client (typed fetch wrappers) |
|
||||
| `src/lib/types.ts` | Shared TypeScript types |
|
||||
| `src/app.css` | Tailwind v4 theme + global styles |
|
||||
| `svelte.config.js` | SvelteKit config (adapter-node) |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue