<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hello, <br>
</p>
<p>Hope all are having a safe week amid nCoV.</p>
<p>I and Manish (<a class="moz-txt-link-abbreviated"
href="mailto:sugar@radii.dev">sugar@radii.dev</a>) had been
working on the GSoC project which did not get a slot (Python3 app
store aslov4), and I guess we have made good progress in it. <i>We
decided to collaborate on the project because a frontend and
backend developer combo helps to get the best features of both
ends :D.</i></p>
<p><font size="-1"><i>To avoid misconceptions and
misinterpretations, please read the entire email before
replying. Thanks! :P</i></font><br>
</p>
<p><b>Need Statement</b>:<br>
</p>
<p>In short, the most important points</p>
<ul>
<li><i>Create the simplest possible app store for Sugar
activities, where each activity included has been (a) ported
to Python 3 and released, and (b) tested on Sugar Live Build.</i></li>
<li><i>We used to have an app store for Sugar activities, but
because we can't seem to attract any PHP developers the app
store has failed to keep up with development.</i></li>
<li><i>We now use activities.sugarlabs.org for Python 2 activities
only.</i></li>
<li><i>We have tried to make a replacement for <a
moz-do-not-send="true"
href="https://activities.sugarlabs.org">
activities.sugarlabs.org</a> three times, and each time the
features we need were not finished. These projects have been
too ambitious and have not been supported collectively by the
Sugar Labs community.</i></li>
</ul>
<p><i>~ from </i><i><a class="moz-txt-link-freetext"
href="https://github.com/sugarlabs/GSoC/blob/master/Ideas-2020.md#sugar-app-store-for-python-3-activities-aslov4">https://github.com/sugarlabs/GSoC/blob/master/Ideas-2020.md#sugar-app-store-for-python-3-activities-aslov4</a></i></p>
<p>This made us rethink the idea of a redesigned app store for
sugarlabs. This, would be a collection of all the activities in
sugarlabs organization which can be <i><b>successfully</b> built</i>
without <i>errors</i>.</p>
<p>The <b>new app store </b>is special in a lot of ways, let me
bring out the<i> most important points:</i><br>
</p>
<ol start="1">
<li>The appstore is built in <u>pure static HTML</u>, <a
moz-do-not-send="true"
href="https://developer.mozilla.org/en-US/docs/Web/JavaScript">Vanilla
Javascript</a> and <a moz-do-not-send="true"
href="https://jquery.com/">JQuery</a>. Anyone with <i>basic
Javascript knowledge</i> can easily add features. Theming and
customization are provided by <a moz-do-not-send="true"
href="https://getbootstrap.com">Bootstrap4</a>. The theme,
scripts are completely <u>independent</u> of each other.
Changes to the <i>will not </i>affect the generation of the
appstore. <br>
</li>
<li><b>Search function</b> is provided by a powerful Javascript
library called <a moz-do-not-send="true"
href="https://github.com/lucaong/minisearch">minisearch</a>
which is an open source search indexer. All processing is
therefore done on client side. The benefits of using an external
library are many, as you know, <br>
</li>
<li>The App Store is based on <b>JSON</b> (<i>Javascript Object
Notation</i>). an "<font face="Courier New, Courier,
monospace">index.json</font>" is produced by the generator
helper script so that search indexing, activity filtering can be
easily done on the client side.<br>
</li>
<li><a moz-do-not-send="true"
href="https://github.com/sugarlabs-appstore/sugarappstore">Python
scripts</a> are used to generate static HTML files of the app
bundles and <b>index.json</b>. The activity's unique HTML
document is produced without style / css, and are externally
loaded, so that it can be customized / removed whenever
necessary (for example on very low bandwidth connections, or for
adding another theme)</li>
<li>Sugar Appstore depends on <b>static HTML</b>s also because,
it can be useful for SEOs, and to provide an external link to
the activity from a third party website. Dynamically filtered
search results might not be static. Providing a correct link to
the bundle helps another user to share a specific activity
bundle with another</li>
<li>All the activities on <a moz-do-not-send="true"
href="https://github.com/sugarlabs">https://github.com/sugarlabs
</a>are<b> indexed automatically </b><<i>see </i><b>(</b><b>9</b><b>)</b>><i>
</i>and built using <b>Continuous Integration</b> (GitHub
Actions) over <a moz-do-not-send="true"
href="https://github.com/srevisaju/sugar-activity-build">here</a>.
Out of 300+ bundles, <b>199</b> and <i>still counting </i>have
successfully built a <font face="Courier New, Courier,
monospace">*.xo</font> bundle and are continuously uploaded to
CDN. <br>
</li>
<li>The<b> appstore could be downloaded for Offline use</b>, or
can be hosted on a local server if a user would not like to use
the online one. This is specifically useful, if a school would
host, the sugar appstore on its local server, so students could
download activities without accessing the internet. The entire
app store (<i>batteries</i> and <i>bundles</i> included) weighs
approximately 613 MB. See <i><a moz-do-not-send="true"
href="https://github.com/srevinsaju/sugar-activity-build/releases/tag/latest">this</a></i>
for a detailed idea.</li>
<li>In case a user would like to add<u> another bundle </u>to the
sugar appstore, previously he/she had to have a SugarLabs shell
account (AFAIK, and <i>as far as I understand</i>). This might
limit the accessibility to some users. This is hence solved by a
new system of adding bundles to the activity. <u><b>Pull
Request to Add Applications </b> </u>is system which I
adopted from the AppImage Hub (<a moz-do-not-send="true"
href="https://github.com/appimage/appimage.github.io">https://github.com/appimage/appimage.github.io</a>)
where a <a moz-do-not-send="true"
href="https://appimage.github.io">similar app store</a> is
built based on the same concept. Every PR is tested by
continuous integration, and then all successfully merged PRs are
added to the website, and the static website rebuild is
triggered on each commit. A similar idea is implemented in
Sugarlabs Appstore. This ensures that a .xo can be built on
another host also using the same commands. Improving the quality
of the bundles. For information regarding how to add a bundle,
see <a moz-do-not-send="true"
href="https://github.com/srevinsaju/sugar-activity-build#adding-your-bundles-xo">this</a>.
For a sample PR which intends to add a bundle, see <a
moz-do-not-send="true"
href="https://github.com/srevinsaju/sugar-activity-build/pull/6">PR#6</a>
which intends to add Jupyter Activity. All <i>urls</i> which
can be cloned using <a moz-do-not-send="true"
href="https://git-scm.com/"><i>git</i></a> are accepted. You
may look into how the build script works here <a
moz-do-not-send="true"
href="https://github.com/srevinsaju/sugar-activity-build/blob/master/.github/workflows/bundle_test.yml">https://github.com/srevinsaju/sugar-activity-build/blob/master/.github/workflows/bundle_test.yml</a>.
<i>For those users who are not interested in GitHub, its
recommended if Sugarlabs would host a GitLab which also
supports CI; As this issue has been discussed previously, I am
not putting too much insight into the same; :D</i></li>
<li>Builds are refreshed <b>every 5th minute </b>of a day; (<font
face="Courier New, Courier, monospace"><span class="pl-ent">cron</span>:
<span class="pl-s"><span class="pl-pds">"</span>5 * * * *<span
class="pl-pds">"</span></span></font>). There is no
specific reason why 5th minute is chosen, mostly because I can
finish pushing changes between 0th minute and 5th minute
(normally because my school classes finish at the 0th minute;
LOL; )</li>
<li><b>Builds are hosted to netlify CDN</b>. <b>Netlify</b> CDN
is chosen because its free for open source, and it also has a
capability to get form submissions without a server. This is a
cheap implementation without a server. There is no other reason
why netlify chosen. Netlify has a very permissive quota. Other
static site hosting as such as github.io will make the repo
huge; or will require payment. Moreover. build on netlify takes
only 1minute and 5 seconds to complete, with older fast network
speed.</li>
<li><b>Responsive HTML design</b>. Makes it adaptable on all
screen sizes, on small android phones to 1080p screens and much
more. This is better for SEO, as well as accessibility.<br>
</li>
<li><b>Lighthouse speed testing</b> shows better <i>cumulative</i>
speed score than activities.sugarlabs.org. On Desktop, the score
for ASLOv4 is 94/100; on mobile its 76/100 for ASLOv4. For
activities.sugarlabs.org, its 89/100 on Desktop, 76/100 on
mobile. Results may vary slightly from time to time; Repeat
tests to get concurrent values. Results provided by <a
moz-do-not-send="true"
href="https://github.com/googlechrome/lighthouse">Lighthouse</a>
powered by Google. Result details for sugarstore.netlify.app : <a
class="moz-txt-link-freetext"
href="https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fsugarstore.netlify.app%2F&tab=desktop">https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fsugarstore.netlify.app%2F&tab=desktop</a>;
Result details for activities.sugarlabs.org: <a
class="moz-txt-link-freetext"
href="https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Factivities.sugarlabs.org&tab=desktop">https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Factivities.sugarlabs.org&tab=desktop</a></li>
<li>Its possible to embed (keeping a local copy of) <i>JQuery</i>
and <i>Bootstrap</i> for offline use, but I personally prefer
to keep the cdn (i.e <script>), this is because; modern
browsers automatically cache commonly used script files. So this
would increase the performance with caching. This will not
require the user to download the libs again. Moreover, if the
user has visited any other site which uses the same library, it
would be actually better.</li>
<li>It looks sophisticated to keep a download count on static
websites, but that does not mean its impossible. Its
nevertheless, not possible (afaik) to get download files with
only static files (i.e without a server to depend on). I could</li>
<ol>
<li>send a POST request to another server, which would increment
the download count on every click of the download button;
along with a GET request from the server to get the download
count. This would imply, for every activity; a GET request
will be emitted, or preferably, a single GET request to get
all the download counts and update each of the activity shown
for display with the new <br>
</li>
<li>Use Firebase Library to create a firebase server where I
could use Cloud Firestore and send and receive download stats.
However, this has a few cons: i.e increase the page load time
from 1.1s to 2.3 seconds; as well as make it complex to
protect the server from user manipulation of the download
count. I have tried this, I will enable it, if necessary</li>
<li>Add a download analytics with a one way download count (send
only - no receive). By using Google Analytics, I can send
custom event trigger, and administrators can analyze and
filter data / sort data by download counts. I, however, did
not find a direct method to get data from Google Analytics.</li>
</ol>
</ol>
<ol start="15">
<li>Future Additions:</li>
<ol>
<li><b>Add Featured Activities</b>: Activities which are most
worked on: i.e <b>MusicBlocks</b>, <b>TurtleArt</b>, <b>Physics</b>
Activities, <b>Fructose</b> Set of Activities could get a
wide card along with a feature image. This will act as a
showcase to the developer and the activity; mostly based on
GitHub Stargazers. <i>I would like to follow
<a class="moz-txt-link-freetext" href="https://snapcraft.io">https://snapcraft.io</a> as a reference from which Ubuntu
Software is built.</i><br>
</li>
<li><b>Add a link to </b><b>Flatpak</b><b> Package</b>: this
aslov4 could be the <i>final</i> activity store for
sugarlabs. Recently many contributions have diverged. Its
important to unify them together. Some users might prefer
flatpak over a .xo file. Activities that are packaged as
Flatpaks are good because some users, follow a modern desktop
system, or might not be interested to install Sugar OS to run
sugar desktop. For those corner cases, providing Flatpak as an
alternative would not let users turn away from using Sugar
Activities. Primarily Sugar Activities are meant for improving
a child's skills or understanding; which ever mode, an
activity is distributed; i.e., the most accessible package.</li>
<li>Add information to other packages of sugar activity bundle.
This includes Ubuntu Packages. Fedora RPMs, and the Arch Linux
Community Packages; I will need a way to identify each of
them; But at the present, I would like to leave it as is. If
any developers at sugar is interested to change some structure
of Sugar Repository, this would make things faster. <br>
</li>
<li><b>Add a screenshot, description tag in activity.info</b>:
Screenshots of the working activity on the appstore will
probably give a clearer idea on how the activity works. The <a
class="moz-txt-link-freetext"
href="https://help.sugarlabs.org">https://help.sugarlabs.org</a>
is not frequently updated with changes on activity's
repository. If we could add another tag called screenshots
(following the convention given by Martin on <a
class="moz-txt-link-freetext"
href="https://github.com/tchx84/sugarapp">https://github.com/tchx84/sugarapp</a>.
See
<a class="moz-txt-link-freetext"
href="https://github.com/tchx84/sugarapp/blob/master/flatpak-guide.md#porting-an-application-with-sugarapp">https://github.com/tchx84/sugarapp/blob/master/flatpak-guide.md#porting-an-application-with-sugarapp</a>
(point 7) on how an ideal <font face="Courier New, Courier,
monospace">"activity.inf</font>o" could be created. This
would help me out in creating a better appstore (faster). The
new<font face="Courier New, Courier, monospace">
"activity.info" </font>could include '<font face="Courier
New, Courier, monospace">screenshot</font>' and '<font
face="Courier New, Courier, monospace">description</font>'
tag which is not currently used. Martin has also mentioned of
the source of the new data in the link given below.<br>
</li>
<li>Create a<b> Python3 minimal activity </b>which does not
need to load the entire website for downloading an activity.
The activity will just pull index.json, and parse it. As the
extra HTML, CSS, and JS are unnecessary for a GTK3 based
sugar-activity, it would help to save a lot of data,
especially on countries where internet connection is extremely
slow (<i>50kbps</i> ?)<br>
</li>
</ol>
</ol>
<p>I would like to convey my thanks to Manish for providing me
frequent suggestions and always pointing out important flaws (
High CPU usage bug in <i>Chromium/Chrome</i> Browser: <a
moz-do-not-send="true"
href="https://github.com/sugarlabs-appstore/sugarappstore-static/commit/65a7b8f3ea2593976ef21df7a2592b030501c6d8">65a7b8f3ea2593976ef21df7a2592b030501c6d8</a>
, Accessibility ), and also the base repository, i.e., <a
class="moz-txt-link-freetext"
href="https://github.com/free-libre-software/sugarappstore">https://github.com/free-libre-software/sugarappstore</a>
as a template and idea provider for the <i>sugarlabs app store</i>
to take this shape. <br>
</p>
<p>________________________________________________<br>
</p>
<p><b>Logo</b>:</p>
<p>The logo is designed under Creative Commons License Attribution
Share Alike 4.0. You may get the source code of the logo here: <br>
</p>
<p><i><b>source</b></i>: <a class="moz-txt-link-freetext"
href="https://github.com/sugarlabs-appstore/appstore-assets">https://github.com/sugarlabs-appstore/appstore-assets</a></p>
<p>The logo has been designed with modern conventions of app design
- symmetry and vibrance. Maybe its similar to the colorful icon
design proposal for GSoC : <i><a class="moz-txt-link-freetext"
href="https://github.com/sugarlabs/GSoC/blob/master/Ideas-2020.md#colored-desktop-and-activity-icons">https://github.com/sugarlabs/GSoC/blob/master/Ideas-2020.md#colored-desktop-and-activity-icons</a></i><br>
</p>
<p>________________________________________________</p>
<p><b>Generator</b> (tool used to generate static webpages):</p>
<p>The generator is script which automates build process of bundles
and writes static HTML files. Primarily written on Python
Programming Language, can be customized with alternative script
files which are supported on Linux. Generator, aka (internally
called), SaaSBuild (Build tool for Sugarlabs Activity App Store),
is designed to be multi platform supported, although tested on
Linux only. Its possible to run it on other OSes too.</p>
<p><i><b>source</b></i>: <a class="moz-txt-link-freetext"
href="https://github.com/sugarlabs-appstore/sugarappstore">https://github.com/sugarlabs-appstore/sugarappstore</a></p>
<p><b>NOTE</b> [IMPORTANT]: Current development goes on in PR#4 (<i><a
class="moz-txt-link-freetext"
href="https://github.com/sugarlabs-appstore/sugarappstore/pull/4">https://github.com/sugarlabs-appstore/sugarappstore/pull/4</a></i>).
You might need to checkout <b>oop-ss</b> if you want to test out
the latest features. The <b>master</b> branch contains the work
by Manish before the official start of GSoC. <i>The PR is waiting
for a review.</i><br>
</p>
<p>________________________________________________</p>
<ol start="1">
</ol>
<p><b>Static HTML, CSS, JS</b></p>
<p>These are files which can be run without the need of the
generated index.json. Using JQuery, the data is dynamically read,
and updated on the index.html.</p>
<p><i>Q) Why was Static parts of the website not merged with the
generator (SaaSBuild)?</i></p>
<p>Its because of yet another few reasons</p>
<ul>
<li>Another developer could manually add his own themes / html
styleset with, maybe another JS Framework, for example React,
Angular or Vue.js later. He/She would not have to rewrite the
Generator class again for changing the frontend part.</li>
<li>Developers who are willing to contribute to HTML / Web design
/ Js can only work on the "static" repository. This will help to
(probably) increase contributors. A developer who is only good
at JS would not be hence be discouraged to contribute to the
current repository, if Python is also involved.</li>
</ul>
<p><b><i>source</i>: </b><a class="moz-txt-link-freetext"
href="https://github.com/sugarlabs-appstore/sugarappstore-static">https://github.com/sugarlabs-appstore/sugarappstore-static</a></p>
<p>________________________________________________</p>
<p><b>Continuous Integration</b></p>
<p>Continuous Integration Downloads and sets up Sugar desktop, i.e <i>sugar-toolkit-gtk3</i>,
<i>sugar</i>,<i> sugar-datastore</i>, <i>sugar-artwork</i> and
creates bundles and packages it for publish to CDN<br>
</p>
<p><i><b>source</b></i>: <a class="moz-txt-link-freetext"
href="https://github.com/srevinsaju/sugar-activity-build">https://github.com/srevinsaju/sugar-activity-build</a></p>
<p>________________________________________________</p>
<p>The <b>DEPLOYED WEBSITE:</b></p>
<p>The <u>best</u> part, check it out here: <b><a
class="moz-txt-link-freetext"
href="https://sugarstore.netlify.app">https://sugarstore.netlify.app</a></b></p>
<p>For a list of indexed apps in a portable format: <br>
</p>
<ul>
<li><b><a class="moz-txt-link-freetext"
href="https://sugarstore.netlify.app/index.json">https://sugarstore.netlify.app/index.json</a></b></li>
<li><b><a class="moz-txt-link-freetext"
href="https://github.com/srevinsaju/sugar-activity-build/releases/download/latest/index.json">https://github.com/srevinsaju/sugar-activity-build/releases/download/latest/index.json</a></b></li>
<li><b><a class="moz-txt-link-freetext"
href="https://github.com/srevinsaju/sugar-activity-build/releases/download/latest/sitemap.xml">https://github.com/srevinsaju/sugar-activity-build/releases/download/latest/sitemap.xml</a></b></li>
</ul>
<p>For bundles app store (portable - except cdn), see</p>
<p><b><a class="moz-txt-link-freetext"
href="https://github.com/srevinsaju/sugar-activity-build/releases">https://github.com/srevinsaju/sugar-activity-build/releases</a></b></p>
<p>________________________________________________</p>
<p><b><i>Q) How to run the appstore?</i></b></p>
<p>Use any static hosting server; for testing I use:</p>
<ul>
<li><font face="Courier New, Courier, monospace">python3 -m
http.server 3000</font></li>
<font face="Courier New, Courier, monospace"> </font>
<li><font face="Courier New, Courier, monospace">gunicorn</font></li>
<font face="Courier New, Courier, monospace"> </font>
<li><font face="Courier New, Courier, monospace">php</font></li>
<font face="Courier New, Courier, monospace"> </font>
<li><font face="Courier New, Courier, monospace">npm install -g
http-server; http-server</font></li>
<font face="Courier New, Courier, monospace"> </font>
<li><font face="Courier New, Courier, monospace">apache</font></li>
<font face="Courier New, Courier, monospace"> </font>
<li><font face="Courier New, Courier, monospace">ngrok</font></li>
<font face="Courier New, Courier, monospace"> </font>
<li><font face="Courier New, Courier, monospace">serveo</font><br>
</li>
</ul>
<p><b>Regarding whom to approach:</b></p>
<p>We are working on two different things. <a
moz-do-not-send="true" href="mailto:sugar@radii.dev">Manish</a>
knows a way lot more than me regarding HTTP Headers, Sphinx, CORS,
User-Agent, and other web server related stuff.<a
moz-do-not-send="true" href="mailto:srevinsaju@sugarlabs.org"> I
</a>am working on design (css, html, js) and the generator script
(python), and those related to sugar GTK shell, sugar activities.
We both collaborate on working with the generator script.<br>
</p>
<p>=====================================</p>
Hope everyone like this. All questions are welcome. Please note that
the App Store has<i> not yet released v0.1,</i> so its basically in
<i>alpha</i>.
<p>PS: If anyone is interested to contribute, PRs are welcome.
Please reply me on this thread if you require access to <a
class="moz-txt-link-freetext"
href="https://github.com/sugarlabs-appstore/">https://github.com/sugarlabs-appstore/</a>
organization. It was created so that Manish and I could
collaborate. And also so that, development won't freeze in the
absence of one. <br>
</p>
<p>PS: If you have some other <i>sweet</i> suggestions for
Sugarlabs App Store (name), please let me know. Just as <i>jarabe</i>,
<i>carquinyol</i>, and <i>sucrose</i> are used within sugar, it
might be interesting for kids to see their favorite sweet on the
screen. We have stuck with sugarlabs-appstore, as we did not get
any other name!</p>
<p>Thanks if you read all the way till here!!<br>
</p>
<p>Stay safe! Take care!!<font size="+2"><br>
</font></p>
<font size="+2"> </font>
<ol start="1">
</ol>
<font size="+2"> </font>
<pre class="moz-signature" cols="72"><font size="+2"><font size="+1">V/r
</font>Srevin Saju
</font><a class="moz-txt-link-freetext" href="https://github.com/srevinsaju">https://github.com/srevinsaju</a><font size="+2">
</font></pre>
<br>
</body>
</html>