Skip to content

Stress Induced Nightmare Fuel ad/content server and editor for IFixit

License

Notifications You must be signed in to change notification settings

aidanbx/sinf-ad-server

Repository files navigation

sinf-ad-server

Stress Induced Nightmare Fuel ad/content server and editor for IFixit

This was a qarter long class project for CSC-307: Intro to Software Engineering.

API Documentation

DRY Points

  1. All URLs are expected to be prefixed with https://domain.ext/api

  2. All responses are in JSON form

  3. Any data in path like: /{} is a request parameter, all else is in the body

  4. All response codes are in line with the Mozilla standard

    1. https://developer.mozilla.org/en-US/docs/Web/HTTP/Status

    Ad Data Object

  • adId

    • Stored in ad inventory with primary key as unique ad id/name
  • adName (63 char max)

    • User given name of the ad
  • imageLoc

    • The path where the image is located
  • mainText (63 char max)

    • User given main ad text
  • subText (255 char max)

    • User given secondary text
  • linkText

    • The text displayed that will act as a link
  • linkLoc (255 char max)

    • The http link to where the ad should redirect to
  • Height

    • Pixels
  • Width

    • Pixels
  • flightId

    • Flight id. String identifier of one of the available flights

    Ad Stats Object

  • adId

    • As in ad data object
  • adName

    • As in ad data object
    • flightId
    • As in ad data object
  • impressions

  • clicks

  • conversions

Decision API

    /decide
  • GET
    • In body of request contain:
      • zoneSize
      • deviceType
    • Returns an ad object with flight matching deviceType and size within zoneSize

Inventory API

```
/inventory
```
  • POST

    • In body of request contain:
      • image (2mb max, binary data)
      • Ad object as detailed above
    • Stores the ad image data in inventory storage
    • Sends POST to /report/{adId}
    • Returns a JSON object denoting POST status, adId, and all given data
  • GET

    • Returns an array of all ad objects stored
    /inventory/{adId}
    
  • GET

    • Returns the ad object with given adID
  • PUT

    • Body contains a partially or entirely full ad object
    • Given values will update existing values for ad with given adId
  • DELETE

    • Deletes ad with adId
 /inventory/flights
  • GET

    • Returns an array of all available flights
    /inventory/flights/{flightId}
    
  • GET

    • Returns an array of all ads in flight flights

Reporting API

 ```
/reports/{adId}
```
  • PUT

    • Takes in partially or entirely full ad stats object
    • Updates previous stats with given stats for a specific ad.
  • POST

    • Creates the first entry for a new ad with 0 for all stats
    • Dev note: call this when putting a new ad in the inventory
  • GET

    • Returns an ad stats object with given adId
    /reports/{flightId}
    
  • GET

    • Returns array of ad stats objects which all have given flightId

About

Stress Induced Nightmare Fuel ad/content server and editor for IFixit

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •