Skip to content

Creams-Quad/bounty-back

Repository files navigation

Bounty Back

Dependencies Last commit

Bounty is a social network built around sharing recipes; more specifically, sharing and creating recipes for cold treats. Bounty's purpose is to crowd-source hard to find or non-existent recipes. Fulfill your cream-based cravings, and maybe make some friends on the way.

🚀 Getting Started

  1. Fork our repo GitHub
  2. Clone the repo git clone
  3. Install dependencies npm i
  4. Run tests npm test
  5. Start a development server npm start

📖 Table of Contents

🛠 API Reference

/login

  • POST
    • Description: creates and returns user credentials from a JWT token
    • Status code: (200)
    • No json input
    • Auth:
      • Auth0 JWT
    • Example output
{
  "id": 1,
  "email": "[email protected]",
  "role": "guildMaster",
  "permissions: ["read", "update", "create", "delete"]
}

api/v1/bounties

  • POST
    • Description: Creates a new bounty with an id and add it to the bounties table
    • Status code: (200)
    • Auth:
      • Auth0 JWT
      • 'create' permission
    • JSON input:
      • header: {string}
      • content: {string}
      • karma: {integer}
{
  "id": 1,
  "header": "foo",
  "content": "bar",
  "poster": "John Doe",
  "karma": 100,
}
  • GET
    • Description: Return a list of all bounties
    • Status code:(200)
    • Auth:
      • Auth0 JWT
      • 'read' permission
    • No JSON Input
    • Example output
{
  "id": 1,
  "header": "foo",
  "content": "bar",
  "poster": "John Doe",
  "karma": 100,
}

api/v1/bounties/:id

  • PUT
    • Description: Updates a bounty within the bounties table on a given id
    • Status code:(200)
    • Auth:
      • Auth0 JWT
      • 'update' permissions
    • JSON input:
      • header: {string}
      • content: {string}
      • poster: {string}
    • Example output
{ 
  "id": 1,
  "header": "foo",
  "content": "bar",
  "poster": "John Doe"
}
  • GET
    • Description: Return a bounty with related comments
    • Status code:(200)
    • Auth:
      • Auth0 JWT
      • 'read' permissions
    • No JSON input
    • Example output
{
  "id": 1,
  "header": "foo",
  "content": "bar",
  "poster": "John Doe",
  "karma": 100,
  "comments": [
    {
      "id": 1,     
      "bountyId": 1,
      "header": "fizz",
      "content": "buzz",
      "poster": "Holly Doe",
      "karma": 100
    }
  ]
}
  • DELETE
    • Description: Delete bounty from table
    • Status code:(204)
    • Auth:
      • Auth0 JWT
      • 'delete' permissions
    • No JSON input

api/v1/comments

  • POST
    • Description: Creates a comment record to comments table
    • Status code:(200)
    • Auth:
      • Auth0 JWT
      • 'create' permissions
    • JSON input:
      • header:{string}
      • content:{string}
      • poster:{string}
    • Example output
{
  "id": 1,
  "bountyId": 1,
  "header": "fizz",
  "content": "buzz",
  "poster": "Holly Doe",
}

api/v1/comments/:id

  • PUT
    • Description: update a comment from comments table on an given id
    • Status code:(200)
    • Auth:
      • Auth0 JWT
      • 'update' permissions
    • JSON input:
      • header:{string}
      • content:{string}
      • poster:{string}
    • Example output
{
 "id": 1,
 "header":"fizz",
 "content":"buzz",
 "poster":"Holly Doe",
}
  • GET
    • Description: return a comment from comments table on an given id
    • Status code:(200)
    • Auth:
      • Auth0 JWT
      • 'read' permissions
    • No JSON input
    • Example output
{
  "id": 1,     
  "bountyId": 1,
  "header": "fizz",
  "content": "buzz",
  "poster": "Holly Doe",
  "karma": 100
}
  • DELETE
    • Description: delete a comment from comments table on an given id
    • Status code:(204)
    • Auth:
      • Auth0 JWT
      • 'delete' permissions
    • No JSON input

🏢 Entity Relationship Diagram

ERD

🚧 Our Repos

📦 Dependencies

🏡 Team

🔍 More Resources

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •