Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDC Decomposition Sprint 1 #1295

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

illicitonion
Copy link
Member

What does this change?

Adds the first Decomposition sprint.

It's a slightly unusual sprint. It has a lot of prep content, and the only backlog is basically: "Follow the prep, and actually do all the things".

I'm a bit concerned at how much it's mixing "background reading" vs "active reading to do stuff", but also hoping this leads to the reading actually seeming relevant and clicking...

Common Content?

Adds a bunch of blocks

Removes/renames a handful of blocks no one has ever used and which never had any content.

Org Content?

Sets up some SDC sprints.

Copy link

netlify bot commented Jan 10, 2025

Deploy Preview for cyf-tracks ready!

Name Link
🔨 Latest commit d53add3
🔍 Latest deploy log https://app.netlify.com/sites/cyf-tracks/deploys/678e63e5e0581f0007c5be23
😎 Deploy Preview https://deploy-preview-1295--cyf-tracks.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 10, 2025

Deploy Preview for cyf-common ready!

Name Link
🔨 Latest commit d53add3
🔍 Latest deploy log https://app.netlify.com/sites/cyf-common/deploys/678e63e5573acf000803072a
😎 Deploy Preview https://deploy-preview-1295--cyf-common.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 10, 2025

Deploy Preview for cyf-sdc ready!

Name Link
🔨 Latest commit d53add3
🔍 Latest deploy log https://app.netlify.com/sites/cyf-sdc/deploys/678e63e5d84f0e0008beadf1
😎 Deploy Preview https://deploy-preview-1295--cyf-sdc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 10, 2025

Deploy Preview for cyf-piscine ready!

Name Link
🔨 Latest commit d53add3
🔍 Latest deploy log https://app.netlify.com/sites/cyf-piscine/deploys/678e63e56e1fde00089c5b1f
😎 Deploy Preview https://deploy-preview-1295--cyf-piscine.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 99 (🟢 up 14 from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 10, 2025

Deploy Preview for cyf-curriculum canceled.

Name Link
🔨 Latest commit d53add3
🔍 Latest deploy log https://app.netlify.com/sites/cyf-curriculum/deploys/678e63e5ca4f2400084fd9db

Copy link

netlify bot commented Jan 10, 2025

Deploy Preview for cyf-programming ready!

Name Link
🔨 Latest commit d53add3
🔍 Latest deploy log https://app.netlify.com/sites/cyf-programming/deploys/678e63e5b3bb60000727ef09
😎 Deploy Preview https://deploy-preview-1295--cyf-programming.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 85 (🔴 down 13 from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 90 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 10, 2025

Deploy Preview for cyf-itd ready!

Name Link
🔨 Latest commit d53add3
🔍 Latest deploy log https://app.netlify.com/sites/cyf-itd/deploys/678e63e55e7bcc00084a68bf
😎 Deploy Preview https://deploy-preview-1295--cyf-itd.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 78 (🔴 down 21 from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 10, 2025

Deploy Preview for cyf-launch ready!

Name Link
🔨 Latest commit d53add3
🔍 Latest deploy log https://app.netlify.com/sites/cyf-launch/deploys/678e63e5b8c81e0007d6961b
😎 Deploy Preview https://deploy-preview-1295--cyf-launch.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@illicitonion illicitonion force-pushed the sdc-decomposition-sprint1 branch from 4fbbd8f to d53add3 Compare January 20, 2025 14:55
Copy link
Member

@SallyMcGrath SallyMcGrath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taking a break - will be back


Note: Your backend expects the quotes to be submitted as JSON. This means you will need to use a `fetch` request from JavaScript to do the POSTing.

You can't just use a `<form method="POST">` tag because that would post the information in a different format. (It would also redirect the user to a page which just says "ok" after submitting the quote, which isn't a great user experience!)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think they know what POST is really. Do we want to bring anything in from servers module or no?


If a user tried to add a quote and the `fetch` failed (perhaps because the backend wasn't running), or the response said there was an error, we should give the user some feedback so they know something went wrong (and maybe what they should do about it).

Now that our backend allows users to post quotes, we may want to restrict what can be posted.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Now that our backend allows users to post quotes, we may want to restrict what can be posted.
Now that our backend allows users to post quotes, we want to restrict what they can post.


Now that our backend allows users to post quotes, we may want to restrict what can be posted.

For instance, we probably don't want to let people post quotes which are empty.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For instance, we probably don't want to let people post quotes which are empty.
For instance, we don't want to let people post quotes which are empty.

You can stop hedging. We never want to publish raw user inputs. We can just say this.


For instance, we probably don't want to let people post quotes which are empty.

We may want to do some validation of the input our users give us.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
We may want to do some validation of the input our users give us.
We definitely need to validate the inputs our users give us.


A major limitation of backends is that "a long time" probably isn't forever.

Sometimes we change the code of the backend. Or need restart the computer it's running on for an upgrade. Or its computer loses power and we need to start it again.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Sometimes we change the code of the backend. Or need restart the computer it's running on for an upgrade. Or its computer loses power and we need to start it again.
Sometimes we change the code of the backend. Or we need to restart the computer it's running on for an upgrade. Or its computer loses power and we need to start it again.

Suggest bringing in something from cyf+ eg computers actually exist in the world.


Because web frontends run in the user's web browser, they have easy access to lots of information about the user's computer. For instance, they know what language it's configured in, what time zone it's configured in, how big the browser window is, etc.

If our frontend code were instead running in a backend, the browser may need to include all of this information in every request it makes, just in case the backend needs to know it. This has a couple of drawbacks: It makes the requests bigger (which makes them slower, and maybe cost more), and it ends up sharing lots of data with the server that it may not need, which may compromise the user's privacy.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another concrete analogy please. Tie it down to the world. What is this like, that they already know and understand?


This means that a backend cannot try to open a connection to a user's web browser. The web browser needs to initiate the request, and then the backend can reply to the request.

Once a web browser opens a request to a backend, there are some ways to keep a bi-directional communication channel open. But the very first request needs to come from the web browser.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Once a web browser opens a request to a backend, there are some ways to keep a bi-directional communication channel open. But the very first request needs to come from the web browser.
Once a web browser opens a request to a backend, there are some ways to keep a two-way communication channel open. But the very first request needs to come from the web browser.

]
+++

