mirror of
https://github.com/taogaetz/chefbible.git
synced 2025-12-06 11:47:24 -05:00
| prisma | ||
| src | ||
| static | ||
| .gitignore | ||
| .npmrc | ||
| .prettierignore | ||
| .prettierrc | ||
| eslint.config.js | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| svelte.config.js | ||
| tsconfig.json | ||
| vite.config.ts | ||
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
-
Clone the repository
git clone <repository-url> cd chefbible -
Install dependencies
npm install -
Set up environment variables Create a
.envfile 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" -
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 -
Start the development server
npm run dev -
Access the application
- Open http://localhost:5173
- Use the magic link:
/chef-access?token=your-secure-token-here
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 servernpm run build- Build for productionnpm run preview- Preview production buildnpm run check- Type check and lintnpm run format- Format code with Prettier
Database Operations
npx prisma studio- Open Prisma Studio for database managementnpx prisma migrate dev- Create and apply new migrationsnpx prisma generate- Generate Prisma clientnpx 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
-
Build the application:
npm run build -
The built application will be in the
build/directory -
Deploy using your preferred hosting platform (Vercel, Netlify, etc.)
Environment Considerations
- Set
NODE_ENV=productionin 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
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting:
npm run check - Submit a pull request
License
[Add your license here]