feat: implement CV via OpenAI for forms scanning, generate DB migration, fixes, etc.

This commit is contained in:
2025-12-02 14:59:35 +01:00
parent a140df35c5
commit c0c01d92b2
26 changed files with 4871 additions and 110 deletions

View File

@@ -25,8 +25,9 @@ A digital meal ordering system for elderly care homes, built with Payload CMS 3.
- Node.js 18+
- pnpm (recommended) or npm
- Docker and Docker Compose (for containerized deployment)
### Installation
### Local Development
```bash
# Clone the repository
@@ -45,6 +46,36 @@ SEED_DB=true pnpm dev
The application will be available at `http://localhost:3000`.
### Docker Deployment
Run the complete stack with PostgreSQL and MinIO:
```bash
# Build and start all services
docker-compose up --build
# Or run in detached mode
docker-compose up -d --build
# Stop services
docker-compose down
# Stop and remove volumes (clean restart)
docker-compose down -v
```
**Services:**
- **App**: http://localhost:3100
- **PostgreSQL**: localhost:5433
- **MinIO Console**: http://localhost:9101 (credentials: minioadmin/minioadmin)
- **MinIO API**: http://localhost:9100
The Docker setup automatically:
- Uses PostgreSQL instead of SQLite
- Uses MinIO for S3-compatible object storage
- Creates the required storage bucket
- Seeds the database with sample data
### Default Users
The seed script creates the following users:
@@ -186,18 +217,21 @@ pnpm generate:types # Generate TypeScript types
### Database
The application uses SQLite by default (`meal-planner.db`). To migrate to PostgreSQL:
The application uses:
- **SQLite** for local development (`meal-planner.db` file)
- **PostgreSQL** when running via Docker Compose
1. Install the PostgreSQL adapter: `pnpm add @payloadcms/db-postgres`
2. Update `payload.config.ts`:
```typescript
import { postgresAdapter } from '@payloadcms/db-postgres'
The configuration automatically switches based on the `DATABASE_URI` environment variable:
- If `DATABASE_URI` is set → PostgreSQL
- If `DATABASE_URI` is empty → SQLite
db: postgresAdapter({
pool: { connectionString: process.env.DATABASE_URI }
}),
```
3. Set `DATABASE_URI` in `.env`
### Storage
The application uses:
- **Local filesystem** for local development
- **MinIO (S3-compatible)** when running via Docker Compose
The configuration automatically switches based on the `MINIO_ENDPOINT` environment variable.
### Environment Variables