Giter VIP home page Giter VIP logo

digital-cow-hut-backend's Introduction

Digital Cow Hut Admin With Auth

Application Routes:

Auth (User)

Auth (Admin)

User

Cows

Orders

Admin

My Profile

Order:



Digital Cow Hut Admin With Auth Overview

Auth, Admin, User, Profile, Cow, Order

Auth APIs :

{
    "password": "123",
    "role": "buyer",
    "name": {
        "firstName": "Mr. John",
        "lastName": "Doe"
    },
    "phoneNumber": "0181111110",
    "address": "Mymensingh",
    "budget": 270000,
    "income": 0
}
{ "phoneNumber": "0160000000", "password": "123" }
  • Refresh Token : https://digi-cow-hut-auth.vercel.app/api/v1/auth/refresh-token (POST) ✅
    • accessToken expires.
      • get refreshToken from browser cookies.
      • verity & retrieve data from token's payload
      • user exists at db?.
    • Next create: new accessToken (send in response) & refreshToken (set at browser cookies).
    • Request :
      • Cookies :
{ "refreshToken": "" }

Admin APIs :

{
    "password": "12345678",
    "role": "admin",
    "name": {
        "firstName": "Mr. Big",
        "lastName": "Boss"
    },
    "phoneNumber": "0160000000",
    "address": "Khulna"
}
{ "phoneNumber": "0160000000", "password": "123" }

User APIs :

{
    "password": "123",
    "role": "seller",
    "name": {
        "firstName": "Mr. John",
        "lastName": "Wick"
    },
    "phoneNumber": "0160000000",
    "address": "Dhaka",
    "budget": 0,
    "income": 0
}

Profile APIs :

{
    "password": "123",
    "name": {
        "firstName": "Md. Updated",
        "lastName": "Khan"
    },
   "phoneNumber": "0160000000"
}

Cows & Orders APIs:

Cows

{
  "name": "Sultan",
  "age": 3,
  "price": 70000,
  "location": "Mymensingh",
  "breed": "Kankrej",
  "weight": 150,
  "label": "for sale",
  "category": "DualPurpose",
  "seller": "64ab858c177ebb80e6a1072b" // seller === user id
}
{
  "name": "Sultan",
  "age": 3,
  "price": 37000,
  "location": "Mymensingh",
  "breed": "Kankrej",
  "weight": 157,
  "label": "for sale",
  "category": "DualPurpose",
  "seller": "64ab858c177ebb80e6a1072b" // seller === user id
}

Orders APIs:

  • Create Order : https://digi-cow-hut-auth.vercel.app/api/v1/orders (POST) ✅
    • database write operations:
      • seller income addition
      • buyer budget deduction
      • cow.label : sold out
      • save data on order collection
    • login required: buyer
    • Request :
      • Headers : { accessToken:""}
      • Body : NB. buyer must be user id.
{
  "cow": "64abc88f8c7e1773eb5b69d6",
  "buyer": "64ab88e30d765eeea9b69a81"   // buyer must login user
}

digital-cow-hut-backend's People

Contributors

shahariarrahman avatar

Stargazers

Ramazan Çetinkaya avatar Shahrad Elahi avatar Mr. Nobody avatar  avatar

Watchers

 avatar

Forkers

raihaanshaarif

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.