Google Summer Of Code Submission

Google Summer Of Code @MIT App Inventor

About My Self

Name: Devarsh Mavani

Country: India

Education: B.E. in Information Technology

College: Vishwakarma Government Engineering College

About My Project at GSoC

Project Name: Implement auto-attach aia file in community

Organisation: MIT App Inventor

Mentor: Jeff Schiller

Project Proposal Link: docs.google.com/document/d/1bXVxdIC5ar839bz1CD5iIf-vXP6ftXAE5EGMfOVZxvA/edit?usp=sharing

Project Pull Request: github.com/mit-cml/appinventor-sources/pull/2703

Project Abstract:


While developing apps using MIT App Inventor, students often need help. For this MIT App Inventor has a community where students can reach out for help. While the community is very helpful and makes development easier, it would be even more convenient and time-saving to have a user interface on the App Inventor website itself from which users can directly ask questions in the community and project files can be automatically uploaded on community website along with that (instead of manually downloading and uploading).


How will this help students?

Currently, students need to manually export their project files and then upload them to the app inventor community which is time-consuming and a bit complex. With the help of an auto-publish feature, students can easily ask for help in the community within the app inventor.


Project Goals

  • Implement Authentication using Discourse connect provider

  • Create UI in app inventor for asking a question

  • Auto attach project source files (aia files)

  • Show already asked questions in real-time

Implementation

Front-end

  1. appengine/war/AskHelp.html: This file contains interface for taking input from user. There are mainly 4 fields, title description, category and attach project file checkbox. It contains javascript that communicates with GWT.

  2. CommunityLogin.html: this file contains a button that triggers authentication flow

  3. SimilarQuestions.html: It displays similar questions. Communicates with GWT => backend for fetching similar questions

GWT

  1. client/TopToolbar.java: This file display toolbar on top. I have added a new menu inside of Help menu. When user clicks on a pop-up dialog will appear. In this user can authenticates himself and write questions and submit it. I have taken advantage of IFrames to display frontend part (made in html/css). I have also written code that will communicate with Backend using Remote Procedure Calls

RPC

  1. shared/rpc/communityhelp/SubmitPostService.java: It defines a RemoteService having 4 methods: submitPost, uploadFile, getDiscourseCategories, getSimilarTopics

  2. shared/rpc/communityhelp/SubmitPostServiceAsync.java: Same as SubmitPostService.java but defines async code as required by gwt

  3. shared/rpc/user/User.java: added 2 new properties and its getters and setters. 1st is communityLogin which shows if user is logged in to community and other is communityLoginUsername, which stores username of discourse

  4. shared/rpc/user/UserInfoService.java: have defined methods related to RPC being made from GWT client. ex: loginToCommunity, logoutFromCommunity, etc.

Server

  1. server/CommunityLoginServlet.java: This servlet handles authentication with discourse using discourse identity provider.

  2. server/SubmitPostServiceImpl.java: Contains implementation for methods defined in SubmitPostService.java

  3. server/UserInfoServiceImpl.java: Contains implementation for methods defined in UserInfoService.java

Weekly work done

  • Week 1 : Setup discourse (one of the dependency). Discussed about approach for creating user interface (IFrames + HTML vs GWT).

  • Week 2: Worked on UI and Discussed about authentication approach (password vs Discourse identity provider)

  • Week 3: Created initial User interface for all screens

  • Week 4: Started working on authentication

  • Week 5: Fixed bugs related to authentication

  • Week 6: Fixed bug in Discourse identity provider (see my version of it github.com/devarsh-mavani-19/discourse )

  • Week 7: Implemented question posting functionality

  • Week 8 - 12: Fixing bugs and finalising UI.