Our example backend is **stateless**. If you make several requests to it, it will always do the same thing (even though doesn't always return exactly the same result!).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tooltip on stateless

```js
import express from "express";

const app = express();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that we haven't taught them express, do you think we should? I don't have. strong view on this just making sure you've thought about it.


And they need to know how to talk to each other. In your frontend you probably hard-coded your `fetch` to fetch from `http://127.0.0.1:3000`.

First let's deploy our backend somewhere. Then when we know its address, we can update our frontend to talk to our deployed backend, and then deploy it too.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I want some pictures. Or some diagrams?

Copy link
Member

@SallyMcGrath SallyMcGrath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually want to do a fair bit of rewriting on this if pos. But I don't want to overwrite your work so let me know when you're ready to merge and I'll go through your version again on a new pr and let you take a look.

},
];

function randomQuote() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW you can define runkits with express using runkit codefence


{{<note type="Exercise">}}
We also need to store our frontend and backend somewhere to deploy them from:
1. Make a new Git repository on GitHub.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Make a new Git repository on GitHub.
1. Make a new Git repository on your GitHub.


Do projects 36-40. You can do these on any Unix-based computer.
{{</note>}}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feedback="No - that's the authority/hostname. | No - check the parts of a URL again. | Yes - anything at the start of a URL before the : is the scheme. | No - check the parts of a URL again."
correct="2" >}}

{{<multiple-choice
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want a labelling task here so I made you this #1316

{{<multiple-choice
question="A website hosting a book, so that you can read the book through a web browser."
answers="Just a frontend. | A frontend and a backend. | A frontend and a backend and a database."
feedback="Right - if we're just serving some static content, and it never changes, we only need a frontend. | Probably not - if we're just hosting the book, we probably don't need a backend. But there are many requirements which may necessitate one (e.g. password-protecting our book). | Probably not - if we're just hosting the book, we probably don't need a backend. But there are many requirements which may necessitate one (e.g. password-protecting our book, counting how many times it's been read, allowing comments, etc)."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think here 1, please Hemingway these answers 🙏 - is the word necessitate ever really necessary? 😉

I think we will, nowadays, have to be more rigorous and clearer here. With so many Jamstack systems, JWT auth, serverless, they will have used many things like auth and comments without an apparent back end or db.

]
+++

You've made static websites, both as part of the "world-wide web" reading, and in previous courses/modules.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You've made static websites, both as part of the "world-wide web" reading, and in previous courses/modules.
You have built static websites. These were HTML pages, which perhaps included some JavaScript. The JavaScript made them interactive. But in this definition they were still static.


You've made static websites, both as part of the "world-wide web" reading, and in previous courses/modules.

These were HTML pages, which perhaps included some JavaScript. The JavaScript made them interactive. But they were still static.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
These were HTML pages, which perhaps included some JavaScript. The JavaScript made them interactive. But they were still static.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tooltip on static


From that point on, your web browser works on its own. Any event handlers, timers, etc are processed by the web browser.

And the job of the server was just to hand over files. Those files will probably be the same, no matter what user asked for them, or what computer they were using.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
And the job of the server was just to hand over files. Those files will probably be the same, no matter what user asked for them, or what computer they were using.
The job of the server was just to hand over files. Those files are the same, no matter what user asked for them, or what computer they were using.


We often call these static files a **frontend**.

And we can build impressive, useful websites with just a frontend. We can include images, videos, and sounds. We can react to user input. We can change what we show on the page. We can even use things like [the Web Storage API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API) to store data so that if you leave the page and come back, your data is still there.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
And we can build impressive, useful websites with just a frontend. We can include images, videos, and sounds. We can react to user input. We can change what we show on the page. We can even use things like [the Web Storage API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API) to store data so that if you leave the page and come back, your data is still there.
We can build impressive, useful websites with just a frontend. We can include images, videos, and sounds. We can react to user input. We can change what we show on the page. We can even use things like [the Web Storage API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API) to store data so that if you leave the page and come back, your data is still there.

You can also say that the curriculum website is a static site. I would usually say that Smashing Magazine is, but I don't think you're using exactly the same definition here.

{{<multiple-choice
question="If I'm using a website, and want to send a link to the page I'm viewing to a friend, does the website need a backend?"
answers="Yes - to be able to share the information between computers, it needs a backend. | No - a link will always work and show the same content. | It depends - on some websites links can work without a backend, but others need a backend."
feedback="Not always - if the website is just static, a link should work fine. | Sometimes! But only if the content it always the same for all users and a user can't change it. | Yes! Some websites are always the same for everyone, and links just work. Other websites, where users can change things (e.g. our to do list example), need some way of storing what things have changed, and this is normally a backend.<br /><br />Hint: If 'it depends' is a possible answer, it's _almost_ always the correct one!"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be easier to have these as blocks instead of lines, like #1316 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🔖 Ready
Development

Successfully merging this pull request may close these issues.

2 participants