Skip to content

jin0s/UniversityEvents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Table of Contents

  1. Quick Start
  2. DBS Connection
  3. API WRITEUP
  4. App Info

Quick Start

# Install dependencies for server
npm install

# Install dependencies for client
npm run client-install

# Run the client & server with concurrently
npm run dev

# Run the Express server only
npm run server

# Run the React client only
npm run client

# Server runs on http://localhost:5000 and client on http://localhost:3000

DBS Connection

For some reason the MySQL wont support password protocol by default so we will have to modify the user previledges. Run the following query.

CREATE USER 'dev'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
FLUSH PRIVILEGES;

API WRITEUP

  1. Signup
  2. Login
  3. Events
    1. Create Events
    2. Get List of All Available Events
    3. Get All User Events
    4. Get Public Events By University
    5. Get Events By ID
    6. Get Event Category List
    7. Modify Event
  4. RSO
    1. Get List of RSOs Avaiable To User
    2. Get RSOs by Id
    3. Join RSO
    4. Create RSO
  5. Universities
    1. Create Universitiess
  6. Admins
    1. Create Admins
    2. Change Admins
  7. Super Admins
    1. Assign Super Admins
    2. Get SuperAdmin ById
  8. Comments
    1. Add a comment and rating to an event

Signup

/api/signup

Expects

{
  "username": "example@knights.ucf.edu",
  "password": "123456",
  "name": "test"
}

Returns

On Success:

{
  "status": "0"
}

Otherwise:

 {
   "status": "ERRORED"
 }

Login

/api/login

Expects

{
  "username": "example",
  "inputPassword": "12345"
}

Returns

On Success:

{
  "status": "0"
}

Otherwise:

 {
   "status": "1"
 }

Events

Create Events

/api/create_event

Expects If the event is private or public, you do not need to pass it an RSO ID. If the event is an RSO event you will need to pass it an RSO ID

{
  "event_category": "1",
  "name": "antisocial social event",
  "datetime": "2019-10-29 12:00:00",
  "description": "Anti Social Social Club (sometimes stylized as ASSC and AntiSocialSocialClub) is a streetwear brand founded by Neek Lurk,[1][2] who previously worked for Stussy as a social marketing manager..[3][4]The brand has collaborated with A Bathing Ape,[5] Dover Street Market,[6], Playboy,[7][8] and Hello Kitty.[9]",
  "contact_phone": "4075555050",
  "contact_email": "test@knights.ucf.edu",
  "admin_id": "admin@knights.ucf.edu",
  "rso_id": "1",
  "event_type": "public/private/rso"
}

Returns

On Success:

{
  "status": "0"
}

Otherwise:

 {
   "status": "ERRORED"
 }

Get List of All Available Events For The User

/api/event Expects

{
  "username": "c.le93@knights.ucf.edu",
  "accesstoken": "22",
  "event_type": "rso/private/public"
}

Returns

On Success:

{
  "username": "c.le93@knights.ucf.edu",
  "event_type": "rso",
  "results": [
    [
      {
        "students": "c.le93@knights.ucf.edu",
        "id": 1,
        "name": "antisocial social event",
        "datetime": "2019-10-29T16:00:00.000Z",
        "description": "Anti Social Social Club (sometimes stylized as ASSC and AntiSocialSocialClub) is a streetwear brand founded by Neek Lurk,[1][2] who previously worked for Stussy as a social marketing manager..[3][4]The brand has collaborated with A Bathing Ape,[5] Dover Street Market,[6], Playboy,[7][8] and Hello Kitty.[9]",
        "contact_phone": "4075555050",
        "contact_email": "test@knights.ucf.edu",
        "event_type": "Social",
        "event_id": 1,
        "RSO_id": 1
      }
    ],
    {
      "fieldCount": 0,
      "affectedRows": 0,
      "insertId": 0,
      "info": "",
      "serverStatus": 2,
      "warningStatus": 0
    }
  ]
}

On Zero Result:

{
  "username": "c.le93@knights.ucf.edu",
  "event_type": "",
  "results": "No results"
}

On Error:

{
  "status": "ERRORED"
}

Get List of Public Events By University

/api/event Expects

METHOD: GET
/api/events/?uni=1

Returns

On Success:

Get Details of Events by ID

/api/event Expects

METHOD: GET
/api/events/?id=1

Returns

On Success:

[
  {
    "id": 1,
    "event_type_id": 1,
    "name": "antisocial social event",
    "datetime": "2019-10-29T16:00:00.000Z",
    "description": "Anti Social Social Club (sometimes stylized as ASSC and AntiSocialSocialClub) is a streetwear brand founded by Neek Lurk,[1][2] who previously worked for Stussy as a social marketing manager..[3][4]The brand has collaborated with A Bathing Ape,[5] Dover Street Market,[6], Playboy,[7][8] and Hello Kitty.[9]",
    "contact_phone": "4075555050",
    "contact_email": "test@knights.ucf.edu"
  }
]

