# Backend Endpoints Server accepts only GET requests. URL: `https://c1hack.localtunnel.me` ### login [DONE] Returning users login to the app here ###### Endpoint ``` localhost:4000/raw ``` ###### Parameters - **<code>String</code> username** - **<code>String</code> password** ###### Return Format - **<code>JSON</code> userDetails** - See example below: ```json { status: true/false, username: username, name: name, events: { event1: event1_name, event2: event2_name } } ``` --- ### register [DONE] User registers to join the app ###### Endpoint ``` localhost:4000/register ``` ###### Parameters - **<code>String</code> username** - **<code>String</code> password** - **<code>String</code> name** - **<code>String</code> event_type** - Length 4 string (1 or 0s corresponding to each interest) - **<code>Integer</code> money_req** - 0, 1, or 2 - **<code>Integer</code> event_size** - 0, 1, or 2 ``` ###### Return Format - **<code>JSON</code> userDetails** - See example below: ```json { status: true/false, username: username, name: name, events: { event1: event1_name, event2: event2_name } } ``` --- ### sprints 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. ###### Endpoint ``` localhost:4000/sprints ``` ###### Parameters - **<code>String</code> username** ###### Return Format - **<code>JSON</code> sprints** - See example below ```json { 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 }, ... ] } ``` --- ### eventAutoCorrect [will be done later] Autocorrect if searched term returns 0 results. (A "did you mean this?" functionality) ###### Endpoint ``` localhost:4000/eventAutoCorrect ``` ###### Parameters - **<code>String</code> query** ###### Return Format - **<code>JSON</code> result** - JSON of array of strings - See example below ```json { result: [ "didyoumeanthis", "didyoumeanthat" ] } ``` --- ### addEvent [DONE] Add a new event ###### Endpoint ``` localhost:4000/addEvent ``` ###### Parameters - **<code>String</code> name** - Name of event - **<code>String</code> type** - Type of event (private or public) - **<code>String</code> date** - Date of event in "DD-MM-YYYY" format - **<code>String</code> description** - Description of event - **<code>String</code> picture** - Picture URL for event - **<code>Integer</code> money** - Min money required for event - **<code>Integer</code> capacity** - Max capacity of participants - **<code>Integer</code> numPeople** - Current number of people ###### Return Format - **<code>Boolean</code> success** - True if user successfully creates event. False otherwise (if name is not unique) --- ### event [DONE] List details for event and comments that users have ###### Endpoint ``` localhost:4000/event ``` ###### Parameters - **<code>String</code> eventName** ###### Return Format - **<code>JSON</code> event** - See example below ```json { 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 }, ... ] } ``` --- ### addComment [DONE] Add a user's comment to an event ###### Endpoint ``` localhost:4000/addComment ``` ###### Parameters - **<code>String</code> username** - **<code>String</code> eventName** ###### Return Format - **<code>Boolean</code> success** - True if user successfully comments. False otherwise (shouldn't ever be false, but just as a precautionary measure) --- ### joinEvent [DONE] User join an event/sprint. User will be added to the event ###### Endpoint ``` localhost:4000/joinEvent ``` ###### Parameters - **<code>String</code> username** ###### Return Format - **<code>Boolean</code> success** - True if user successfully joins. False otherwise (shouldn't ever be false, but just as a precautionary measure) ---