Giter Site home page Giter Site logo

pursuit-core-web-nested-routing-app-structure-lab's Introduction

Pursuit-Core-Web-Nested-Routing-App-Structure-Lab

Build a backend for a recipe API. It should have the following functionality:

Planning

  • Think about what are you your main endpoints.
  • What endpoints will be nested under other endpoints
  • What type of request you will want to accept at a given endpoint: GET, POST, PUT?
  • What data would you need to provide to your endpoints.
    • Any URL or Query parameters in you endpoints?
    • Body data?
  • What should your endpoint return/respond with.

Optionally, in a file called docs.md plan and document your API before you start coding. You could do something like this or simpler.

Data Models

Recipes

  • Add a recipe
  • Update a recipe
  • Delete a recipe
  • Get all recipes
  • Get all recipes matching a given ingredient

A recipe object should look like this:

{
    name: "Grilled Cheese",
    ingredients: [
        "Bread",
        "Cheese",
        "Butter"
    ],
    directions: "Preheat skillet over medium heat. Generously butter one side of a slice of bread. Place bread butter-side-down onto skillet bottom and add 1 slice of cheese. Butter a second slice of bread on one side and place butter-side-up on top of sandwich. Grill until lightly browned and flip over; continue grilling until cheese is melted. Repeat with remaining 2 slices of bread, butter and slice of cheese."
}

Users

  • Add a user
  • Update a user
  • Delete a user
  • Get all users
  • Get all users with an activation date in a given range. Say we want all the users that where activated between 2019

A user object should look like this:

{
    username: "user1234",
    email: "[email protected]",
    activationDate: "January 1, 1970"
}

Bonus

  • Implement Users and Recipes in an more object oriented fashion ala Express-Project with classes and methods that are used in your route handlers/middleware.

  • Do you want to persist the data even after server resets? Look into how to save your data in JSON files to be stored in your disk here: Node.js Write JSON Object to File.

pursuit-core-web-nested-routing-app-structure-lab's People

Contributors

aminescodes avatar alejo4373 avatar benstone1 avatar

Watchers

James Cloos avatar

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.