Changes

14,049 bytes removed ,  11:57, 19 November 2013
no edit summary
Line 1: Line 1:  
== [http://sanskritdictionary.org/moksaya Moksaya] Project : ==
 
== [http://sanskritdictionary.org/moksaya Moksaya] Project : ==
==== A Dajngo based web app aimed at sharing and collaboration of sugar activities to foster learning and creativity ====
+
<big>'''A Django based web app aimed at sharing and collaboration of sugar activities to foster learning and creativity'''</big>
    
Goal of this project is to implement a Project Sharing site to foster collaboration and sharing of Sugar Activities over the internet.The website upon the completion would also provide REST-API’s , so that the services of the website could be utilised by the Sugar Activities to share the project on the site from within the Sugar Environment.
 
Goal of this project is to implement a Project Sharing site to foster collaboration and sharing of Sugar Activities over the internet.The website upon the completion would also provide REST-API’s , so that the services of the website could be utilised by the Sugar Activities to share the project on the site from within the Sugar Environment.
   −
=== Key Deliverables : ===
+
== Repository ==
Here I have listed the Key features that I am currently working on , however as we go through the course of GSoC new features will be added ,once we have a concrete and stable base infrastructure for the Social Project Sharing site.
     −
* Social Features  : Following/Followers , Like , favourites , share , Comments .etc
+
==== RESTful WebServer ====
* Authenticated RESTful API's :Ability to interact with website from various Sugar Activities
+
I am developing this project under the Moksaya branch on my [https://github.com/aregee/moksaya Github].
* Separate landing pages for different audiences (kids, teachers, parents, etc.)
  −
* Gallery : Ability for users to create portfolio of their projects.
     −
== Repository ==
  −
I am developing this project under the Moksaya branch on my [https://github.com/aregee/moksaya Github].
  −
      +
==== Client Side WebApp ====
 +
 +
Development of web app consuming these RESTful api's  can be tracked here https://github.com/aregee/Moksaya-web/
    
== REST API v1 Resources ==
 
== REST API v1 Resources ==
Line 399: Line 396:       −
=== Site Model ===  
+
== Site Model ==
I have planed to design the RESTful interface to the Moksaya project , and I plan to consume these APIs with a webapp possibly written with [http://backbonejs.org/ Backbone.js]
+
I have planed to design the RESTful interface to the Moksaya project , and I have written a web app to consume these APIs using [ http://angularjs.org/ AngularJS ]
 
Initially Moksaya project offers a RESTful interface to the following interrelated models :
 
Initially Moksaya project offers a RESTful interface to the following interrelated models :
 
*ProfileResource
 
*ProfileResource
Line 847: Line 844:  
         }
 
         }
 
     ]
 
     ]
}
  −
  −
* Related Resource Projects here can be accessed by http://127.0.0.1:8000/api/v1/projects/?format=json
  −
  {
  −
    "meta": {
  −
        "limit": 20,
  −
        "next": null,
  −
        "offset": 0,
  −
        "previous": null,
  −
        "total_count": 5
  −
    },
  −
    "objects": [
  −
        {
  −
            "Likes": 3,
  −
            "comment": [
  −
                {
  −
                    "entry": "Another story i am covering and i want to test the constrains this time",
  −
                    "resource_uri": "",
  −
                    "text": "MAhn this is some awesome shit "
  −
                },
  −
                {
  −
                    "entry": "Another story i am covering and i want to test the constrains this time",
  −
                    "resource_uri": "",
  −
                    "text": "cool Man comments are returned in APIs"
  −
                }
  −
            ],
  −
            "desc": "here is another hack by me and I am doing this right now",
  −
            "owner": "aregee",
  −
            "screenshot": "/media/projects/Screenshot_from_2013-01-21_030756.png",
  −
            "shared_date": "2013-06-25T18:48:18.205760",
  −
            "src": "/media/proejcts/admin.py",
  −
            "title": "Another story i am covering and i want to test the constrains this time"
  −
        },
  −
        {
  −
            "Likes": 1,
  −
            "comment": [],
  −
            "desc": "Wired Hack ",
  −
            "owner": "aregee",
  −
            "screenshot": "/media/projects/background.png",
  −
            "shared_date": "2013-06-26T05:59:48.445868",
  −
            "src": "/media/proejcts/startconky.sh",
  −
            "title": "Someting Wong"
  −
        },
  −
        {
  −
            "Likes": 3,
  −
            "comment": [],
  −
            "desc": "This is my first hello world code",
  −
            "owner": "testuser",
  −
            "screenshot": "/media/projects/Screenshot_from_2013-02-03_173238.png",
  −
            "shared_date": "2013-06-27T15:31:22.560494",
  −
            "src": "/media/proejcts/hello.c",
  −
            "title": "First Project Upload"
  −
        },
  −
        {
  −
            "Likes": 0,
  −
            "comment": [],
  −
            "desc": "This is my first hello world code",
  −
            "owner": "aregee",
  −
            "screenshot": "/media/projects/Screenshot_from_2013-02-03_173238.png",
  −
            "shared_date": "2013-07-04T19:18:23.307241",
  −
            "src": "/media/proejcts/hello.c",
  −
            "title": "First Project Upload"
  −
        },
  −
        {
  −
            "Likes": 0,
  −
            "comment": [],
  −
            "desc": "Wired Hack ",
  −
            "owner": "testuser",
  −
            "screenshot": "/media/projects/background.png",
  −
            "shared_date": "2013-07-04T19:37:54.184572",
  −
            "src": "/media/proejcts/startconky.sh",
  −
            "title": "Someting Wong"
  −
        }
  −
    ]
  −
  }
  −
 
  −
In the above results I have excluded Project ids from the json Response, but similarly each individual project could be accessed and updated by making GET or Post or Put request to http://127.0.0.1:8000/api/v1/projects/<pk>?format=json
  −
  −
* Accessing particular  project http://127.0.0.1:8000/api/v1/projects/2/?format=json
  −
  −
  {
  −
    "Likes": 1,
  −
    "comment": [],
  −
    "desc": "Wired Hack ",
  −
    "owner": "aregee",
  −
    "screenshot": "/media/projects/background.png",
  −
    "shared_date": "2013-06-26T05:59:48.445868",
  −
    "src": "/media/proejcts/startconky.sh",
  −
    "title": "Someting Wong"
  −
}
  −
  −
==Forking==
  −
Lets take a look at how forking works here , though this is not really the best approach but I am doing this for understanding purpose and would figure out the proper solution for this ..
  −
but for now here it is.
  −
  −
* Lets say these are the projects on the Moksaya submitted by the user  :
  −
  {
  −
    "meta": {
  −
        "limit": 20,
  −
        "next": null,
  −
        "offset": 0,
  −
        "previous": null,
  −
        "total_count": 3
  −
    },
  −
    "objects": [
  −
        {
  −
            "Likes": 3,
  −
            "comment": [
  −
                {
  −
                    "entry": "Another story i am covering and i want to test the constrains this time",
  −
                    "resource_uri": "",
  −
                    "text": "MAhn this is some awesome shit "
  −
                },
  −
                {
  −
                    "entry": "Another story i am covering and i want to test the constrains this time",
  −
                    "resource_uri": "",
  −
                    "text": "cool Man comments are returned in APIs"
  −
                }
  −
            ],
  −
            "desc": "here is another hack by me and I am doing this right now",
  −
            "id": 1,
  −
            "owner": "aregee",
  −
            "screenshot": "/media/projects/Screenshot_from_2013-01-21_030756.png",
  −
            "shared_date": "2013-06-25T18:48:18.205760",
  −
            "src": "/media/proejcts/admin.py",
  −
            "title": "Another story i am covering and i want to test the constrains this time"
  −
        },
  −
        {
  −
            "Likes": 1,
  −
            "comment": [],
  −
            "desc": "Wired Hack ",
  −
            "id": 2,
  −
            "owner": "aregee",
  −
            "screenshot": "/media/projects/background.png",
  −
            "shared_date": "2013-06-26T05:59:48.445868",
  −
            "src": "/media/proejcts/startconky.sh",
  −
            "title": "Someting Wong"
  −
        },
  −
        {
  −
            "Likes": 3,
  −
            "comment": [],
  −
            "desc": "This is my first hello world code",
  −
            "id": 3,
  −
            "owner": "testuser",
  −
            "screenshot": "/media/projects/Screenshot_from_2013-02-03_173238.png",
  −
            "shared_date": "2013-06-27T15:31:22.560494",
  −
            "src": "/media/proejcts/hello.c",
  −
            "title": "First Project Upload"
  −
        }
  −
    ]
  −
  }
  −
  −
* Now I am logged in as aregee , and here is my profile at  127.0.0.1:8000/api/v1/profile/list/1/?format=json
  −
  −
  {
  −
    "about_me": "DjangoNaut",
  −
    "birth_date": "1991-06-20",
  −
    "friends": [
  −
        "testuser",
  −
        "SomeDude"
  −
    ],
  −
    "gender": 1,
  −
    "language": "en",
  −
    "location": "India",
  −
    "mugshot": "/media/mugshots/d749832b7a.jpg",
  −
    "privacy": "registered",
  −
    "projects": [
  −
        {
  −
            "Likes": 3,
  −
            "comment": [
  −
                {
  −
                    "entry": "Another story i am covering and i want to test the constrains this time",
  −
                    "resource_uri": "",
  −
                    "text": "MAhn this is some awesome shit "
  −
                },
  −
                {
  −
                    "entry": "Another story i am covering and i want to test the constrains this time",
  −
                    "resource_uri": "",
  −
                    "text": "cool Man comments are returned in APIs"
  −
                }
  −
            ],
  −
            "desc": "here is another hack by me and I am doing this right now",
  −
            "id": 1,
  −
            "owner": "aregee",
  −
            "screenshot": "/media/projects/Screenshot_from_2013-01-21_030756.png",
  −
            "shared_date": "2013-06-25T18:48:18.205760",
  −
            "src": "/media/proejcts/admin.py",
  −
            "title": "Another story i am covering and i want to test the constrains this time"
  −
        },
  −
        {
  −
            "Likes": 1,
  −
            "comment": [],
  −
            "desc": "Wired Hack ",
  −
            "id": 2,
  −
            "owner": "aregee",
  −
            "screenshot": "/media/projects/background.png",
  −
            "shared_date": "2013-06-26T05:59:48.445868",
  −
            "src": "/media/proejcts/startconky.sh",
  −
            "title": "Someting Wong"
  −
        }
  −
    ],
  −
    "user": "aregee",
  −
    "website": "http://rahulgaur.info/"
  −
  }
  −
  −
  −
* Now I want to fork the Project with id = 3 created by testuser , so I will make a GET request to 127.0.0.1:8000/api/v1/forking/3/?format=json
  −
  {
  −
    "Changes": {
  −
        "owner": "testuser",
  −
        "shared_date": "2013-06-27T15:31:22.560494"
  −
    },
  −
    "desc": "This is my first hello world code",
  −
    "resource_uri": "/api/v1/forking/3/",
  −
    "screenshot": "/media/projects/Screenshot_from_2013-02-03_173238.png",
  −
    "shared_date": "2013-06-27T15:31:22.560494",
  −
    "src": "/media/proejcts/hello.c",
  −
    "title": "First Project Upload"
  −
  }
  −
  −
The diffs / metadata could be viewed for the changes made , for instance here the response shows the original author of the project and the date it was shared
  −
  −
  −
* Lets take a look at my Profile again at 127.0.0.1:8000/api/v1/profile/list/1/?format=json
  −
  {
  −
    "about_me": "DjangoNaut",
  −
    "birth_date": "1991-06-20",
  −
    "friends": [
  −
        "testuser",
  −
        "SomeDude"
  −
    ],
  −
    "gender": 1,
  −
    "language": "en",
  −
    "location": "India",
  −
    "mugshot": "/media/mugshots/d749832b7a.jpg",
  −
    "privacy": "registered",
  −
    "projects": [
  −
        {
  −
            "Likes": 3,
  −
            "comment": [
  −
                {
  −
                    "entry": "Another story i am covering and i want to test the constrains this time",
  −
                    "resource_uri": "",
  −
                    "text": "MAhn this is some awesome shit "
  −
                },
  −
                {
  −
                    "entry": "Another story i am covering and i want to test the constrains this time",
  −
                    "resource_uri": "",
  −
                    "text": "cool Man comments are returned in APIs"
  −
                }
  −
            ],
  −
            "desc": "here is another hack by me and I am doing this right now",
  −
            "id": 1,
  −
            "owner": "aregee",
  −
            "screenshot": "/media/projects/Screenshot_from_2013-01-21_030756.png",
  −
            "shared_date": "2013-06-25T18:48:18.205760",
  −
            "src": "/media/proejcts/admin.py",
  −
            "title": "Another story i am covering and i want to test the constrains this time"
  −
        },
  −
        {
  −
            "Likes": 1,
  −
            "comment": [],
  −
            "desc": "Wired Hack ",
  −
            "id": 2,
  −
            "owner": "aregee",
  −
            "screenshot": "/media/projects/background.png",
  −
            "shared_date": "2013-06-26T05:59:48.445868",
  −
            "src": "/media/proejcts/startconky.sh",
  −
            "title": "Someting Wong"
  −
        },
  −
        {
  −
            "Likes": 0,
  −
            "comment": [],
  −
            "desc": "This is my first hello world code",
  −
            "id": 4,
  −
            "owner": "aregee",
  −
            "screenshot": "/media/projects/Screenshot_from_2013-02-03_173238.png",
  −
            "shared_date": "2013-07-04T20:46:43.062294",
  −
            "src": "/media/proejcts/hello.c",
  −
            "title": "First Project Upload"
  −
        }
  −
    ],
  −
    "user": "aregee",
  −
    "website": "http://rahulgaur.info/"
  −
  }
  −
  −
  −
* And the list of projects at 127.0.0.1:8000/api/v1/projects/
  −
  −
  {
  −
    "meta": {
  −
        "limit": 20,
  −
        "next": null,
  −
        "offset": 0,
  −
        "previous": null,
  −
        "total_count": 4
  −
    },
  −
    "objects": [
  −
        {
  −
            "Likes": 3,
  −
            "comment": [
  −
                {
  −
                    "entry": "Another story i am covering and i want to test the constrains this time",
  −
                    "resource_uri": "",
  −
                    "text": "MAhn this is some awesome shit "
  −
                },
  −
                {
  −
                    "entry": "Another story i am covering and i want to test the constrains this time",
  −
                    "resource_uri": "",
  −
                    "text": "cool Man comments are returned in APIs"
  −
                }
  −
            ],
  −
            "desc": "here is another hack by me and I am doing this right now",
  −
            "id": 1,
  −
            "owner": "aregee",
  −
            "screenshot": "/media/projects/Screenshot_from_2013-01-21_030756.png",
  −
            "shared_date": "2013-06-25T18:48:18.205760",
  −
            "src": "/media/proejcts/admin.py",
  −
            "title": "Another story i am covering and i want to test the constrains this time"
  −
        },
  −
        {
  −
            "Likes": 1,
  −
            "comment": [],
  −
            "desc": "Wired Hack ",
  −
            "id": 2,
  −
            "owner": "aregee",
  −
            "screenshot": "/media/projects/background.png",
  −
            "shared_date": "2013-06-26T05:59:48.445868",
  −
            "src": "/media/proejcts/startconky.sh",
  −
            "title": "Someting Wong"
  −
        },
  −
        {
  −
            "Likes": 3,
  −
            "comment": [],
  −
            "desc": "This is my first hello world code",
  −
            "id": 3,
  −
            "owner": "testuser",
  −
            "screenshot": "/media/projects/Screenshot_from_2013-02-03_173238.png",
  −
            "shared_date": "2013-06-27T15:31:22.560494",
  −
            "src": "/media/proejcts/hello.c",
  −
            "title": "First Project Upload"
  −
        },
  −
        {
  −
            "Likes": 0,
  −
            "comment": [],
  −
            "desc": "This is my first hello world code",
  −
            "id": 4,
  −
            "owner": "aregee",
  −
            "screenshot": "/media/projects/Screenshot_from_2013-02-03_173238.png",
  −
            "shared_date": "2013-07-04T20:46:43.062294",
  −
            "src": "/media/proejcts/hello.c",
  −
            "title": "First Project Upload"
  −
        }
  −
    ]
  −
  }
  −
  −
  −
Difference among the two Projects can be tracked by  Project.objects.get(pk = 4).diff(Project.objects.get(pk = 3))  , its a method provided by the django-forkit app to view changes / differences in the forkable models.
  −
Meta data field needs to bee added to Projects field so that we can save these differences when a project is forked , and every project should contain a link to original creator.
  −
  −
=== TODOS ===
     −
* Add Authentication
+
=== TODOS ===
* Provide Full CRUD access to authenticated user to the core site functionalities : Like , Comment , UserProfile, Projects etcs
  −
* Improve the forking functionality
  −
* Implement JavaScript Client to consume APIs to get a minimal functional product up and running