Giter VIP home page Giter VIP logo

backendtoyota's Introduction

Once you have the clone then do

  • npm i

then run the server

  • npm run dev

DATABASE

MONGODB ATLAS ACCOUNT

  • copy uri link to the .env file

PROBLEM ENDPOINTS

LOCAL HOST

The server url

HTTP REQUEST

(POST http request) ==>> /api/v1/problems

  • Publish a problem

(GET http request) ==>> /api/v1/problems

  • display all problem.

Applied the search query in the database

  • search() ==>> search with keywords inside the "title" and "description" fields in the document.
  • sort() ==>> display documents in ascending order.

(GET http request) ==>> /api/v1/problem/:id

  • search for a single problem

(DELETE http request) ==>> /api/v1/problem/:id

  • delete a single problem

SOLUTION ENDPOINTS

(POST http request) ==>> /api/v1/solutions

  • propose a solution

(GET http request) ==>> /api/v1/solutions

  • display all solutions in the database.

Applied the search query in the database

  • search() ==>> search with keywords inside the "title" and "description" fields in the document.
  • sort() ==>> display documents in ascending order.

(GET http request) ==>> /api/v1/solution/:id

  • search for a single a solution

(DELETE http request) ==>> /api/v1/solution/:id

  • delete solution with id

COMMENTS ENDPOINTS

(POST http request) ==>> /api/v1/:solutionId/comments

  • add comments
  • this would display the title of comment and full comments so you add comment to title, description , totalBudgget, successMeasure
  • ["title","description","totalBudget","successMeasure"]

(GET http request) ==>> /api/v1/:solutionId/comments

  • display all solutions in the database.

Auth

  • jwt token was used for authenticating the user with the wallet address

Register

Login

User login walletAdress and if it doesn't exist its create one and signin.

  • "walletAddress":"ayg612eisaicbkwo9u98w"

  • (POST http request) ==>> /api/v1/auth/login accept user

  • please note that authentication uses jsonwebtoken

  • we have protected routes only authenticated user can add and delete a problem and solution and also make upvotes

FOR UPVOTE (protected route)

user can create and removes upvotes from problem and a propose solution

problem upvotes

(POST http request) ==>> /api/v1/problems/problemId/create-upvote

  • Add an upvote (DELETE http request) ==>> /api/v1/problems/problemId/remove-upvote
  • Remove an upvote (GET http request)===>> /api/v1/problems/problemId/upvotes
  • return all solutions with upvotes (GET http request) ===>> /api/v1/problems/upvotes/upvoteId
  • return a single upvote

solution upvotes

(POST http request) ==>> /api/v1/solutions/solutionId/create-upvote

  • Add an upvote (DELETE http request) ==>> /api/v1/solutions/solutionId/remove-upvote
  • Remove an upvote (GET http request)===>> /api/v1/solutions/solutionId/upvotes
  • return all solutions with upvotes (GET http request) ===>> /api/v1/soltuions/upvotes/upvoteId
  • return a single upvote

backendtoyota's People

Contributors

philip-d21 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.