Code Monkey home page Code Monkey logo

cde-api's Introduction

Crazy Dutch Experience rest api

Endpoints:

Admin:

Register admin: POST - https://cde-v1.herokuapp.com/v1/register

Login admin: POST - https://cde-v1.herokuapp.com/v1/login

Admin Schema:

{
    name: 'your name',
    email: '[email protected]',
    password: 'pick a good one'
}

Participants:

create: POST - https://cde-v1.herokuapp.com/v1/campaign/particepent/create

Participants Schema

{
    name: 'your name',
    email: '[email protected]',
}

Recipe�s:

Create with existing participant: POST - https://cde-v1.herokuapp.com/v1/campaign/recipes/create/[participant_id]

Create without existing participant: POST - https://cde-v1.herokuapp.com/v1/campaign/recipes/create

Read all recipe: GET - https://cde-v1.herokuapp.com/v1/campaign/recipes

Read recipe by id: GET edit - https://cde-v1.herokuapp.com/v1/campaign/recipes/[recipe_id]

Like recipe: PUT - https://cde-v1.herokuapp.com/v1/campaign/recipes/like/[recipe_id]

Remove like from recipe: PUT removed - https://cde-v1.herokuapp.com/v1/campaign/recipes/[participant_id]/dislike/[recipe_id]

Remove recipe (Admin only): DELETE - https://cde-v1.herokuapp.com/v1/campaign/recipes/[recipe_id]/delete

Recipe Schema

{
    name: 'recipe name',
    body: 'Maybe you have a fun story about it...',
    particepent: participant_id,
    upvotes: 0,
    ingredients: ["array", "of", "ingredients"]
}

Ingredients

Create ingredient: POST - https://cde-v1.herokuapp.com/v1/campaign/ingredients/create

Read all ingredients: GET - https://cde-v1.herokuapp.com/v1/campaign/ingredients

Update ingredient: PUT - https://cde-v1.herokuapp.com/v1/campaign/ingredients/update/[ingredient_id]

Delete ingredient: DELETE - https://cde-v1.herokuapp.com/v1/campaign/ingredients/delete/[ingredient_id]

Ingredient Schema

{
    name: 'ingredient name',
    category: category_id,
    messurement: {
        unit: 'ml, g, etc',
        amount: [array, of, amounts]
    }
}

Categories

Create category: POST - https://cde-v1.herokuapp.com/v1/campaign/categories/create

Read all categories: GET - https://cde-v1.herokuapp.com/v1/campaign/categories

Read single category: GET - https://cde-v1.herokuapp.com/v1/campaign/categories/[category_id]

Update category: PUT - https://cde-v1.herokuapp.com/v1/campaign/categories/[category_id]

Category Schema

{
    name: 'category name',
    items: [array, of, ingredient, ids]
}

Content

Create a page: POST - https://cde-v1.herokuapp.com/v1/content/newpage

Create section for page: POST - https://cde-v1.herokuapp.com/v1/content/[page_id]/newsection

Read page: GET - https://cde-v1.herokuapp.com/v1/content/[page_id]

Read page sections: GET - https://cde-v1.herokuapp.com/v1/content/[page_id]/sections

Read single section: GET - https://cde-v1.herokuapp.com/v1/content/single/[section_id]

Update section: PUT - https://cde-v1.herokuapp.com/v1/content/update/[section_id]

Read all pages: GET - https://cde-v1.herokuapp.com/v1/content/pages

Page Schema

{
    pageTitle: 'your page title',
    contents: [array, of, section, ids],
    created_by: admin_id
}

Section Schema

{
  title: 'your title',
  contents: your content as an Object,
  belongs_to: page_id
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.