bounswe / 2021SpringGroup4

This is the project repository of Group 4 for Boğaziçi University's Fundamentals of Software Engineering course.
2 stars 1 forks source link

Backend: Convert application-wide data representations to W3C standards. #176

Closed kerimoglutolga closed 2 years ago

kerimoglutolga commented 2 years ago

Description

As stated in our requirements, the data representations/serializations in our application must follow the W3C activity stream standards. These standards provide a uniform way for formatting JSON objects that allow us to represent many different entities in a single standard.

Files Ideally, the plan is to implement a separate module that takes care of all the relevant conversions to the desired format. This should live under /backend/api/activity_handler/.

kerimoglutolga commented 2 years ago

I have completed the implementation with small changes left. Find the pull request here: https://github.com/bounswe/2021SpringGroup4/pull/172

We now have an activity stream handler application under /api/activity_handler/. The following activities regarding events

trigger the creation of activity objects which are then used to communicate information among backend services and with the frontend. These activity objects are serialized according to the W3C activity stream standards. An example:

[
    {
        "@context": "https://www.w3.org/ns/activitystreams",
        "summary": "tolga has created a new event.",
        "type": "Create",
        "performed_at": "2021-11-30T12:10:22.145404+03:00",
        "actor": {
            "type": "User",
            "id": 1,
            "username": "tolga"
        },
        "object": {
            "type": "Event",
            "id": 1,
            "created": "2021-11-30T12:10:22.134589+03:00",
            "owner": "tolga",
            "content": {
                "title": "TestEvent1",
                "description": "This is a test event.",
                "date": "2021-10-21",
                "time": "21:00:00",
                "duration": "02:00:00",
                "location": "Istanbul",
                "sportType": "",
                "maxPlayers": 10,
                "applicants": [],
                "participants": [],
                "comments": [
                    {
                        "id": 6,
                        "owner": "tolga",
                        "parent": 1,
                        "body": "This even is amazing!"
                    }
                ],
                "skill_level": "Beginner"
            }
        }
    },
kerimoglutolga commented 2 years ago

What's left?

With the introduction of equipment posts, there will be new activities available on the website that must be logged as well. Additionally, these activity streams can be used to implement the activity history feed as part of the current search engine.