Summer of Code/2013/moksaya

Moksaya Project :
A Django based web app aimed at sharing and collaboration of sugar activities to foster learning and creativity

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.

RESTful WebServer
I am developing this project under the Moksaya branch on my Github.

Client Side WebApp
Development of web app consuming these RESTful api's can be tracked here https://github.com/aregee/Moksaya-web/

Authentication and User Login
Requires Username and Password for obtaining the api_keys, and rest of the other resources are accessed with the API Keys. There are two ways to do it, these are Publicly accessible end points.

User Resource
Authenticated users can access the User Resource, with the api_key and User Resource supports following authenticated options

Site Model
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 :
 * ProfileResource
 * ProjectResource
 * CommentResource
 * LikeResource
 * ForkResource

At the Top most level Profile/list contains all the User Profiles along with their Related Resources. So, a typical user profile contains User info like About , Birthdays etcs then the Related Resources Projects , Friends List , Likes on Projects (Can be easily extended for comments or other models). Most of these Related Resources can be accessed individually as well.

HTTP/1.1 200 OK Date: Sat, 21 Sep 2013 01:32:01 GMT Server: Apache/2.2.15 (Red Hat) Vary: Accept,Accept-Language,Cookie,Accept-Encoding X-Frame-Options: SAMEORIGIN Content-Language: en-us Cache-Control: no-cache Content-Type: application/json Transfer-Encoding: chunked
 * Top Level View :curl --dump-header - -H "Content-Type: application/json" -X GET http://moksaya-rahulgaur.rhcloud.com/api/v1/profile/?username=spock\&api_key=d2fe32b15b0b395a5d0e0ea4b7eb1e5d6ea15de7

