af1a8e4bed
- Next.js 15 + TypeScript + Tailwind, standalone output - SQLite schema: users, clients, projects, quotes, quote_items - HMAC-signed sessie-cookie auth - Dockerfile (Node 22 Alpine, multi-stage) - create-admin script - Doel: portal.rikxplatform.nl Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
55 lines
1.9 KiB
Markdown
55 lines
1.9 KiB
Markdown
# rikx-platform
|
|
|
|
Klantbeheer portaal voor projectbeheer en offertes. Inclusief workflow-stappen (statustransities, email-triggers) en calculaties per offerteregel.
|
|
|
|
## Stack
|
|
- Next.js 16 + TypeScript + Tailwind CSS
|
|
- SQLite via `node:sqlite` (ingebouwd in Node 22, geen extra package)
|
|
- HMAC-signed sessie-cookie auth (geen externe auth-provider)
|
|
- Nodemailer voor email-notificaties
|
|
|
|
## Lokaal draaien
|
|
```bash
|
|
npm install
|
|
cp .env.example .env.local
|
|
# Vul SESSION_SECRET in (.env.local) — minimaal 32 tekens willekeurig
|
|
mkdir -p data
|
|
npm run dev # http://localhost:3000
|
|
```
|
|
|
|
## Admin aanmaken
|
|
```bash
|
|
npm run create-admin maarten@rikx.nl wachtwoord "Maarten"
|
|
```
|
|
|
|
## Database
|
|
- Locatie lokaal: `./data/app.db`
|
|
- Locatie productie: `/data/app.db` (absoluut pad — Next.js standalone doet process.chdir bij start)
|
|
- Schema: `lib/db.ts` — migraties draaien automatisch bij eerste verbinding
|
|
- Tabellen: `users`, `clients`, `projects`, `quotes`, `quote_items`
|
|
|
|
## Infrastructuur (mx-platform.com)
|
|
- **Platform:** Coolify v4 op mx-platform.com (37.97.203.131)
|
|
- **Git repo:** https://git.mx-platform.com/admin/rikx-platform
|
|
- **Dockerfile:** `/Dockerfile` (Node 22 Alpine, Next.js standalone)
|
|
- **Port:** 3000
|
|
- **URL:** https://rikx.mx-platform.com
|
|
|
|
## Environment variables
|
|
| Variabele | Standaard | Uitleg |
|
|
|-----------|-----------|--------|
|
|
| `SESSION_SECRET` | — | HMAC-secret voor sessie-cookies — per omgeving uniek genereren |
|
|
| `DB_PATH` | `./data/app.db` | **In productie: `/data/app.db`** (absoluut pad) |
|
|
| `NODE_ENV` | `development` | In productie: `production` |
|
|
| `SMTP_HOST` | — | SMTP server voor email-notificaties |
|
|
| `SMTP_PORT` | `587` | SMTP poort |
|
|
| `SMTP_USER` | — | SMTP gebruikersnaam |
|
|
| `SMTP_PASS` | — | SMTP wachtwoord |
|
|
| `SMTP_FROM` | `noreply@rikx.nl` | Afzenderadres |
|
|
|
|
## Auto-deploy
|
|
Gitea webhook → Coolify. Na elke push naar `main` automatisch live.
|
|
|
|
## Collega's
|
|
Wijzigingen alleen via Git. Push naar `main` → automatisch live.
|