Backend REST API for the Recipe Website project. Built with Node.js, Express.js, and SQLite.
Your job: build the frontend that consumes this API. This document describes everything you need to know: how to install, run, and call every endpoint.
- Parcourir les recettes : voir toutes les recettes avec leur cuisine, categories dietetiques et objectifs
- Detail d'une recette : consulter les ingredients, les etapes de preparation, les informations dietetiques, les objectifs et les allergenes (deduits automatiquement des ingredients)
- Filtrer les recettes :
- Par type de cuisine (Italienne, Asiatique, etc.)
- Par objectif (Perte de poids, Riche en proteines, etc.)
- Par exclusion d'allergene (ex : afficher uniquement les recettes sans gluten)
- Consulter les cuisines : liste des cuisines disponibles avec leurs recettes associees
- Consulter les ingredients : liste des ingredients avec leurs allergenes et les recettes qui les utilisent
- Lire les avis : voir les notes et commentaires laisses sur chaque recette
- Inscription : creer un compte avec nom d'utilisateur, email et mot de passe
- Connexion / Deconnexion : authentification par session (cookies)
- Profil : consulter, modifier ou supprimer son compte
- Changer son mot de passe
- Creer une recette : titre, description, image, type de cuisine
- Gerer les ingredients : ajouter ou retirer des ingredients d'une recette
- Gerer les etapes : ajouter, modifier ou supprimer les instructions de preparation
- Gerer les categories dietetiques : associer ou retirer des classifications (Vegetarien, Sans gluten, Cetogene, etc.)
- Gerer les objectifs : associer ou retirer des objectifs (Rapide et facile, Economique, etc.)
- Modifier le titre d'une recette
- Supprimer une recette (et toutes ses donnees associees)
Un utilisateur ne peut modifier/supprimer que ses propres recettes. Les administrateurs peuvent modifier n'importe quelle recette.
- Ajouter/retirer une recette des favoris
- Consulter ses recettes favorites
- Noter une recette de 1 a 5 etoiles avec un commentaire optionnel
- Modifier ou supprimer sa propre note
- Consulter ses evaluations
- Gerer les cuisines : creer, modifier ou supprimer un type de cuisine. La suppression d'une cuisine reaffecte automatiquement ses recettes a "Internationale"
- Gerer les allergenes des ingredients : associer ou retirer un allergene d'un ingredient. Ces associations se repercutent automatiquement sur toutes les recettes utilisant cet ingredient
- Fonctionnalites du site
- Quick Start
- Project Structure
- Database Schema
- Authentication
- Connecting from a Frontend
- API Reference
- Reference ID Tables
- Testing with Postman
- Sample Data
- Node.js >= 16
- npm (comes with Node.js)
# 1. Install dependencies
npm install
# 2. Build the database (creates database/recettes.db with sample data)
node database/setup-database.js
# 3. Start the server in development mode (auto-reload on file changes)
npm run devThe API will be available at http://localhost:3050.
| Command | Description |
|---|---|
npm run dev |
Start dev server with nodemon (auto-reload) |
npm start |
Start production server |
node database/setup-database.js |
Rebuild the database from scratch |
The .env file contains:
NODE_ENV=development
PORT=3050
DATABASE_PATH=./database/recettes.db
You can change PORT if 3050 is already in use.
RecipeWebsite - Project/
app.js # Express application entry point
package.json
.env.example # Environment variables template
README.md # This file
config/
database.js # SQLite connection (singleton)
database/
create_tables.sql # Full schema (all tables)
insert_data.sql # Sample data
setup-database.js # Run this to rebuild the DB
recettes.db # SQLite database file (generated, not in git)
middleware/
auth.js # authenticate, checkRecipeOwnership, requireAdmin
errorHandler.js # Global error handler
models/
User.js # User model (register, login, favorites, ratings)
controllers/
userController.js # User business logic
routes/
recipes.js # /api/recipes endpoints
cuisines.js # /api/cuisines endpoints
ingredients.js # /api/ingredients endpoints
users.js # /api/users endpoints
Cuisines ──────< Recipes >────── Users
│
┌─────────┼──────────┐
│ │ │
RecipeGoals RecipeDietary RecipeIngredients >── Ingredients
│ │ │
Goals DietaryInfo IngredientAllergies
│
AllergiesInformation
Recipes ──< RecipeInstructions
Recipes ──< RecipeRatings >── Users
Recipes ──< UserFavorites >── Users
| Column | Type | Notes |
|---|---|---|
| cuisine_id | INTEGER | PRIMARY KEY |
| name | TEXT | NOT NULL |
| Column | Type | Notes |
|---|---|---|
| goal_id | INTEGER | PRIMARY KEY |
| name | TEXT | NOT NULL |
| Column | Type | Notes |
|---|---|---|
| diet_id | INTEGER | PRIMARY KEY |
| name | TEXT | NOT NULL |
| Column | Type | Notes |
|---|---|---|
| allergy_id | INTEGER | PRIMARY KEY |
| name | TEXT | NOT NULL |
| Column | Type | Notes |
|---|---|---|
| ingredient_id | INTEGER | PRIMARY KEY |
| name | TEXT | NOT NULL |
| unit | TEXT | e.g. "grammes", "unites" |
| Column | Type | Notes |
|---|---|---|
| user_id | INTEGER | PRIMARY KEY, AUTOINCREMENT |
| username | TEXT | NOT NULL, UNIQUE |
| TEXT | NOT NULL, UNIQUE | |
| password_hash | TEXT | NOT NULL (bcrypt) |
| first_name | TEXT | nullable |
| last_name | TEXT | nullable |
| created_at | DATETIME | default CURRENT_TIMESTAMP |
| updated_at | DATETIME | default CURRENT_TIMESTAMP |
| is_admin | INTEGER | 0 or 1, default 0 |
| Column | Type | Notes |
|---|---|---|
| recipe_id | INTEGER | PRIMARY KEY |
| title | TEXT | NOT NULL |
| description | TEXT | |
| image_url | TEXT | |
| cuisine_id | INTEGER | FK -> Cuisines |
| user_id | INTEGER | FK -> Users (nullable, ON DELETE SET NULL) |
| average_rating | REAL | default 0 |
| total_ratings | INTEGER | default 0 |
| Column | Type | Notes |
|---|---|---|
| recipe_id | INTEGER | PK, FK -> Recipes (CASCADE) |
| ingredient_id | INTEGER | PK, FK -> Ingredients |
| quantity | REAL |
| Column | Type | Notes |
|---|---|---|
| instruction_id | INTEGER | PRIMARY KEY |
| recipe_id | INTEGER | FK -> Recipes (CASCADE) |
| step_number | INTEGER | |
| description | TEXT | |
| ingredient_id | INTEGER | FK -> Ingredients (nullable) |
| Column | Type | Notes |
|---|---|---|
| ingredient_id | INTEGER | PK, FK -> Ingredients (CASCADE) |
| allergy_id | INTEGER | PK, FK -> AllergiesInformation (CASCADE) |
Allergens are linked to ingredients, not recipes. A recipe's allergens are derived from its ingredients.
| Column | Type | Notes |
|---|---|---|
| recipe_id | INTEGER | PK, FK -> Recipes (CASCADE) |
| diet_id | INTEGER | PK, FK -> DietaryInformation (CASCADE) |
A recipe can have multiple dietary classifications (e.g. "Vegetarien" + "Sans gluten").
| Column | Type | Notes |
|---|---|---|
| recipe_id | INTEGER | PK, FK -> Recipes (CASCADE) |
| goal_id | INTEGER | PK, FK -> Goals (CASCADE) |
A recipe can serve multiple goals (e.g. "Riche en proteines" + "Rapide et facile").
| Column | Type | Notes |
|---|---|---|
| user_id | INTEGER | PK, FK -> Users (CASCADE) |
| recipe_id | INTEGER | PK, FK -> Recipes (CASCADE) |
| added_at | DATETIME | default CURRENT_TIMESTAMP |
| Column | Type | Notes |
|---|---|---|
| rating_id | INTEGER | PRIMARY KEY, AUTOINCREMENT |
| user_id | INTEGER | NOT NULL, FK -> Users (CASCADE) |
| recipe_id | INTEGER | NOT NULL, FK -> Recipes (CASCADE) |
| rating | INTEGER | 1-5, NOT NULL |
| review_text | TEXT | nullable |
| created_at | DATETIME | default CURRENT_TIMESTAMP |
| updated_at | DATETIME | default CURRENT_TIMESTAMP |
UNIQUE constraint on (user_id, recipe_id) — one rating per user per recipe.
The API uses session-based authentication (cookies).
- Call
POST /api/users/loginwith email + password. - The server creates a session and sends back a
Set-Cookieheader. - Include that cookie in all subsequent requests (browsers do this automatically; in Postman, enable "Send cookies").
- Call
POST /api/users/logoutto destroy the session.
| Level | Description |
|---|---|
| Public | No login required. Anyone can read recipes, cuisines, ingredients. |
| Authenticated | Must be logged in. Required to create recipes, rate, favorite, etc. |
| Owner | Must be logged in AND own the recipe. Required to edit/delete your own recipes. Admins bypass this check. |
| Admin | Must be logged in AND have is_admin = 1. Required for cuisine CRUD and ingredient allergen management. |
The API accepts requests from any origin (Access-Control-Allow-Origin: *).
This means your frontend can run on a different port (e.g. localhost:5173 with Vite) and still call the API.
However, the wildcard * does not allow sending cookies cross-origin. Since authentication relies on session cookies, you have two options:
Configure your frontend dev server to proxy API requests so both frontend and API share the same origin. No cookie issues.
Vite (vite.config.js):
export default defineConfig({
server: {
proxy: {
'/api': 'http://localhost:3050'
}
}
})Then call /api/recipes from your frontend code (no http://localhost:3050 prefix needed).
React (Create React App) (package.json):
{
"proxy": "http://localhost:3050"
}In app.js, replace the CORS middleware to allow your specific frontend origin with credentials:
app.use((req, res, next) => {
res.header('Access-Control-Allow-Origin', 'http://localhost:5173'); // your frontend URL
res.header('Access-Control-Allow-Credentials', 'true');
res.header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
if (req.method === 'OPTIONS') return res.sendStatus(200);
next();
});Then in your frontend fetch calls, add credentials: 'include':
// Login
const res = await fetch('http://localhost:3050/api/users/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({ email: '[email protected]', password: 'password123' })
});
// Authenticated request (cookie is sent automatically)
const recipes = await fetch('http://localhost:3050/api/recipes/my-recipes', {
credentials: 'include'
});- Public pages (no login needed): call
GET /api/recipes,GET /api/cuisines, etc. - Register:
POST /api/users/register - Login:
POST /api/users/login— a session cookie is set - Authenticated actions: create recipes, rate, favorite — the cookie is sent with each request
- Logout:
POST /api/users/logout
All endpoints return JSON in this format:
{
"success": true,
"data": { ... }
}On error:
{
"success": false,
"message": "Error description"
}Get all recipes with cuisine name, dietary categories, and goals.
Access: Public
Response:
{
"success": true,
"count": 4,
"data": [
{
"recipe_id": 1,
"title": "Poulet Alfredo",
"description": "Une delicieuse recette de pates au poulet",
"image_url": "poulet_alfredo.jpg",
"average_rating": 0,
"total_ratings": 0,
"cuisine_name": "Italienne",
"goals": ["Riche en proteines", "Adapte aux familles"],
"dietary": ["Sans produits laitiers"]
}
]
}Get a single recipe with all details: ingredients, instructions, dietary, goals, and allergens.
Access: Public
Response:
{
"success": true,
"data": {
"recipe_id": 1,
"title": "Poulet Alfredo",
"description": "Une delicieuse recette de pates au poulet",
"image_url": "poulet_alfredo.jpg",
"cuisine_id": 2,
"user_id": null,
"average_rating": 0,
"total_ratings": 0,
"cuisine_name": "Italienne",
"ingredients": [
{ "ingredient_id": 1, "name": "Poulet", "unit": "grammes", "quantity": 200 },
{ "ingredient_id": 2, "name": "Pates", "unit": "grammes", "quantity": 300 }
],
"instructions": [
{ "instruction_id": 1, "step_number": 1, "description": "Faites cuire les pates..." },
{ "instruction_id": 2, "step_number": 2, "description": "Faites cuire le poulet..." }
],
"dietary": [
{ "diet_id": 1, "name": "Sans produits laitiers" }
],
"goals": [
{ "goal_id": 2, "name": "Riche en proteines" },
{ "goal_id": 6, "name": "Adapte aux familles" }
],
"allergens": [
{ "allergy_id": 1, "name": "Gluten" },
{ "allergy_id": 7, "name": "Ble" }
]
}
}Note: allergens are derived from the recipe's ingredients (through IngredientAllergies).
Get recipes filtered by cuisine.
Access: Public
Get recipes that match a specific goal (through junction table).
Access: Public
Get recipes that do NOT contain the specified allergen in any of their ingredients.
Access: Public
Example: GET /api/recipes/no-allergens/1 returns recipes with no gluten-containing ingredients.
Get recipes created by the currently logged-in user.
Access: Authenticated
Create a new recipe.
Access: Authenticated
Body:
{
"title": "My New Recipe",
"description": "A great recipe",
"image_url": "image.jpg",
"cuisine_id": 2
}Required fields: title, description, cuisine_id.
Update recipe title.
Access: Owner
Body:
{
"title": "Updated Title"
}Add an ingredient to a recipe.
Access: Owner
Body:
{
"ingredient_id": 1,
"quantity": 200
}Remove an ingredient from a recipe.
Access: Owner
Add an instruction step to a recipe.
Access: Owner
Body:
{
"step_number": 4,
"description": "Serve on a warm plate.",
"ingredient_id": null
}Required fields: step_number, description. ingredient_id is optional.
Update an instruction's description.
Access: Owner
Body:
{
"description": "Updated instruction text"
}Delete an instruction from a recipe.
Access: Owner
Add a dietary classification to a recipe.
Access: Owner
Body:
{
"diet_id": 5
}Remove a dietary classification from a recipe.
Access: Owner
Add a goal to a recipe.
Access: Owner
Body:
{
"goal_id": 2
}Remove a goal from a recipe.
Access: Owner
Get all ratings for a recipe.
Access: Public
Response:
{
"success": true,
"data": {
"average_rating": 4.5,
"total_ratings": 2,
"ratings": [
{
"rating": 5,
"review_text": "Excellent!",
"created_at": "2026-11-16T...",
"username": "john_doe"
}
]
}
}Rate a recipe (1-5 stars). One rating per user per recipe.
Access: Authenticated
Body:
{
"rating": 5,
"review": "Loved it!"
}Update your own rating.
Access: Authenticated
Body:
{
"rating": 4,
"review": "Still great but changed my mind slightly"
}Delete your own rating.
Access: Authenticated
Delete a recipe and all its related data (ingredients, instructions, dietary, goals, ratings).
Access: Owner
Get all cuisines, sorted alphabetically.
Access: Public
Response:
{
"success": true,
"count": 11,
"data": [
{ "cuisine_id": 8, "name": "Americaine" },
{ "cuisine_id": 1, "name": "Asiatique" },
...
{ "cuisine_id": 11, "name": "Internationale" }
]
}Get a cuisine with its associated recipes.
Access: Public
Create a new cuisine.
Access: Admin
Body:
{
"name": "Coréenne"
}Update a cuisine's name.
Access: Admin
Body:
{
"name": "Updated Name"
}Delete a cuisine. All recipes using this cuisine are reassigned to "Internationale" before deletion. The "Internationale" cuisine itself cannot be deleted.
Access: Admin
Get all ingredients, sorted alphabetically.
Access: Public
Get an ingredient with its associated recipes and allergens.
Access: Public
Response:
{
"success": true,
"data": {
"ingredient_id": 2,
"name": "Pates",
"unit": "grammes",
"recipes": [
{ "recipe_id": 1, "title": "Poulet Alfredo", "quantity": 300 }
],
"recipe_count": 1,
"allergies": [
{ "allergy_id": 1, "name": "Gluten" },
{ "allergy_id": 7, "name": "Ble" }
]
}
}Get allergens for a specific ingredient.
Access: Public
Create a new ingredient.
Access: Authenticated
Body:
{
"name": "Riz",
"unit": "grammes"
}Update an ingredient.
Access: Authenticated
Body:
{
"name": "Riz basmati",
"unit": "grammes"
}Delete an ingredient. Fails if the ingredient is used by any recipe.
Access: Authenticated
Add an allergen to an ingredient.
Access: Admin
Body:
{
"allergy_id": 1
}Remove an allergen from an ingredient.
Access: Admin
Register a new user.
Access: Public
Body:
{
"username": "my_username",
"email": "[email protected]",
"password": "mypassword123",
"first_name": "John",
"last_name": "Doe"
}Required fields: username, email, password.
Login and create a session.
Access: Public
Body:
{
"email": "[email protected]",
"password": "mypassword123"
}After a successful login, a session cookie is set. Include it in future requests.
Destroy the session and log out.
Access: Authenticated
Get the current user's profile.
Access: Authenticated
Update the current user's profile.
Access: Authenticated
Body:
{
"username": "new_username",
"email": "[email protected]",
"first_name": "John",
"last_name": "Doe"
}Change password.
Access: Authenticated
Body:
{
"currentPassword": "oldpassword",
"newPassword": "newpassword123"
}Delete the current user's account.
Access: Authenticated
Get the current user's favorite recipes.
Access: Authenticated
Add a recipe to favorites.
Access: Authenticated
Remove a recipe from favorites.
Access: Authenticated
Get all ratings made by the current user.
Access: Authenticated
Use these IDs when building dropdowns, filters, or forms in your frontend.
These are the values pre-loaded by setup-database.js.
| ID | Name |
|---|---|
| 1 | Asiatique |
| 2 | Italienne |
| 3 | Chinoise |
| 4 | Francaise |
| 5 | Mexicaine |
| 6 | Indienne |
| 7 | Mediterraneenne |
| 8 | Americaine |
| 9 | Thailandaise |
| 10 | Japonaise |
| 11 | Internationale |
| ID | Name |
|---|---|
| 1 | Perte de poids |
| 2 | Riche en proteines |
| 3 | Riche en nutriments |
| 4 | Faible en calories |
| 5 | Rapide et facile |
| 6 | Adapte aux familles |
| 7 | Economique |
| 8 | Occasions speciales |
| ID | Name |
|---|---|
| 1 | Sans produits laitiers |
| 2 | Sans Oeufs |
| 3 | Sans sucre |
| 4 | Sans gluten |
| 5 | Vegetarien |
| 6 | Vegetalien |
| 7 | Paleo |
| 8 | Cetogene |
| 9 | Faible en glucides |
| 10 | Faible en matieres grasses |
| ID | Name |
|---|---|
| 1 | Gluten |
| 2 | Produits laitiers |
| 3 | Noix |
| 4 | Fruits de mer |
| 5 | Soja |
| 6 | Oeufs |
| 7 | Ble |
| ID | Name | Unit |
|---|---|---|
| 1 | Poulet | grammes |
| 2 | Pates | grammes |
| 3 | Tomates | unites |
| 4 | Huile d'olive | cuilleres a soupe |
| 5 | Laitue | feuilles |
| 6 | Parmesan | grammes |
| 7 | Croutons | unites |
| 8 | Vinaigrette cesar | cuilleres a soupe |
| 9 | Ail | gousses |
| 10 | Oignons | unites |
| 11 | Basilic | feuilles |
| 12 | Mozzarella | grammes |
- Ouvrir Postman et creer une nouvelle collection
- Base URL : toutes les requetes utilisent
http://localhost:3050 - Cookies : Postman gere automatiquement les cookies de session. Apres un login reussi, le cookie est envoye avec toutes les requetes suivantes
- Verifier que le serveur tourne :
npm run dev
| Methode | URL | Description |
|---|---|---|
| GET | http://localhost:3050/api/recipes |
Toutes les recettes |
| GET | http://localhost:3050/api/recipes/1 |
Detail d'une recette |
| GET | http://localhost:3050/api/recipes/cuisine/2 |
Recettes italiennes |
| GET | http://localhost:3050/api/recipes/goal/2 |
Recettes riches en proteines |
| GET | http://localhost:3050/api/recipes/no-allergens/1 |
Recettes sans gluten |
| GET | http://localhost:3050/api/cuisines |
Toutes les cuisines |
| GET | http://localhost:3050/api/ingredients |
Tous les ingredients |
| GET | http://localhost:3050/api/ingredients/2 |
Detail d'un ingredient (avec allergenes) |
| GET | http://localhost:3050/api/ingredients/2/allergies |
Allergenes d'un ingredient |
| GET | http://localhost:3050/api/recipes/1/ratings |
Avis sur une recette |
Inscription — POST http://localhost:3050/api/users/register
Body (raw JSON) :
{
"username": "testuser",
"email": "[email protected]",
"password": "password123",
"first_name": "Test",
"last_name": "User"
}Connexion — POST http://localhost:3050/api/users/login
Body (raw JSON) :
{
"email": "[email protected]",
"password": "password123"
}Apres le login, Postman stocke automatiquement le cookie de session. Toutes les requetes suivantes sont authentifiees.
Creer une recette — POST http://localhost:3050/api/recipes
{
"title": "Ma nouvelle recette",
"description": "Une recette delicieuse",
"image_url": "ma_recette.jpg",
"cuisine_id": 2
}Ajouter un ingredient a la recette — POST http://localhost:3050/api/recipes/5/ingredients
{
"ingredient_id": 1,
"quantity": 200
}Ajouter une etape — POST http://localhost:3050/api/recipes/5/instructions
{
"step_number": 1,
"description": "Faire chauffer l'huile dans une poele.",
"ingredient_id": 4
}Ajouter une categorie dietetique — POST http://localhost:3050/api/recipes/5/dietary
{
"diet_id": 5
}Ajouter un objectif — POST http://localhost:3050/api/recipes/5/goals
{
"goal_id": 2
}Noter une recette — POST http://localhost:3050/api/recipes/1/ratings
{
"rating": 5,
"review": "Excellent !"
}Ajouter aux favoris — POST http://localhost:3050/api/users/favorites/1
(pas de body necessaire)
Voir son profil — GET http://localhost:3050/api/users/profile
Voir ses recettes — GET http://localhost:3050/api/recipes/my-recipes
Voir ses favoris — GET http://localhost:3050/api/users/favorites
| Methode | URL | Body |
|---|---|---|
| PUT | /api/recipes/5/title |
{"title": "Titre modifie"} |
| PUT | /api/recipes/5/instructions/1 |
{"description": "Etape modifiee"} |
| DELETE | /api/recipes/5/goals/2 |
— |
| DELETE | /api/recipes/5/dietary/5 |
— |
| DELETE | /api/recipes/5/instructions/1 |
— |
| DELETE | /api/recipes/5/ingredients/1 |
— |
| DELETE | /api/recipes/1/ratings |
— |
| DELETE | /api/users/favorites/1 |
— |
| DELETE | /api/recipes/5 |
— |
Logout — POST http://localhost:3050/api/users/logout
Apres deconnexion, les requetes authentifiees retournent 401 Access denied.
| Erreur | Cause | Solution |
|---|---|---|
401 Access denied |
Pas connecte ou session expiree | Refaire un POST /api/users/login |
403 Forbidden |
Vous n'etes pas le proprietaire de la recette | Modifier uniquement vos propres recettes |
404 Not found |
L'ID n'existe pas | Verifier l'ID dans l'URL |
409 Conflict |
Doublon (ex : meme allergene deja assigne) | L'association existe deja |
500 Database error |
Erreur serveur | Verifier que le serveur tourne et que la DB existe |
The database comes pre-loaded with sample data when you run node database/setup-database.js.
Asiatique, Italienne, Chinoise, Francaise, Mexicaine, Indienne, Mediterraneenne, Americaine, Thailandaise, Japonaise, Internationale
Perte de poids, Riche en proteines, Riche en nutriments, Faible en calories, Rapide et facile, Adapte aux familles, Economique, Occasions speciales
Sans produits laitiers, Sans Oeufs, Sans sucre, Sans gluten, Vegetarien, Vegetalien, Paleo, Cetogene, Faible en glucides, Faible en matieres grasses
| ID | Name |
|---|---|
| 1 | Gluten |
| 2 | Produits laitiers |
| 3 | Noix |
| 4 | Fruits de mer |
| 5 | Soja |
| 6 | Oeufs |
| 7 | Ble |
| ID | Title | Cuisine | Goals | Dietary | Allergens (via ingredients) |
|---|---|---|---|---|---|
| 1 | Poulet Alfredo | Italienne | Riche en proteines, Adapte aux familles | Sans produits laitiers | Gluten, Ble |
| 2 | Salade Cesar | Japonaise | Perte de poids, Faible en calories | Faible en matieres grasses | Produits laitiers, Gluten, Ble, Oeufs |
| 3 | Pasta Vegetarienne | Italienne | Riche en nutriments, Rapide et facile | Vegetarien | Gluten, Ble, Produits laitiers |
| 4 | Stir-Fry Asiatique | Asiatique | Riche en proteines, Rapide et facile | Sans produits laitiers, Faible en glucides | (none) |
| Username | Password | |
|---|---|---|
| john_doe | [email protected] | (hashed, not usable for login — register your own) |
| jane_smith | [email protected] | (hashed) |
| chef_mike | [email protected] | (hashed) |
The sample users have pre-generated bcrypt hashes that don't correspond to a known password. Register a new user through the API to test authenticated endpoints.
If you need to start fresh:
node database/setup-database.jsThis deletes the existing recettes.db and recreates it with all tables and sample data.