Get List Of Event Category

/api/event

Expects

METHOD: GET
/api/events_categories

Returns

On Success:

[
  { "id": 1, "name": "Social" },
  { "id": 2, "name": "Fundraiser" },
  { "id": 3, "name": "Informational" },
  { "id": 4, "name": "General Body Meeting" },
  { "id": 5, "name": "Networking" }
]

Modify Event

/api/

RSO

Get RSO Avaiable To The User

/api/user_rso/?id=x

Expects

METHOD GET:
/api/rsos/?user_id=userid@knights.ucf.edu

you can set id to any valid id values

Returns

[
  [
    { "id": 1, "name": "Antisocial Social Club" },
    { "id": 2, "name": "RSOnameTest" },
    { "id": 3, "name": "PostMan Test" },
    { "id": 4, "name": "passuniid" },
    { "id": 6, "name": "testautocreateadmin" }
  ],
  {
    "fieldCount": 0,
    "affectedRows": 0,
    "insertId": 0,
    "info": "",
    "serverStatus": 34,
    "warningStatus": 0
  }
]

Get RSO By ID

/api/rsos/?id=x

Expects

METHOD GET:
/api/rsos/?id=6

you can set id to any valid id values

Returns

[
  {
    "id": 6,
    "user_id": "c.le93@knights.ucf.edu",
    "name": "testautocreateadmin",
    "status": 1
  }
]

Join RSO

/api/join_rso

Expects

{
  "user_id" : "userid@knights.ucf.edu",
  "rso_id" : "1",
}

Returns

{
  "status": "0"
}

Create RSO

/api/create_rso Expects

{
  "admin_id" : "userid1",
  "user_id1" : "userid2",
  "user_id2" : "userid3",
  "user_id3" : "userid4",
  "user_id4" : "userid5",
  "name" : "RSONameClubYea"
  "admin_university_id" : "(int) 1"
}

Returns

On Success: The API will auto assign the user to an admin role of the RSO on creation

{
  "status": "0"
}

On failed to create because the atleast one of the students are not registered on the Users table. This does not tell you which of the inputs are wrong so make sure the username of the student is spelled correctly:

 {
   "status": "1"
 }

On failed to create because the admin is already associated with another university and is trying to create a new RSO under another university

 {
   "status": "2"
 }

On Error:

 {
   "status": "ERRORED"
 }

Universities

Create Universities

/api/create_universities Expects

{
  "id": "12345",
  "super_user_id": "userid1",
  "name": "example",
  "pictures": "pic_url",
  "location_address": "example",
  "num_of_students": "1000"
}

Returns

On Success:

{
  "status": "0"
}

Otherwise:

 {
   "status": "ERRORED"
 }

Admins

Get RSO By ID

/api/rsos/?id=x

Expects

METHOD GET:
/api/rsos/?id=6

you can set id to any valid id values

Returns

[
  {
    "id": 6,
    "user_id": "c.le93@knights.ucf.edu",
    "name": "testautocreateadmin",
    "status": 1
  }
]

Create Admins

/api/create_adminss Expects

{
  "user_id": "userid1",
  "university_id": "12345"
}

Returns

On Success:

{
  "status": "0"
}

Otherwise:

{
  "status": "ERRORED"
}

Change Admins

/api/change_admin Expects user_id is the person getting promoted to administrator admin_id is the person who is giving up their role

{
  "user_id": "userid1",
  "admin_id": "12345"
}

Returns

On Success:

{
  "status": "0"
}

On Failure

{
  "status": "ERRORED"
}

Super Admins

Assign Super Admins

/api/assign_super_admins Expects

{
  "user_id": "userid1"
}

Returns

On Success:

{
  "status": "0"
}

Otherwise:

{
  "status": "ERRORED"
}

Get Super Admin By Id

/api/getSuperAdminById Expects

{
  "user_id": "userid1"
}

Returns

On Success:

{
  "user_id": "userid1"
}

Otherwise:

{
  "status": "ERRORED"
}

Comment

/api/comment

Expects

{
  "user_id": "userid@knights.ucf.edu",
  "event_id": "1",
  "description": "this is the comment description",
  "rating": "5"
}

Returns

On Success:

{
  "status": 0
}

Otherwise:

{
  "status": "ERRORED"
}

App Info

Author

Jin Le
Jiayi Zhang

Version

1.0.0

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published