Skip to content

Build-Week-Secret-Family-Recipes-2/Back-End

Repository files navigation

Back-End

Schema

Users

Field Type Notes
id integer primary key
email string required and unique
password string required
username string required
firstname string required and unique
lastname string required and unique

Recipes

Field Type Notes
id integer primary key and autoincrements
userId string required
title string name of recipe
source text who created the recipe
ingredients string food or components needed for recipe
instructions text steps to make recipe
categories string which region or culture the recipe is from

API

BASE URL:

test account:

{
	"email": "tester@email.com",
	"username": "test123",
	"password": "test",
	"firstname": "johnny",
	"lastname": "test"
}

Table of Contents

users

REQUEST URL Notes
GET /api/users gets all users from database
GET /api/users/:id gets back a specific user with given id
POST /api/users/ creates a new user
PUT api/users/:id updates a user record

recipes

REQUEST URL Notes
POST /api/recipes create a new recipe;title&ingredients a must
PUT /api/recipes/:id updates a recipe given an id value; required
DELETE /api/recipes/:id deletes a recipe given an id value; required
GET /from/:id gets all recipes from a user given the id
GET /api/recipes/ gets all recipes

Auth

REQUEST URL Notes
POST /api/auth/register registers a new user
POST /api/auth/login users logs in