Go to file
2025-09-14 15:52:48 -04:00
prisma add hidden recipe field 2025-09-11 12:43:28 -04:00
src disable searchbar when user has no access 2025-09-14 15:52:48 -04:00
static first commit 2025-08-14 12:51:24 -04:00
.dockerignore add markdown and docker 2025-09-08 14:23:31 -04:00
.gitignore first pass at layout, created basic frontpage components, added station and time to schema 2025-08-17 21:19:50 -04:00
.npmrc first commit 2025-08-14 12:51:24 -04:00
.prettierignore first commit 2025-08-14 12:51:24 -04:00
.prettierrc first commit 2025-08-14 12:51:24 -04:00
cookies.txt Add access PIN authentication and manage access cookies 2025-09-14 15:01:03 -04:00
DATABASE_MANAGEMENT.md docker compose fixed for persistence 2025-09-08 19:54:02 -04:00
db-manager.sh docker compose fixed for persistence 2025-09-08 19:54:02 -04:00
deploy.sh docker compose fixed for persistence 2025-09-08 19:54:02 -04:00
DEPLOYMENT.md add markdown and docker 2025-09-08 14:23:31 -04:00
docker-compose.yml update healthcheck to use 127.xx 2025-09-14 15:44:03 -04:00
docker-entrypoint.sh docker compose fixed for persistence 2025-09-08 19:54:02 -04:00
Dockerfile add markdown and docker 2025-09-08 14:23:31 -04:00
env.example Add access PIN authentication and manage access cookies 2025-09-14 15:01:03 -04:00
eslint.config.js first commit 2025-08-14 12:51:24 -04:00
package-lock.json add markdown and docker 2025-09-08 14:23:31 -04:00
package.json add markdown and docker 2025-09-08 14:23:31 -04:00
README.md added magic link based auth, photo uploads with cloudinary, and recipe editing. Also we havea footer now. 2025-09-03 12:20:32 -04:00
server.mjs add markdown and docker 2025-09-08 14:23:31 -04:00
svelte.config.js add markdown and docker 2025-09-08 14:23:31 -04:00
tsconfig.json first commit 2025-08-14 12:51:24 -04:00
vite.config.ts added magic link based auth, photo uploads with cloudinary, and recipe editing. Also we havea footer now. 2025-09-03 12:20:32 -04:00

Chef Bible

A self-hosted, mobile-friendly recipe and menu management tool designed for real-world kitchen use. Built with SvelteKit, TailwindCSS, and Prisma.

Features

  • Recipe Management: Store recipes with ingredients, instructions, and photos
  • Ingredient Tracking: Manage ingredients with allergen information
  • Menu Planning: Create menus from recipes with seasonal organization
  • Kitchen-Friendly UI: Optimized for tablets and phones in kitchen environments
  • Authentication: Simple magic link authentication for chefs

Tech Stack

  • Frontend: SvelteKit 2.0 with Svelte 5
  • Styling: TailwindCSS 4.0 + DaisyUI
  • Database: SQLite with Prisma ORM
  • Authentication: Magic link system
  • Build Tool: Vite

Prerequisites

  • Node.js 18+
  • npm or yarn

Quick Start

  1. Clone the repository

    git clone <repository-url>
    cd chefbible
    
  2. Install dependencies

    npm install
    
  3. Set up environment variables Create a .env file in the root directory:

    # Database
    DATABASE_URL="file:./prisma/database.db"
    
    # Authentication (generate a secure random token for production)
    MAGIC_LINK_TOKEN="your-secure-token-here"
    
    # Environment
    NODE_ENV="development"
    
  4. Set up the database

    # Generate Prisma client
    npx prisma generate
    
    # Run database migrations
    npx prisma migrate dev
    
    # Seed the database with sample data (optional)
    npm run prisma:seed
    
  5. Start the development server

    npm run dev
    
  6. Access the application

Environment Variables

Variable Description Default
DATABASE_URL Database connection string file:./prisma/database.db
MAGIC_LINK_TOKEN Secret token for chef authentication Required
NODE_ENV Environment mode development

Database Schema

The application uses the following main models:

  • Recipe: Core recipe information with instructions and metadata
  • Ingredient: Ingredients with allergen tracking
  • RecipeIngredient: Junction table linking recipes to ingredients with quantities
  • Allergen: Allergen information linked to ingredients
  • Menu: Menu collections with seasonal organization
  • MenuRecipe: Junction table for menu-recipe relationships

Development

Available Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run preview - Preview production build
  • npm run check - Type check and lint
  • npm run format - Format code with Prettier

Database Operations

  • npx prisma studio - Open Prisma Studio for database management
  • npx prisma migrate dev - Create and apply new migrations
  • npx prisma generate - Generate Prisma client
  • npx prisma db seed - Seed database with sample data

Authentication

The app uses a simple magic link authentication system:

  • Generate a secure token and set it in MAGIC_LINK_TOKEN
  • Share the magic link: /chef-access?token=your-token
  • Authentication lasts for 30 days via HTTP-only cookies

Deployment

Production Build

  1. Build the application:

    npm run build
    
  2. The built application will be in the build/ directory

  3. Deploy using your preferred hosting platform (Vercel, Netlify, etc.)

Environment Considerations

  • Set NODE_ENV=production in production
  • Use a strong, randomly generated MAGIC_LINK_TOKEN
  • Consider using a production database (PostgreSQL, MySQL) instead of SQLite
  • Update the Prisma schema datasource provider if switching databases

Project Structure

src/
├── lib/
│   ├── components/     # Reusable UI components
│   ├── server/         # Server-side utilities
│   └── types/          # TypeScript type definitions
├── routes/             # SvelteKit route handlers
│   ├── chef-access/    # Authentication endpoint
│   ├── recipe/         # Recipe management routes
│   └── logout/         # Logout functionality
└── app.html            # HTML template

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests and linting: npm run check
  5. Submit a pull request

License

[Add your license here]