Coder Social home page Coder Social logo

todo-api's Introduction

Hi there ๐Ÿ‘‹

todo-api's People

Contributors

skrmain avatar

Watchers

 avatar

Forkers

skrwebstart

todo-api's Issues

Update APIs response Structure

Example Success Response

  • URL: GET:/users?pageSize=10&pageNumber=1
{
  "metadata": {
    "totalCount": 100,
    "pageSize": 10,
    "pageNumber": 1,
    "sortBy": "name",
    "sortOrder": "asc"
  },
  "status": true,
  "message": "Success",
  "data": [{}, {}]
}

Release v0.2

  • Add morgan
  • Push image to Docker Hub
  • Check for change log auto generate using Issues Done

Fix the total of Order Model

Current

  • Storing the total of Each Product Separately

Expected

  • Should store the total of complete order

Todo

  • Move the field from ProductInfo Model to Order Model
  • Fix the Logic while placing the order /checkout

Store Price of Product at time of placing the order

  • Update the Model ProductInfo Model name to OrderProductInfo
  • Add new Field (price) in Model
  • All logic in '/checkout' to store price
  • Also, Update the ProductInfo Model name to CartProductInfo in cart app

Update Eslint Configurations

  • Both VSCode Linting and ESlint woring -- show Issues multiples times in Editor

  • ESLint not able to catch issues, but VSCode Lint able to catch those

  • Example : ESLint not able to catch variable redeclare Issue
    image

[find] Check if `cors` can be removed without any sideffect

Custom CORS handling Code Example

app.use((req, res, next) => {
  res.header("Access-Control-Allow-Origin", "*");
  res.header(
    "Access-Control-Allow-Headers",
    "Origin, X-Requested-With, Content-Type, Accept, Authorization"
  );
  if (req.method === "OPTIONS") {
    res.header("Access-Control-Allow-Methods", "PUT, POST, PATCH, DELETE, GET");
    return res.status(200).json({});
  }
  next();
});

TODOs

Refactoring

Code Structure Changes

  • Separate code into index, server files
  • Move common coded to shared folder files
  • Separate user into user and auth
  • Auth for login, register
  • Setup Prettier, ESLint, editorconfig
  • Setup Husky
  • Error handling, success/fail response sending
  • Move code of controller to routes only and separate controller not needed

Implement Image Storage

  • Store Images in MongoDB
  • Store Images in S3

  • Make it pluggable, what ever we will set, as a ExpressJS middleware it will store the images there

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.