CodeYourFuture / syllabus

Old Syllabus Website for CodeYourFuture
https://syllabus.codeyourfuture.io
154 stars 124 forks source link

Create offline version for use in prisons and other offline environments #550

Open monstermaker opened 1 year ago

monstermaker commented 1 year ago

Which module(s) and week(s) does this change affect? Module(s): All Week(s): All

What is the work that needs to be done?

How far the course takes students and how we assess learning will need further discussion.

Why is this work important to do?

This opens the CYF to serving prisoners giving them a start on their tech career and helping to reduce the risk of reoffending.

Additional context

Who might need to know about this change?

illicitonion commented 1 year ago

Thanks for filing this issue, it's a really exciting effort to work on!

A few follow-up questions:

  1. For the serving environment for the course material, what's the ideal deployable? A static zip/tar of HTML and resources? A linux x86-64 executable that can serve HTTP on a port? A PDF? Something else?
  2. What machine spec should we assume the people taking the course will have access to? Linux / Windows / Mac / a mix / ?
  3. How easy is it to vendor CLI or desktop applications onto the machines in use? I'm more thinking for later on in the course, if we wanted to have people use git locally, GitHub Desktop in an offline or local-network mode, VS Code, NodeJS, Postgres, etc...
  4. How easy is it to ship updates to the course materials? And how frequently?

The Intro to Digital content is mostly done already in the prison, so working on aligning this with the CYF version may be required as this is separate from the main syllabus section.

Is there a copy of the material already being delivered? It'd be great to converge them where possible!

Adding to the future topics for discussion, also:

monstermaker commented 1 year ago

Thank you for your feedback and questions.

  1. The deployable could be a Linux executable with HTTP, as I think it would be best if it is better for it to look similar to the current live version. that way those leaving who would continue their learning outside would be already familiar with the environment. I have already cloned the git repository and now have it running locally on a machine. I intend to try this out on the Linux server to get a feel of what works and what doesn't without the internet. I think for future reference the best overall package would be a docker package. that way it would work more predictably than those that may be served on different LAMP stacks.
  2. The current machines in use are Windows 10 machines with a VirtualBox installed and a Ubuntu machine installed on that. this way the students start in Windows, which they are familiar with and then later after learning the HTML/CSS basics, move into a Linux environment. they are steered toward using Google Chrome as the browser, but many also use Firefox. So, delivering the majority over HTTP would make it easy to deploy.
  3. Installing applications on Windows machines is not easy due to the policies set in place and the almost impossible task of having it signed off by cyber-security. This was another reason for the choice of using the Linux VM as we can install any software on that machine. the machines have VS Code, NodeJS, Git, Python and MongoDB installed and the VMs also have a LAMP stack, PHPMyAdmin and ruby on Rails.
  4. Update shipping can be an easy task as we provide updates to the VM about 4 times a year. If the main parts of the course were run on the Linux server then they can be done as regularly as required as it is a central source. The VM updates are usually done using a batch file to update each machine from the central server. This requires thawing the Deepfreeze machine (clients), deployment and then re-freezing. This is usually at least an overnight job.

The current material is mostly on a Moodle setup with some bookwork to supplement. It relies on a mixture of Moodle-based activities and assessments and videos. The details of these can be discussed in a more detailed discussion session.

Locally we server GitLab for our Git repositories, so that users can use Git. We also have a webserver setup which can have reseller-style packages set up on it so the students can use DNS, Mail and FTP etc. We also have StackOverflow running on a Kiwix server. We also serve W3Schools and FreeCodeCamp across the network, both of which are offline versions.

It is totally viable for future discussions to be over video or phone, though in-person is more difficult without you coming here (which can be arranged).

ChrisOwen101 commented 1 year ago

@illicitonion @monstermaker

Not sure if this is useful but Docusaurus (the tool that this website is built with) has PWA/Offline Caching built in

https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-pwa#offline-mode-precaching

monstermaker commented 1 year ago

@illicitonion @monstermaker

Not sure if this is useful but Docusaurus (the tool that this website is built with) has PWA/Offline Caching built in

https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-pwa#offline-mode-precaching

Yes, as this is precaching rather than just caching, this can prove useful.

We will still need to make sure we have the other external resources/facilities and these will need to be referenced/linked in the main offline web app.

SallyMcGrath commented 1 year ago

Logging Jamboard here https://jamboard.google.com/d/1eKsf-6BQrzR68fzoXVgCrLV5kfuQdBY-hTN85JPr9ZI/edit?usp=sharing

gregdyke commented 1 year ago

Neil and I met on 2/2/2023 and here is what we did/concluded:

It would be good to know who has ownership of various action points from the above Jamboard so we can chase them up

Neil was wondering how the PD syllabus happens in practice (I gave my best understanding which is that ideally it would be well integrated with the tech syllabus so that it's clear to trainees that PD skills are highly valued and relevant. In practice, they are given a little bit independently, but giving them on the same day is helping draw bridges and connections. In the future, we hope to make the links stronger and more obvious to trainees ? and improve agile skills/understanding?)

Neil has considered the problem of local deployment/replacing our use of heroku/netlify. Currently they do it with ftp/filezilla to a server (and because some of their trainees are learning over multiple years, they have opportunity to learn a lot more about ops type stuff than our trainees). IMO that is a fine way of doing the deployment. It miiiight be nice to have some kind of autodeploy from gitlab for final projects, but the only real requirement from my perspective is the opportunity to see how a dev and prod environment might glue together differently

We did a bit of work on making CYF Blocks available offline. It looks like it needs a server of some kind to serve the .md files. For now we created https://github.com/CodeYourFuture/fundamentals-blockly/tree/blockly-offline which pulls in blockly and zero-md from node_modules instead of cdn/unpkg. Neil will try checking it out and deploying on their apache server.

Maybe some kind of build script into a dist folder would be a better thing than reading directly from node_module?

SallyMcGrath commented 1 year ago

Updates from me:

monstermaker commented 1 year ago

Update on CYF Blocks offline:

Installed Greg's update on the Apache server but did not work. It was still trying to get various resources from the web.

I had to get zero-md onto a local machine and then recreate the node_modules folder with missing modules. this was uploaded to the server giving 13 errors of missing resources. It appears that the zero-md module was missing some of the requested files, which they load from a cdn and this is built into the code. I edited this module to use local resources and downloaded the markdown and prismjs modules. This then gave 49 errors for missing resources. I had to edit the prismjs and markdown modules to also use only local resources and download some extra JS files as the references only used the minimised versions which I could not find complete. This reduced to 1 error for the github-markdown css file. when running another 73 errors appeared which were for some blockly resources for sound files and sprites. I sourced and downloaded these files and edited the blockly module to use these local resources, creating a new 'media' folder in the CYFblocks root folder. This now appears to work offline.

Further to this, we could now attach this to a PWS module and it should be able to run on a local machine without internet ref: https://github.com/CodeYourFuture/fundamentals-blockly/issues/56

gregdyke commented 1 year ago

Oh god, what a yak-shaving expedition. I'm glad you resolved it in the end!

SallyMcGrath commented 1 year ago

https://github.com/CodeYourFuture/CYF-Sandbox/tree/ITD for Codepen replacement