The backend server is running on AWS ec2 server instance. The node.js server uses express
- scp -i ./c1-hackathon.pem .\hackathon-backend.zip [email protected]:~
- node server.js &
- lt --port 4000 --subdomain c1hack
Public URL provided by localtunnel (lt): https://c1hack.localtunnel.me Note that node must be running on >=10.10.0. AWS ec2 server does not upgrade you to that so you must use node version manager (nvm)
Server accepts only GET requests. Base URL: https://c1hack.localtunnel.me
Returning users login to the app here
https://c1hack.localtunnel.me/raw
String
usernameString
password
JSON
userDetails - See example below:
{
status: true/false,
username: username,
name: name,
events:
{
event1: event1_name,
event2: event2_name
}
}
User registers to join the app
https://c1hack.localtunnel.me/register
String
usernameString
passwordString
nameString
event_type - Length 4 string (1 or 0s corresponding to each interest)Integer
money_req - 0, 1, or 2Integer
event_size - 0, 1, or 2
JSON
userDetails - See example below:
{
status: true/false,
username: username,
name: name,
events:
{
event1: event1_name,
event2: event2_name
}
}
List all sprints in order of most relevant to each user based on recommendation algorithm. Send a username to look up his/her interests and make recommendations based on minimum euclidean distance.
https://c1hack.localtunnel.me/sprints
String
username
JSON
sprints - See example below
{
sprints: [
{
name: sprint_name,
type: "public" or "private"
date: "date",
location: "location",
description: sprint_description,
picture: sprint_picture_url,
money: spring_money_required,
capacity: event_max_people,
numPeople: event_num_people
},
{
name: sprint_name2,
type: "public" or "private",
date: "date",
location: "location",
description: sprint_description2,
picture: sprint_picture_url2,
money: spring_money_required2,
capacity: event_max_people2,
numPeople: event_num_people2
},
...
]
}
Autocorrect if searched term returns 0 results. (A "did you mean this?" functionality)
https://c1hack.localtunnel.me/eventAutoCorrect
String
query
JSON
result - JSON of array of strings - See example below
{
result: [
"didyoumeanthis",
"didyoumeanthat"
]
}
Add a new event
https://c1hack.localtunnel.me/addEvent
String
name - Name of eventString
type - Type of event (private or public)String
date - Date of event in "DD-MM-YYYY" formatString
description - Description of eventString
picture - Picture URL for eventInteger
money - Min money required for eventInteger
capacity - Max capacity of participantsInteger
numPeople - Current number of people
Boolean
success - True if user successfully creates event. False otherwise (if name is not unique)
List details for event and comments that users have
https://c1hack.localtunnel.me/event
String
eventName
JSON
event - See example below
{
name: event_name,
type: "public" or "private",
date: "date",
location: "location",
description: event_description,
picture: event_pictuture_url,
money: event_money_required,
capacity: event_max_people,
numPeople: event_num_people,
comments: [
{
name: person1_name,
comment: person1_comment
},
{
name: person2_name,
comment: person2_comment
},
...
]
}
Add a user's comment to an event
https://c1hack.localtunnel.me/addComment
String
usernameString
eventName
Boolean
success - True if user successfully comments. False otherwise (shouldn't ever be false, but just as a precautionary measure)
User join an event/sprint. User will be added to the event
https://c1hack.localtunnel.me/joinEvent
String
username
Boolean
success - True if user successfully joins. False otherwise (shouldn't ever be false, but just as a precautionary measure)