How tej-carpenter/foodydipti works
Purpose and Entry Points
A Next.js App Router recipe platform for a single food influencer: public recipe discovery, authenticated favorites/profile, and admin recipe management. The root application shell is src/app/layout.tsx; public landing and recipe detail entry points are src/app/page.tsx and src/app/recipe/[id]/page.tsx.
Route Domains
Public content routes cover about, contact, recipe browsing/detail, and login: src/app/about/page.tsx, src/app/contact/page.tsx, and src/app/login/page.tsx. Authenticated user and administrator surfaces are separated into src/app/profile/page.tsx, src/app/admin/page.tsx, and src/app/admin/recipe/[id]/edit/page.tsx.
Authentication and Authorization Boundary
Firebase Authentication is exposed to the React tree through src/components/auth/AuthProvider.tsx. Login is handled by src/components/forms/LoginForm.tsx; user-specific saved content is presented through src/components/profile/SavedRecipesPanel.tsx. Firebase security enforcement is defined outside the UI in firestore.rules and storage.rules, making client authorization and database/storage policy distinct layers.
Recipe Content Lifecycle
Recipes are modeled centrally in src/types/index.ts and persisted through Firebase-facing data access in src/lib/firestore.ts. Admin create/edit flows use src/components/forms/RecipeForm.tsx and src/components/forms/EditRecipeForm.tsx; deletion is isolated in src/components/DeleteRecipeButton.tsx. Public detail rendering consumes recipe IDs from the dynamic route at src/app/recipe/[id]/page.tsx.
Discovery and Presentation Flow
The home/discovery experience composes reusable recipe display and filtering components: src/components/SearchFilterBar.tsx, src/components/PaginatedRecipeGrid.tsx, and src/components/RecipeCard.tsx. Recipe-specific user actions are grouped in src/components/RecipeActions.tsx, creating a boundary between display cards/grids and favorites or other interaction behavior.
Media and External Services
Firebase is initialized and configured through src/lib/firebase.ts, with Firestore operations centralized in src/lib/firestore.ts. Recipe media has a separate Cloudinary integration boundary at src/lib/cloudinary.ts; Firebase Storage is also part of the declared stack and governed by storage.rules. Deployment targets Vercel, while the application runtime is Next.js/Node.js.
Contact and Administrative Operations
Contact submission handling is server-routed through src/app/api/contact/route.ts, with a local variant at src/app/api/contact/local/route.ts. Administrative review of submissions is surfaced by src/components/admin/ContactSubmissionsPanel.tsx and integrated into src/app/admin/page.tsx. This separates browser-facing contact UI from API-side submission processing and admin review.
Main entry points: firestore.ts Recipe data access · layout.tsx Application shell · page.tsx Admin workspace · RecipeForm.tsx Recipe authoring
Components 19
Next.js surfaces
- Application shell
src/app/layout.tsx - Public discovery · Landing, browse, about, and login routes.
src/app/page.tsx - Recipe detail
src/app/recipe/[id]/page.tsx - User profile
src/app/profile/page.tsx - Admin workspace · Includes recipe editing and submission review.
src/app/admin/page.tsx
Recipe lifecycle
- Search and recipe grid · Filters, paginates, and displays recipe cards.
src/components/PaginatedRecipeGrid.tsx - Recipe actions · Separates favorites and other user actions from display.
src/components/RecipeActions.tsx - Recipe authoring · Create and edit recipe flows.
src/components/forms/RecipeForm.tsx - Recipe deletion
src/components/DeleteRecipeButton.tsx - Recipe model
src/types/index.ts - Recipe data access · Centralizes Firebase-facing persistence operations.
src/lib/firestore.ts
Identity and policy
- Auth provider · Exposes Firebase Authentication to the component tree.
src/components/auth/AuthProvider.tsx - Login form
src/components/forms/LoginForm.tsx - Saved recipes
src/components/profile/SavedRecipesPanel.tsx - Firebase policies · Firestore and Storage enforce backend authorization.
firestore.rules
Contact operations
- Contact API · Processes browser contact submissions; includes a local variant.
src/app/api/contact/route.ts - Submission review
src/components/admin/ContactSubmissionsPanel.tsx
External services
- Firebase · Initialized by the application and protected by rules.
src/lib/firebase.ts - Cloudinary media
src/lib/cloudinary.ts
Connections 25
- Application shell → Public discovery
- Application shell → Recipe detail
- Application shell → User profile
- Application shell → Admin workspace
- Application shell → Auth provider: provides identity
- Public discovery → Search and recipe grid: composes
- Public discovery → Login form: hosts
- Recipe detail → Recipe data access: loads by recipe ID
- Recipe detail → Recipe actions: enables
- User profile → Saved recipes: shows
- Saved recipes → Recipe data access: reads favorites
- Admin workspace → Recipe authoring: manages recipes
- Admin workspace → Recipe deletion: removes recipes
- Admin workspace → Submission review: reviews
- Search and recipe grid → Recipe data access: queries recipes
- Recipe authoring → Recipe model: uses
- Recipe authoring → Recipe data access: writes recipes
- Recipe authoring → Cloudinary media: uploads media
- Recipe deletion → Recipe data access: deletes recipe
- Login form → Auth provider: signs in through
- Auth provider → Firebase: uses Authentication
- Recipe data access → Firebase: uses Firestore
- Firebase policies → Firebase: enforces access
- Contact API → Recipe data access: stores submissions
- Submission review → Recipe data access: reads submissions