SefSema — Recipe-sharing app built with Next.js App Router, featuring dedicated create/detail pages and filtering by tags and ingredients.
- Unified recipe list with public and personal recipes.
- Ingredient search with suggestions.
- Dedicated create page at
/create. - Detail page at
/recept/[slug]. - SEO-friendly URLs with unique slugs (accent removal).
- Optimistic UI for personal recipe deletion.
- Tag and ingredient filtering.
- 5 system recipes with tags and preparation.
- Extra seed user:
maria(maria@example.com / demo1234) — 2 public recipes + 1 private recipe (visible when logged in). - Restart the dev server to re-seed data.
- REST-style overview: docs/api.md
- Framework: Next.js (App Router) + React
- UI: Tailwind CSS
- Data layer: in-memory repository (development) or MongoDB (production/optional)
- Switch with
USE_MONGO=truein.env.localto enable MongoDB-backedmongoRecipeRepo.
- Switch with
- Auth: session cookie
- Validation: Zod
- Slug generation: custom utility (
app/lib/slug.ts)
-
Files added:
app/lib/mongodb.ts— MongoDB client singleton and connection helperapp/lib/mongoRecipeRepo.ts— Mongo-backed implementation of theRecipeRepositoryAPIapp/lib/getRecipeRepo.ts— helper that returns the selected repo based onUSE_MONGOscripts/migrate-memory-to-mongo.ts— one-off migration script to copy in-memory seed data to MongoDB
-
Env vars (add to
.env.local):MONGODB_URI(e.g.mongodb://localhost:27017)MONGODB_DB(e.g.recipe_app)USE_MONGO=trueto enable Mongo usage
-
How to migrate seed data into MongoDB:
# install runner if you don't have it
npm install -D tsx dotenv
# ensure .env.local contains MONGODB_URI / MONGODB_DB and USE_MONGO=true
npm run migrate:memory-to-mongoThe migration script upserts users and recipes from the in-memory repo into users and recipes collections and preserves the original in-memory id in legacyId.
- Lint:
npm run lint - Commit quality: Commitlint + Husky (conventional commits, required scope)
npm install
npm run devThis codebase was produced with an AI assistant (GitHub Copilot) under human supervision as an experimental effort. Migration and refactor also produced by AI with human supervision.
For detailed development roadmap and planned improvements, see TODO.md
- UI is not perfect contains visual errors
- Limited testing, low coverage
- Unused or limited functions
- Visual or code duplications (few of them already removed)
- Random stock photo if the user not uploading a picture for recipe.
- Avatar images are stored locally in
public/avatars/(not suitable for production; consider cloud storage like S3, Cloudinary)