{   "meta": { "limit": 20, "next": "/api/v1/profile/?username=spock&api_key=d2fe32b15b0b395a5d0e0ea4b7eb1e5d6ea15de7&limit=20&offset=20", "offset": 0, "previous": null, "total_count": 26 },   "objects": [ {           "about_me": "admin", "followers": [ "aregee" ],           "following": [], "id": 1, "language": "en", "location": "", "mugshot": null, "privacy": "registered", "projects": [], "resource_uri": "/api/v1/profile/1/", "user": "admin" },       {            "about_me": "Now I can update About_ME", "followers": [ "vrinda", "kirk", "ned", "titiksha", "robStark", "jarvis", "satyamyadav", "user101", "atif", "nikking1793", "tch", "amigo", "aregee__" ],           "following": [ "vrinda", "ned", "kirk", "tch", "admin", "titiksha", "jarvis", "monikagupta", "satyamyadav", "surajgillespie", "nikking1793", "amigo", "raju" ],           "id": 2, "language": "en", "location": "", "mugshot": null, "privacy": "registered", "projects": [ {                   "Likes": 1, "comment": [], "desc": "undefined", "history": "", "id": 1, "resource_uri": "/api/v1/projects/1/", "screenshot": "/media/projects/wb3.png", "shared_date": "2013-09-20T19:07:29.101309", "src": "/media/projects/feed_.py", "title": "undefined", "user": "aregee" },               {                    "Likes": 0, "comment": [], "desc": "undefined", "history": "", "id": 2, "resource_uri": "/api/v1/projects/2/", "screenshot": "/media/projects/lin.jpg", "shared_date": "2013-09-20T19:07:57.861892", "src": "/media/projects/file_rem.py", "title": "undefined", "user": "aregee" },               {                    "Likes": 0, "comment": [], "desc": "undefined", "history": "", "id": 3, "resource_uri": "/api/v1/projects/3/", "screenshot": "/media/projects/beautiful_strings.png", "shared_date": "2013-09-20T19:08:30.575741", "src": "/media/projects/file_rem_1.py", "title": "undefined", "user": "aregee" }           ],            "resource_uri": "/api/v1/profile/2/", "user": "aregee" },       {            "about_me": "Oh not it won't happen :0", "followers": [ "aregee" ],           "following": [ "aregee", "kirk", "jarvis" ],           "id": 3, "language": "en", "location": "", "mugshot": null, "privacy": "registered", "projects": [ {                   "Likes": 1, "comment": [ {                           "entry": "undefined", "resource_uri": "/api/v1/comment/1/", "text": ":P", "user": "vrinda" }                   ],                    "desc": "undefined", "history": "project undefined created by aregee forked by vrinda ", "id": 4, "resource_uri": "/api/v1/projects/4/", "screenshot": "/media/projects/wb3_1.png", "shared_date": "2013-09-20T19:09:43.084615", "src": "/media/projects/feed__1.py", "title": "undefined", "user": "vrinda" },               {                    "Likes": 0, "comment": [], "desc": "undefined", "history": "project undefined created by aregee forked by vrinda ", "id": 5, "resource_uri": "/api/v1/projects/5/", "screenshot": "/media/projects/lin_1.jpg", "shared_date": "2013-09-20T19:22:22.520212", "src": "/media/projects/file_rem_2.py", "title": "undefined", "user": "vrinda" }           ],            "resource_uri": "/api/v1/profile/3/", "user": "vrinda" },       {            "about_me": "I am SPOCK", "followers": [], "following": [], "id": 4, "language": "en", "location": "", "mugshot": null, "privacy": "registered", "projects": [], "resource_uri": "/api/v1/profile/4/", "user": "spock" },       {            "about_me": "Howdy partner, this is kirk's Moksaya Profile", "followers": [ "aregee", "vrinda" ],           "following": [ "aregee" ],           "id": 5, "language": "en", "location": "", "mugshot": null, "privacy": "registered", "projects": [], "resource_uri": "/api/v1/profile/5/", "user": "kirk" },       {            "about_me": "Howdy partner, this is ned's Moksaya Profile", "followers": [ "aregee" ],           "following": [ "aregee" ],           "id": 6, "language": "en", "location": "", "mugshot": null, "privacy": "registered", "projects": [], "resource_uri": "/api/v1/profile/6/", "user": "ned" },       {            "about_me": "sdasd", "followers": [ "aregee" ],           "following": [ "aregee" ],           "id": 7, "language": "en", "location": "", "mugshot": null, "privacy": "registered", "projects": [], "resource_uri": "/api/v1/profile/7/", "user": "tch" },       {            "about_me": "I am Titiksha", "followers": [ "aregee" ],           "following": [ "aregee" ],           "id": 8, "language": "en", "location": "", "mugshot": null, "privacy": "registered", "projects": [], "resource_uri": "/api/v1/profile/8/", "user": "titiksha" },       {            "about_me": "This is Rob Stark, King in the North ;)",            "followers": [],            "following": [                "aregee"            ],            "id": 9,            "language": "en",            "location": "",            "mugshot": null,            "privacy": "registered",            "projects": [],            "resource_uri": "/api/v1/profile/9/",            "user": "robStark"        },        {            "about_me": "Howdy partner, this is mronetwo's Moksaya Profile",            "followers": [],            "following": [],            "id": 10,            "language": "en",            "location": "",            "mugshot": null,            "privacy": "registered",            "projects": [],            "resource_uri": "/api/v1/profile/10/",            "user": "mronetwo"        },        {            "about_me": "Howdy partner, this is monikagupta's Moksaya Profile", "followers": [ "aregee" ],           "following": [], "id": 11, "language": "en", "location": "", "mugshot": null, "privacy": "registered", "projects": [], "resource_uri": "/api/v1/profile/11/", "user": "monikagupta" },       {            "about_me": "Howdy partner, this is jarvis's Moksaya Profile", "followers": [ "aregee", "vrinda" ],           "following": [ "aregee" ],           "id": 12, "language": "en", "location": "", "mugshot": null, "privacy": "registered", "projects": [], "resource_uri": "/api/v1/profile/12/", "user": "jarvis" },       {            "about_me": "Howdy partner, this is satyamyadav's Moksaya Profile", "followers": [ "aregee" ],           "following": [ "aregee" ],           "id": 13, "language": "en", "location": "", "mugshot": null, "privacy": "registered", "projects": [], "resource_uri": "/api/v1/profile/13/", "user": "satyamyadav" },       {            "about_me": "Hello, I am user1010 and I code :)",            "followers": [],            "following": [                "aregee"            ],            "id": 14,            "language": "en",            "location": "",            "mugshot": null,            "privacy": "registered",            "projects": [],            "resource_uri": "/api/v1/profile/14/",            "user": "user101"        },        {            "about_me": "Howdy atif , this is your  Moksaya Profile",            "followers": [],            "following": [                "aregee"            ],            "id": 15,            "language": "en",            "location": "",            "mugshot": null,            "privacy": "registered",            "projects": [],            "resource_uri": "/api/v1/profile/15/",            "user": "atif"        },        {            "about_me": "Howdy surajgillespie , this is your  Moksaya Profile", "followers": [ "aregee" ],           "following": [], "id": 16, "language": "en", "location": "", "mugshot": null, "privacy": "registered", "projects": [], "resource_uri": "/api/v1/profile/16/", "user": "surajgillespie" },       {            "about_me": "Howdy partner, this is moksaya_user's Moksaya Profile", "followers": [], "following": [], "id": 17, "language": "en", "location": "", "mugshot": null, "privacy": "registered", "projects": [], "resource_uri": "/api/v1/profile/17/", "user": "moksaya_user" },       {            "about_me": "Howdy nikking1793, this is your  Moksaya Profile", "followers": [ "aregee", "user102" ],           "following": [ "aregee" ],           "id": 18, "language": "en", "location": "", "mugshot": null, "privacy": "registered", "projects": [], "resource_uri": "/api/v1/profile/18/", "user": "nikking1793" },       {            "about_me": "Howdy Ayushletsrock, this is your  Moksaya Profile", "followers": [ "user102" ],           "following": [], "id": 20, "language": "en", "location": "", "mugshot": null, "privacy": "registered", "projects": [], "resource_uri": "/api/v1/profile/20/", "user": "Ayushletsrock" },       {            "about_me": "Howdy gonzalo, this is your  Moksaya Profile", "followers": [], "following": [], "id": 21, "language": "en", "location": "", "mugshot": null, "privacy": "registered", "projects": [], "resource_uri": "/api/v1/profile/21/", "user": "gonzalo" }   ]