<aside> 💰 This is the backend design spec for CURaise, our fundraising platform.

</aside>

API Specification

Database tables:

  1. Student
    1. id: primary key
    2. name: String
    3. netid: String (UNIQUE)
    4. venmo_username : String (UNIQUE)
    5. venmo_id : String (UNIQUE) (calculated by venmo_username)
    6. clubs: Foreign Key (clubs a student has joined)
    7. email: String (UNIQUE) email, for authentication purposes
    8. password: String (UNIQUE) password, for authentication purposes
    9. Student can initiate individual fundraiser events (to sell their own stuff)
  2. Club
    1. id: primary key
    2. name: String
    3. description: String
    4. venmo_username: String (UNIQUE)
    5. venmo_id : String (UNIQUE) (calculated by venmo_username)
    6. members Foreign Key (members of the club)
    7. fundraisers: Foreign Key list of Fundraisers (one-to-many)
    8. email: String (UNIQUE) email, for authentication purposes
    9. password: String (UNIQUE) password, for authentication purposes
  3. Fundraiser
    1. id: primary key
    2. club_id : foreign key (The ID of the club) (one-to-one)
    3. title: String
    4. description: String
    5. active_status: boolean True or False (CASE INSENSITIVE)
    6. created_datetime: Datetime IN UTC (FORMAT AT ABOVE)
      1. NO NEED TO SUPPLY
    7. last_modified_datetime: Datetime in UTC (FORMAT AT ABOVE)
      1. NO NEED TO SUPPLY
    8. start_datetime: Datetime in UTC (FORMAT AT ABOVE)
    9. end_datetime: Datetime in UTC (FORMAT AT ABOVE)
    10. items Foreign Key fundraising item (one-to-many)
    11. members: list of strings, quota
      1. each member has a corresponding quota
      2. sales per member
    12. transactions: array of all transactions (one-to-many)
  4. Fundraiser Item
    1. id: primary key
    2. fundraiser: links to Fundraiser (many-to-one)
    3. name: String
    4. price: Float
    5. transactions: Foreign Key one-to-many with transaction
    6. image: String (link to URL of image)
      1. can have length constraint
    7. description: String
  5. Transaction
    1. id: primary key
    2. reference_string: a long, unique reference string based on …
    3. fundraiser: Fundraiser
    4. added_timestamp: db.DateTime
    5. item : fundraiser item
    6. payer: Student
    7. status: boolean
    8. referrer: User (optional)

General routes

Routes: students

  1. /api/students/signup (POST) → create a student ✅

    // post body
    {
    	"name": string,
    	"netid": string,
    	"venmo_username": string,
    	"venmo_id": string,
    	"email": string,
    	"password": string
    }
    
  2. /api/students/<student_id> (GET) → get a student by id ✅

    1. Checks if Venmo exists
  3. /api/students/netid/<student_netid> (GET) → get a student by netid ✅

  4. /api/students/<student_id>/edit (PUT) → update a student by student_id ✅

    // post body
    {
    	"student_id": string,
    	"netid": string,
    	"venmo_username": string,
    	"venmo_id": string,
    	"email": string,
    	"password": string
    }
    
  5. /api/students/netid/<student_netid>/edit (PUT) → update a student by student netid ✅

  6. /api/students/<student_id> (DELETE) → DELETE a student by id ✅

  7. /api/students/netid/<student_netid> (DELETE) → DELETE a student by netid ✅