Git Product home page Git Product logo

blog-crud-app's Introduction

LEARNING CRUD

What is CRUD

  • Create
  • Read
  • Update
  • Delete

CRUD Application (BACKEND)

A blog CRUD Application

  • CREATE

    • Creating the blog post
    • Creating a new user
    • Comments (replies to comments)

    example for creating a user

    // you've imported some packages to handle database
    
    function createUse(username, email, password) {
        if (db.findUser(username)) {
      	return; // end execution because the user already exists
        }
        
        // we are creating a user!
        db.create(username, email, password);
    }

    Creating a blog post

    function createPost(postDate, postTitle, description, author, body) {
        const postsByAuthor = db.findPostByAuthor(author);
        
        if (postsByAuthor.find((title) postTitle == title)) {
      	return; // end execution
        }
    
        // creating a post
        db.create(postDate, postTitle, description, author, body);
    }
  • READ (GET)

    • Get posts /api/posts/12345678 -> return post with id 12345678
      • Get a post by author
      • Get a post by id
      • Get posts with a specific date range (Jan 1 - May 30)
      • Get post by title
    • Get Users (All the peeps who registered for your blog)
    • Get all the comments
      • Get comments by author
      • Get comments by id
      • Get comments by date
  • UPDATE

    • Edit Posts
    • Edit Comments
    • Edit Profile
    function updatePost(postId, updatePostBody) {
        db.updatePost(postId, updatePostBody);
    }
    function updateComment(commentId, updateCommentBody) {
        db.updateComment(commentId, updateCommentBody);
    }
  • DELETE

    • Delete Post
    • Delete Comment
    • Delete Profile
    function deletePost(postId) {
        db.deletePost(postId);
    }
    function deleteComment(commentId) {
        db.deleteComment(commentId);
    }

CRUD Application (FRONTEND)

Blog Application frontend

blog-crud-app's People

Contributors

hsheikhali1p avatar

Watchers

 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.