How emadibrahimm/miam_back works
This is an Express/Mongoose API for user accounts, ingredients, personal ingredient lists, recipe discovery, and favorites. The main workflow is a client managing a user’s pantry, then requesting recipes that can be made from its required ingredients. Authentication and fixture-based database imports are separate branches. Edges reflect visible route mounting, controller calls, and import orchestration; model persistence details and several controller-to-model relationships were not fully evidenced in the excerpts.
Main entry points: index.js Express server · import/index.js Import runner · listIngredient.js Pantry API · listIngredients.js Pantry importer
Components 20
API and auth
- Express server
index.js - Authentication
controllers/auth.js
Pantry and recipes
- Ingredient API
controllers/ingredient.js - Pantry API
controllers/listIngredient.js - Recipe discovery
controllers/recipe.js
Accounts and favorites
- User API
controllers/user.js - Favorites API
controllers/favori.js
Data and imports
- User model
models/User.js - Ingredient model
models/Ingredient.js - Pantry entry model
models/ListIngredient.js - Recipe model
models/Recipe.js - Favorite model
models/favori.js - MongoDB connection
config/db.js - Import runner
import/index.js - Ingredient importer
import/importers/Ingredients.js - User importer
import/importers/users.js - Pantry importer
import/importers/listIngredients.js - Recipe importer
import/importers/recipes.js
Other components
- API client
- MongoDB
Connections 30
- API client → Express server: sends requests
index.js - Express server → Authentication: mounts routes
index.js - Express server → User API: mounts routes
index.js - Express server → Ingredient API: mounts routes
index.js - Express server → Pantry API: mounts routes
index.js - Express server → Recipe discovery: mounts routes
index.js - Express server → Favorites API: mounts routes
index.js - Express server → MongoDB connection: connects database
index.js - Authentication → User model: registers users
controllers/auth.js - User API → User model: queries users
controllers/user.js - Ingredient API → Ingredient model: queries ingredients
controllers/ingredient.js - Pantry API → Pantry entry model: queries entries
controllers/listIngredient.js - Pantry API → User model: finds user
controllers/listIngredient.js - Pantry API → Ingredient model: finds ingredient
controllers/listIngredient.js - Recipe discovery → Pantry entry model: reads pantry
controllers/recipe.js - Recipe discovery → Recipe model: queries recipes
controllers/recipe.js - Favorites API → Favorite model: queries favorites
controllers/favori.js - MongoDB connection → MongoDB: connects to
config/db.js - Import runner → MongoDB connection: connects database
import/index.js - Import runner → Ingredient importer: runs importer
import/importers/Ingredients.js - Import runner → User importer: runs importer
import/index.js - Import runner → Pantry importer: runs importer
import/index.js - Import runner → Recipe importer: runs importer
import/index.js - Pantry importer → Ingredient model: uses model
import/importers/listIngredients.js - User importer → User model: uses model
import/importers/users.js - Recipe importer → Recipe model: uses model
import/importers/recipes.js - Ingredient importer → Ingredient model: uses model
import/importers/Ingredients.js - Pantry importer → Ingredient importer: receives ingredients
- Pantry importer → User importer: receives user ID
import/index.js - Recipe importer → Ingredient importer: receives ingredients