A third year assignment which included developing a frontend and a backend to host and serve conference data. I gained a mark of 77%.
The frontend was coded using React and Tailwind CSS.
The backend made use of PHP, Firebase JWT and an SQLite databse for users and conference data.
I learned a lot from this assignment. If I had more time I would have liked to clean the components up more and make the React code more readable. Additionally, I would have liked to make the API Restful or HATEOAS, as well as, writing unit tests to test the functionallity of the API and frontend.
To test the account functionallity you can use this email address and password combination
Email: john@example.com
Password: examplePassword1234
All endpoints will start with the URL: https://w19011575.nuwebspace.co.uk/assignment/api/ and all return JSON data
The frontend application is deployed on https://w19011575.nuwebspace.co.uk/assignment-frontend/
-
A call is made to the
GETendpoint -
The endpoint will return a JSON response with the developer's name and code
{
"name": "Reece Carruthers",
"code": "W19011575"
}- A call is made to the
GETendpoint - The endpoint will return a JSON response with a list of all the countries relating to the conference
- Incorrect HTTP method was passed to the endpoint e.g POST
{
"data": [
{
"country": "Australia"
},
{
"country": "United States"
}
]
}- Optional param list for endpoint 3
- limit - Sets the maximum number of preview videos to be returned
- A call is made to the
GETendpoint - The endpoint will return a JSON response with a list of all the titles of research which have preview videos attached in random order, additionally the endpoint will return the ID of the content.
- Incorrect HTTP method was passed to the endpoint e.g POST
- Limit parameter was passed with the incorrect data type or semantic errors
{
"data": [
{
"content_id": 96238,
"title": "It Made Me Feel So Much More at Home Here: Patient Perspectives on Smart Home Technology Deployed at Scale in a Rehabilitation Hospital",
"preview_video": "https://www.youtube.com/watch?v=EVAXd7ipvFw"
},
{
"content_id": 96518,
"title": "Physically Situated Tools for Exploring a Grain Space in Computational Machine Knitting",
"preview_video": "https://www.youtube.com/watch?v=VJaTztiGT80"
}
]
}- Optional param list for endpoint 4
- contentID - Returns all relating rows with the specified content ID
- country - Returns all relating rows with the specified country (case sensitive)
Note - You can only use contentID parameter by itself and not with the country parameter.
- A call is made to the
GETendpoint - The endpoint will return a JSON response with a list of associated research each author is related with
- The country parameter was passed and resulted in no data being found
- The contentID parameter was passed and resulted in no data being found
- Incorrect HTTP method was passed to the endpoint e.g POST
- Parameters were passed with the incorrect data types or semantic errors
GEToperation with no parameters
{
"data": [
{
"author_id": 91994,
"author_name": "Devansh Saxena",
"content_id": 96102,
"content_title": "Rethinking \"Risk\" in Algorithmic Systems Through A Computational Narrative Analysis of Casenotes in Child Welfare",
"affiliation_country": "United States",
"affiliation_city": "Milwaukee",
"affiliation_institution": "Marquette University"
},
{
"author_id": 91995,
"author_name": "Ioanna Lykourentzou",
"content_id": 96540,
"content_title": "Tasks of a Different Color: How Crowdsourcing Practices Differ per Complex Task Type and Why This Matters",
"affiliation_country": "Netherlands",
"affiliation_city": "Utrecht",
"affiliation_institution": "Utrecht University"
}
]
}GEToperation with a incorrect type parameter, resulting in no data being found
{
"data": []
}GET https://w19011575.nuwebspace.co.uk/assignment/api/content?page=[Option[Int]]&type=[Option[String]]
- Optional param list for endpoint 5
- page - Returns a JSON response with 20 records, each page offsets the result by 20 e.g page 1 has the first 20, page 2 has the next 20.
- type - Returns all relating rows with the specified type
- type=listTypes - Returns a JSON response with a list of all the types of content
- contentID - Returns all relating rows with the specified content ID, can only be used by itself
- Note - The award_name value will be null if the associated content has no award, if it has an award the award_name value will be the name of the award.
- A call is made to the
GETendpoint - The endpoint will return a JSON response with a list of research content includes the title, award_name (null if it does not have a reward), abstract (can be null) and type.
- The page or type parameter resulted in no data being found, so a empty data array is sent back along with pagination information.
- The contentID parameter was passed and resulted in no data being found
- Incorrect HTTP method was passed to the endpoint e.g POST
- Parameters were passed with the incorrect data types or semantic errors
- Incorrect combination of parameters were passed
- 'GET' request without contentID parameter
{
"data": [
{
"content_id": 95692,
"content_title": "Older Adults Using Technology for Meaningful Activities During COVID-19: An Analysis Through the Lens of Self-Determination Theory",
"content_abstract": "Restrictions during the COVID-19 pandemic significantly affected people's opportunities to engage in activities that are meaningful to their lives. In response to these constraints, many people, including older adults, turned to digital technologies as alternative ways to pursue meaningful activities. These technology-mediated activities, however, presented new challenges for older adults' everyday use of technology. In this paper, we investigate how older adults used digital technologies for meaningful activities during COVID-19 restrictions. We conducted in-depth interviews with 40 older adults and analyzed the interview data through the lens of self-determination theory (SDT). Our analysis shows that using digital technologies for meaningful activities can both support and undermine older people's three basic psychological needs for autonomy, competence, and relatedness. We argue that future technologies should be designed to empower older adults' content creation, engagement in personal interests, exploration of technology, effortful communication, and participation in beneficent activities.",
"content_type": "Paper",
"award_name": null
},
{
"content_id": 95693,
"content_title": "VizProg: Identifying Misunderstandings by Visualizing Students' Coding Progress",
"content_abstract": "Programming instructors often conduct in-class exercises to help them identify students that are falling behind and surface students' misconceptions. However, as we found in interviews with programming instructors, monitoring students' progress during exercises is difficult, particularly for large classes. We present VizProg, a system that allows instructors to monitor and inspect students' coding progress in real-time during in-class exercises. VizProg represents students' statuses as a 2D Euclidean spatial map that encodes the students' problem-solving approaches and progress in real-time. VizProg allows instructors to navigate the temporal and structural evolution of students' code, understand relationships between code, and determine when to provide feedback. A comparison experiment showed that VizProg helped to identify more students' problems than a baseline system. VizProg also provides richer and more comprehensive information for identifying important student behavior. By managing students' activities at scale, this work presents a new paradigm for improving the quality of live learning.",
"content_type": "Paper",
"award_name": "Honourable mention"
}
],
"pagination": {
"total": 1544,
"pages": 78
}
}- 'GET' request with contentID parameter
{
"data": [
{
"content_id": 95692,
"content_title": "Older Adults Using Technology for Meaningful Activities During COVID-19: An Analysis Through the Lens of Self-Determination Theory",
"content_abstract": "Restrictions during the COVID-19 pandemic significantly affected people's opportunities to engage in activities that are meaningful to their lives. In response to these constraints, many people, including older adults, turned to digital technologies as alternative ways to pursue meaningful activities. These technology-mediated activities, however, presented new challenges for older adults' everyday use of technology. In this paper, we investigate how older adults used digital technologies for meaningful activities during COVID-19 restrictions. We conducted in-depth interviews with 40 older adults and analyzed the interview data through the lens of self-determination theory (SDT). Our analysis shows that using digital technologies for meaningful activities can both support and undermine older people's three basic psychological needs for autonomy, competence, and relatedness. We argue that future technologies should be designed to empower older adults' content creation, engagement in personal interests, exploration of technology, effortful communication, and participation in beneficent activities.",
"content_type": "Paper",
"award_name": null
}
]
}- 'GET' request with the type=listTypes parameter
{
"data": [
{
"name": "Course"
},
{
"name": "Demo"
},
{
"name": "Doctoral Consortium"
},
{
"name": "Event"
},
{
"name": "Late-Breaking Work"
},
{
"name": "Paper"
},
{
"name": "Poster"
},
{
"name": "Work-in-Progress"
},
{
"name": "Workshop"
},
{
"name": "Case Study"
},
{
"name": "Panel"
},
{
"name": "AltCHI"
},
{
"name": "SIG"
},
{
"name": "Keynote"
},
{
"name": "Interactivity"
},
{
"name": "Journal"
},
{
"name": "Symposia"
},
{
"name": "Competitions"
}
]
}- 'GET' request with type/page parameter resulting in no data being found
{
"data": [],
"pagination": {
"total": 0,
"pages": 0
}
}- A email and password must be passed via the Authorisation header in the format of
email:password
- A call is made to the
GETendpoint - A call is made to the
POSTendpoint - The endpoint will return a JSON response with a bearer token valid for 30 minutes.
- Incorrect email or password were passed to the endpoint
- Incorrect HTTP method was passed to the endpoint e.g DELETE, PUT
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxIiwiaWF0IjoxNzAzMDg2MjcwLCJleHAiOjE3MDMwODgwNzAsImlzcyI6IncxOTAxMTU3NSJ9.x0sZtJ3rq9L-foN2Jo_gJHCS8DR1WLmUPc_6StFivYM"
}- A valid bearer token must be passed to the endpoint via the Authorisation header, a valid bearer token can be obtained from the token endpoint
- A call is made to the
GETendpoint -
- The endpoint will return a JSON response with a list of notes relating to the content ID/user depending on parameters passed to the endpoint
-
- If no data is found, the endpoint will return a empty data array
-
- A call is made to the
POSTendpoint
- A call is made to the
-
- The endpoint will return the JSON of the row that has been added
- A call is made to the
PUTendpoint -
- The endpoint will return the JSON of the row that has been updated
- A call is made to the
POSTendpoint -
- The endpoint will return the JSON of the new row that has been added
- A call is made to the
DELETEendpoint -
- The endpoint will return a empty JSON response on successful deletion
- Invalid bearer token was passed to the endpoint e.g expired
- On a PUT request if the noteID does not exist, the request will fail with a 404.
- On a DELETE request if the noteID does not exist, the request will fail with a 404.
- Incorrect HTTP method was passed to the endpoint
- Parameters were passed with the incorrect data types or semantic errors
- Invalid parameters were passed for a specific request method
- POST failed due to a database error
{
"data": [
{
"note_id": 1,
"content_id": 95692,
"note_text": "Test note 123",
"created_at": "2023-12-19 14:18:59",
"updated_at": "2023-12-19 14:18:59"
},
{
"note_id": 2,
"content_id": 95693,
"note_text": "Another test note",
"created_at": "2023-12-19 14:30:49",
"updated_at": "2023-12-19 14:30:49"
}
]
}- A valid bearer token must be passed to the endpoint via the Authorisation header, a valid bearer token can be obtained from the token endpoint
-
A call is made to the
GETendpoint without a contentID parameter -
- The endpoint will return a JSON response with a list of favourites the user has selected or an empty data array if they have none
-
A call is made to the
GETendpoint with a contentID parameter -
- The endpoint will return a JSON response telling the user if the content ID is a favourite or not - this is based on if the content ID is in the favourites table
- A call is made to the
POSTendpoint -
- The endpoint will return the JSON of the new row that has been added
- A call is made to the
DELETEendpoint -
- The endpoint will return a empty JSON response on successful deletion
- Invalid bearer token was passed to the endpoint e.g expired
- DELETE request failed due to the contentID not being in the favourites table
- Incorrect HTTP method were passed to the endpoint
- Parameters were passed with the incorrect data types
- Invalid parameters were passed for a specific request method
- POST failed due to a database error
- A call is made to the
GETendpoint without a contentID parameter
{
"data": [
{
"content_id": 95692
},
{
"content_id": 95693
}
]
}- A call is made to the
GETendpoint with a contentID parameter
{
"data": {
"isFavourite": true
}
}