Remplr-backend

Github

Remplr-backend

Node.js-based backend API for REMPLR 2.0

Overview

Introduction

The Recipe and Meal Plan API provides a comprehensive interface for managing recipes and meal plans within a nutrition and dietary application. The API is designed for use by administrators, nutritionists, and clients, and offers a range of features for creating, updating, deleting, and sharing recipes and meal plans.

Features

Ingredients Management

Recipes Management

Meal Plans Management

Authorization

The API provides varying levels of access based on user roles. Specific endpoints require administrator or nutritionist authorization, while others may be accessed by logged-in users, including clients.

Base URL

If you want to run this project locally, the base URL is:

http://localhost:3001/

I’ll suggest using the following base URL which is already deployed:

https://remplr-backend.onrender.com/

REMPLR Design Architecture

REMPLR Design Architecture (4)

REMPLR Database Schema

REMPLR

Endpoints

Users:

1. User Authentication

POST /auth/token

2. Add a New Client for a Nutritionist

POST /auth/client/new

3. Nutritionist Registration

POST /auth/register

Recipes

1. Create a new recipe

POST /recipes/

2. Retrieve all recipes

GET /recipes/

3. Retrieve a specific recipe

GET /recipes/:id

4. Update a recipe

PATCH /recipes/:id

5. Delete a recipe

DELETE /recipes/:id

Ingredients

1. Create a new ingredient

POST /ingredients/

2. Retrieve all ingredients

GET /ingredients/

3. Retrieve a specific ingredient

GET /ingredients/:id

4. Update an ingredient

PATCH /ingredients/:id

5. Delete an ingredient

DELETE /ingredients/:id

Meal Plans

Create a new meal plan

POST /

Retrieve all meal plans

GET /

Retrieve a specific meal plan

GET /:mealPlanId

Update a meal plan

PATCH /:mealPlanId

Add a recipe to a meal plan

POST /:mealPlanId/recipes/:recipeId

Remove a recipe from a meal plan

DELETE /:mealPlanId/recipes/:recipeId

Delete a meal plan

DELETE /:mealPlanId

Share a meal plan with a client

POST /:mealPlanId/share

Retrieve shared meal plans for a client

GET /shared/:clientUsername