Skip to content

ilarocca/gliss-api

Repository files navigation

Gliss

A grocery managment application that gathers recipes based on your pantry.

This repo is the back-end for Gliss. You can see the app live at https://gliss-client.vercel.app/

The app was designed with both mobile and desktop viewing in mind.

To check out the app, you can either sign up or select the demo account.

Demo

Live Link

Introduction

It can be a daunting task to figure out what to make for dinner each night. Gliss makes viewing your pantry from anywhere easy and privides dinner ideas that you may have never thoughut of with the items that you have.

Screenshots

Landing Page

Log In

My Pantry

Get Recipes

MyRecipes

API Overview

/api
.
├── /auth
│   └── GET
│       ├── /current-user
│   └── POST
│       └── /login
|
├── /users
│   └── GET
|       ├── /
│       ├── /:user_id
|       ├── /:user_id/items
|       ├── /:user_id/recipes
|   └── POST
|       ├── /
│   └── DELETE
│       └── /:user_id
|
├── /items
│   └── GET
│       ├── /
│   └── POST
│       ├── /
│   └── DELETE
|       └── /:user_id/:item_id
|
├── /recipes
│   └── GET
│       ├── /
│   └── POST
│       ├── /
│   └── DELETE
|       └── /:user_id/:recipe_id

POST /api/auth/login

// req.body
{
  username: String,
  password: String
}

// res.body
{
  user: {
  id: Number,
  firstName: String,
  lastName: String,
  username: String,
  dateCreated: Number,
  }
  authToken: String
}

GET /api/auth/current-user

// req.header
Authorization: Bearer ${token}

// res.body
{
  user: {
  id: Number,
  firstName: String,
  lastName: String,
  username: String,
  dateCreated: Number,
  }
}

GET /api/users

// res.body
{
  user: {
  id: Number,
  firstName: String,
  lastName: String,
  username: String,
  dateCreated: Number,
  }
}

GET /api/users/:user_id

// req.header
Authorization: Bearer ${token}

//req.body
{
  userId: Number
}

// res.body
{
  user: {
  id: Number,
  firstName: String,
  lastName: String,
  username: String,
  dateCreated: Number,
  }
}

GET /api/users/:user_id/items

// req.header
Authorization: Bearer ${token}

//req.body
{
  userId: Number
}

// res.body
{
   id: Number,
  item: String,
  categoryId: Number,
  userId: Number,
  dateCreated: String,
}

GET /api/users/:user_id/recipes

// req.header
Authorization: Bearer ${token}

//req.body
{
  userId: Number
}

// res.body
{
  id: Number,
  recipeName: String,
  ingredients: String,
  img: String,
  url: String,
  userId: Number,
  dateCreated: String,
}

POST /api/users/

// req.header
Authorization: Bearer ${token}

//req.body
{
  firstName: String,
  lastName: String,
  username: String,
  password: String
}

// res.body
{
  user: {
  id: Number,
  firstName: String,
  lastName: String,
  username: String,
  dateCreated: String,
  }
  authToken: String
}

DELETE /api/users/:user_id

// req.header
Authorization: Bearer ${token}

//req.body
{
  userId: Number
}

GET /api/items/

//res.body
{
  id: Number,
  item: String,
  categoryId: Number,
  userId: Number,
  dateCreated: String,
}

POST /api/items/

// req.header
Authorization: Bearer ${token}

// req.body
{
  item: String,
  categoryId: Number,
  userId: Number
}

// res.body
{
  id: Number,
  item: String,
  categoryId: Number,
  userId: Number,
  dateCreated: String,
}

DELETE /api/items/:user_id/:item_id

// req.header
Authorization: Bearer ${token}

// req.body
{
  userId: Number,
  itemId: Number
}

GET /api/recipes/

//res.body
{
  id: Number,
  recipeName: String,
  ingredients: String,
  img: String,
  url: String,
  userId: Number,
  dateCreated: String,
}

POST /api/recipes/

// req.header
Authorization: Bearer ${token}

// req.body
{
  recipeName: String,
  img: String,
  url: String,
  ingredients: String,
  userId: Number
}

// res.body
{
  id: Number,
  recipeName: String,
  ingredients: String,
  img: String,
  url: String,
  userId: Number,
  dateCreated: String,
}

DELETE /api/recipes/:user_id/:recipes_id

// req.header
Authorization: Bearer ${token}

// req.body
{
  userId: Number,
  recipeId: Number
}

Technology

Back End

  • Node and Express
    • Authentication via JWT
    • RESTful Api
  • Testing
    • Supertest (integration)
    • Mocha and Chai (unit)
  • Database
    • Postgres
    • Knex.js - SQL wrapper

Testing

  • Supertest (integration)
  • Mocha and Chai (unit)

Production

  • Deployed via Heroku

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published