# 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
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/signup
Expects
{
"username": "example@knights.ucf.edu",
"password": "123456",
"name": "test"
}
Returns
On Success:
{
"status": "0"
}
Otherwise:
{
"status": "ERRORED"
}
/api/login
Expects
{
"username": "example",
"inputPassword": "12345"
}
Returns
On Success:
{
"status": "0"
}
Otherwise:
{
"status": "1"
}
/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"
}
/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"
}
/api/event Expects
METHOD: GET
/api/events/?uni=1
Returns
On Success:
/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"
}
]
/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" }
]
/api/
/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
}
]
/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
}
]
/api/join_rso
Expects
{
"user_id" : "userid@knights.ucf.edu",
"rso_id" : "1",
}
Returns
{
"status": "0"
}
/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"
}
/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"
}
/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
}
]
/api/create_adminss Expects
{
"user_id": "userid1",
"university_id": "12345"
}
Returns
On Success:
{
"status": "0"
}
Otherwise:
{
"status": "ERRORED"
}
/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"
}
/api/assign_super_admins Expects
{
"user_id": "userid1"
}
Returns
On Success:
{
"status": "0"
}
Otherwise:
{
"status": "ERRORED"
}
/api/getSuperAdminById Expects
{
"user_id": "userid1"
}
Returns
On Success:
{
"user_id": "userid1"
}
Otherwise:
{
"status": "ERRORED"
}
/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"
}
Jin Le
Jiayi Zhang
1.0.0