Skip to content

Web26-Silent-Auction-1/BE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Back End

Hosted at https://bw-silent-auction-1.herokuapp.com/

API

Method Endpoint Need Auth? Description
GET / no API sanity check
POST /api/auth/register no adds new user to the database and returns token
POST /api/auth/login no returns a token
GET /api/auctions yes returns all active auctions
GET /api/auctions/:id yes returns an auction matching the id
POST /api/auctions yes, seller adds a new auction to the database (see auctions schema for required data)
PUT /api/auctions/:id yes, seller updates auction matching the id (see auctions schema for required data)
DELETE /api/auctions/:id yes, seller deletes auction matching the id
GET /api/bids yes returns all bids
GET /api/bids/:id yes returns all bids for the auction matching the id
POST /api/bids/:id yes, bidder adds a new bid the auction matching the id
POST /api/payments no submits payment information

Users Schema

Field Data Type Metadata
id unsigned integer primary key, auto-increments, generated by database
username string required, unique
password string required
user_type string required, two types: seller and bidder

Auctions Schema

Field Data Type Metadata
id unsigned integer primary key, auto-increments, generated by database
name string required
image string required
description string required
starting_price unsigned integer required
deadline datetime required
user_id unsigned integer required, foreign key referencing users.id

Bids Schema

Field Data Type Metadata
id unsigned integer primary key, auto-increments, generated by database
user_id unsigned integer required, foreign key referencing users.id
auction_id unsigned integer required, foreign key referencing auctions.id
amount unsigned integer required

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published