Tired of the eternal question, "Hva skal vi ha til middag?" (What's for dinner?) Staring blankly into the fridge abyss? Arguing with your significant other/cat/inner monologue about whether it's a fish or fajita kind of day?
Fear not, for Middag is here! It's a surprisingly functional (most of the time) Next.js application designed to take the thinking (and maybe some of the arguing) out of your weekly dinner planning.
(Yes, it actually looks like this!)
This isn't just any dinner planner. This is a sophisticated piece of engineering that:
- Fetches meal ideas from a mysterious Excel sheet living somewhere on the internet (seriously, check the
.env
requirement). - Lets you filter by meal categories because maybe you're not feeling "Rødt kjøtt" (Red meat) today.
- Generates a weekly meal plan using algorithms ranging from "pure chaos" (random) to "slightly less chaos" (weighted towards the top of your Excel list).
- Allows you to lock in those non-negotiable Taco Fridays 🌮.
- Features drag-and-drop reordering for when the generated plan feels slightly insulting.
- Supports manual editing double-click a meal to change it, because you're the boss, not the spreadsheet!
- Includes a handy copy-to-clipboard feature for easy sharing (or printing and sticking to the fridge with questionable magnets).
- Speaks multiple languages! (Currently NO 🇳🇴, EN 🇬🇧, ES 🇪🇸) - ¡Olé!
Built with modern web tech and deployed serverlessly on the edge via Cloudflare Pages, because why not?
- 🍽️ Fetches meal data from an online Excel file (
.xlsx
). - ✅ Select/deselect meal categories.
- 🎲 Random or Weighted meal plan generation.
- 🔒 Lock/Unlock specific days.
- 👆 Drag-and-drop reordering of the meal plan.
- ✏️ Manually edit meals directly in the plan.
- 📋 Copy plan to clipboard.
- 🌍 Multi-language support (NO, EN, ES).
- 🚀 Deployed on Cloudflare Pages using OpenNext.
- Framework: Next.js 15 (React 19)
- Language: TypeScript
- Styling: Tailwind CSS 4 & PostCSS
- Drag & Drop: @dnd-kit
- Excel Parsing: SheetJS (xlsx)
- Deployment: Cloudflare Pages + OpenNext + Wrangler
- Linting: ESLint
- IDs: UUID
Want to run this masterpiece (or disasterpiece, depending on the day) yourself?
-
Clone the repo:
git clone https://github.com/torfinnnome/middag.git cd middag
-
Install dependencies:
npm install # or yarn install or pnpm install
-
Configure the magic spreadsheet URL:
-
Create a
.env.local
file in the root directory. -
Add the following line, replacing the URL with the actual, publicly accessible URL to your
.xlsx
file:MIDDAGSURL="https://your-spreadsheet-url-here.xlsx"
-
Spreadsheet Format: The Excel file should have categories in the first row (A1, B1, C1, ...) and the corresponding meals listed below each category header. Like this:
Fisk Vegetar Annet Laks Linsegryte Taco Torsk Kikertcurry Hjemmelaget Pizza Sei Bønneburger Fajitas ... ... ...
-
-
Run the development server:
npm run dev
-
Open http://localhost:3000 and behold the dinner-planning glory!
This project is set up for deployment to Cloudflare Pages via the OpenNext adapter and Wrangler.
- Configuration is in
wrangler.json
. - Make sure your
MIDDAGSURL
is set as an environment variable in your Cloudflare Pages project settings. - Run
npm run deploy
to build and deploy. (Requires Wrangler to be configured). - Run
npm run preview
to build and test locally using Wrangler & Miniflare.
dev
: Starts the local development server.build
: Builds the application using OpenNext for Cloudflare.deploy
: Builds and deploys to Cloudflare Pages via Wrangler.lint
: Runs ESLint to check for code style issues.preview
: Runs a local preview build using Wrangler.types
: Generates Cloudflare environment types (env.d.ts
).check
: Does a full build, type check, and dry-run deploy.
- Storing meal data in a real database instead of a rogue spreadsheet.
- User accounts? Probably too much effort.
- Preventing the same meal twice in one week (unless it's pizza, obviously).
- AI suggestions based on leftover yogurt and that one questionable vegetable in the back of the fridge (highly unlikely).
- More languages? Submit a PR!
MIT License
Vel bekomme! (Enjoy your meal!)