Skip to content

Conversation

@magdazelena
Copy link
Contributor

@magdazelena magdazelena commented Sep 4, 2025

Closes #122

  • Simple webserver code examples
  • Simple webserver readme
  • Sqlite connection via express app
  • Sample GET on the database
  • Sample POST with data modification on the database
  • Postman collection
  • Session Plan update
  • CRUD examples -> partially, notes below

Notes

  1. I'm unsure about how CRUD fits here other than using it with REST methods. I'm a bit unsure what CRUD vs REST means in the context of this lesson @adamblanchard @marcorichetta
  2. In the same it would be super useful to apply CRUD methods to explain POST/PUT/DELETE - there is already a bit of that in the POST method example
  3. I'm a little worried that since the CRUD methods are not part of database module, fitting them here would make the class impossible to run. There is already so much to explain in setting up the first ever express server, first ever Postman setup etc etc.
  4. The excercises part seems to be missing files, is that in scope of this issue? JavaScript files, should I add those?

Edit

Ok, CRUD on the db is part of database module. So the learning goals here relate to the usage of CRUD via endpoints? Or there is a need for more elaboration on db methods here? (I don't think that's a good idea) :))

@adamblanchard
Copy link
Contributor

I'll try answer your questions first:

  1. I'm unsure about how CRUD fits here other than using it with REST methods. I'm a bit unsure what CRUD vs REST means in the context of this lesson @adamblanchard @marcorichetta

In general, this is a leftover learning goal from the old legacy node.js module (which we split up). I can't find any actual material on it. It might no longer make sense in the context of this module, but we should probs talk about it somewhere.

  1. In the same it would be super useful to apply CRUD methods to explain POST/PUT/DELETE - there is already a bit of that in the POST method example

(See my suggestion in question 3, i agree).

  1. I'm a little worried that since the CRUD methods are not part of database module, fitting them here would make the class impossible to run. There is already so much to explain in setting up the first ever express server, first ever Postman setup etc etc.

Agree... here's what I'm thinking: Move basic CRUD concepts into the Intro to Databases learning goals as part of "Perform basic SQL operations: SELECT, INSERT, UPDATE, DELETE". I think at this point, it could be really high level and just used to "put a name" to the operations that are being made.

In this module, we could simply reference crud like "Remember the four CRUD operations we can do on our data? When we make a GET request, we only want to READ data e.g. with SELECT....... With this POST example, we want to CREATE a new thing..."

Then we are only reminding/reinforcing the terms here, and it's not actually about teaching it.

  1. The excercises part seems to be missing files, is that in scope of this issue? JavaScript files, should I add those?

I put these into the "hyf-assignment-template" which is where trainees will complete all the assignments. Technically we havne't used this before also for exercises, but it seemed like the right place, since trainees will already be working in this repo and will have to finish them for the assignment anyway. See HERE. Does this seem reasonable? Right now I mention it at the top of exercise1.md, but maybe it's not clear enough 😅

--

Regarding the databases overlap, let's wait for @marcorichetta's input too!

Copy link
Contributor

@adamblanchard adamblanchard left a comment

Choose a reason for hiding this comment

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

Questions aside, I approve! You do such a good job of balancing new topics and the level of detail to go into to keep trainees learning but hopefully not get overwhelmed 🤩

Assuming that...

  1. We can align on the CRUD learning goal
  2. You're happy with the exercise code (now you know it lives in hyf-assignment-repo)
    ... i'd say this is in a really great place to merge 🙇 Thank you so much for all the work in getting it into it's final form 🙌

@@ -0,0 +1,114 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

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

🤩

);
```

**Callback function** in the Express endpoint has a predefined structure as well. For starters, it has certain **arguments**:
Copy link
Contributor

Choose a reason for hiding this comment

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

Really love this simple and clear explanation that fits with the stage that the trainees are at here

};
```

**Note:** What sorcery is this?! We didn't cover `Promise` nor `async` yet! Do not worry, you will in later modules. For now, it is just important to understand that **this syntax enables us to wait for the outcome to arrive**. In other words, a `Promise` is just that - I promise I will deliver the output (`resolve`) or I shall collapse trying (`reject`)! Use this [two helper functions](./session-materials/examples/data.js) to follow along.
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

@magdazelena
Copy link
Contributor Author

I put these into the "hyf-assignment-template" which is where trainees will complete all the assignments. Technically we havne't used this before also for exercises, but it seemed like the right place, since trainees will already be working in this repo and will have to finish them for the assignment anyway. See HERE. Does this seem reasonable? Right now I mention it at the top of exercise1.md, but maybe it's not clear enough 😅

It does make sense, I will link it in the excercise.md as well.

One thing though -> excercise2 uses knex. Should be use knex as part of this session? On one hand it could remove custom Promise that is out of scope. On the other it is another lib and at this point I assume we would suggest just using it raw method?

@marcorichetta
Copy link
Contributor

My 2 cents here:

Don't forget the order of the modules: DB week 1 => Node.js week 1

It would be great if they could integrate the Node.js app with the DB they create in the previous lesson.
On the other hand, if we remove the DB interaction part, we'll have more time to go deeper into backend concepts.
The downside is that they won't see a fully integrated application.


I'm a little worried that since the CRUD methods are not part of database module

CRUD methods are part of the DB module.
I refer to CRUD as the operations for Create/Read/Update/Delete data. In the database module, this is taught using SQL commands.


One thing though—exercise 2 uses Knex. Should we use Knex as part of this session? On one hand, it could remove the custom Promise implementation, which is out of scope. On the other hand, it's another library, and at this point, I assume we would suggest using its raw method?

+1 to using Knex and the raw method.
It's used in other modules, and later it allows us to switch to ORM mode and easily change to other DB for deployment. Plus, it's a more realistic example of what they might encounter.

@adamblanchard
Copy link
Contributor

Related discussion about also talking about CRUD conceptually in the web architecture 101 module (before databases and intro to backend) https://github.com/HackYourFuture-CPH/programme/pull/160/files#diff-58df775bd5048edefa9b1268584287954e122e73d6ceb60f9d701e96100e28cfR161

@adamblanchard
Copy link
Contributor

@marcorichetta Just to make sure we're talking about the same thing, this PR is regarding the foundation course. So we will teach "Databases" (the foundation module) and then this one "Intro to backend" (also foundation module).

I mention it because you talked about the ordering and pointed to Node.js module (which appears in the Backend course, not this one). You created a PR to set up the node module in the backend course (#146) but that is still open and valid and won't be superseded by this one. As i understand :)

@magdazelena
Copy link
Contributor Author

My 2 cents here:

Don't forget the order of the modules: DB week 1 => Node.js week 1

It would be great if they could integrate the Node.js app with the DB they create in the previous lesson. On the other hand, if we remove the DB interaction part, we'll have more time to go deeper into backend concepts. The downside is that they won't see a fully integrated application.

@marcorichetta, I also understand the thing as @adamblanchard. This is foundation intro to backend, so then it comes after foundation databases module. Also please take note that the session plan is indeed integrating with DB made in the previous class. The endpoints are going to be using the sqlite db. Is there something else you meant?

I'm a little worried that since the CRUD methods are not part of database module

CRUD methods are part of the DB module. I refer to CRUD as the operations for Create/Read/Update/Delete data. In the database module, this is taught using SQL commands.

I guess at the moment I was preparing this PR that was not yet reflected in the foundation database session plan except from learning goals. I would like to see how is that lead in the db session to best refer to it in this session.

One thing though—exercise 2 uses Knex. Should we use Knex as part of this session? On one hand, it could remove the custom Promise implementation, which is out of scope. On the other hand, it's another library, and at this point, I assume we would suggest using its raw method?

+1 to using Knex and the raw method. It's used in other modules, and later it allows us to switch to ORM mode and easily change to other DB for deployment. Plus, it's a more realistic example of what they might encounter.

Yes, I think I will change it to that. The Promises are also not part of the scope for foundation, so it does make sense to jot them in and create confusion.

@magdazelena magdazelena mentioned this pull request Sep 8, 2025
17 tasks
Copy link
Contributor

@adamblanchard adamblanchard left a comment

Choose a reason for hiding this comment

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

Amazing! I'm approving and merging this now. Mega thanks @magdazelena (and @marcorichetta for the feedback).

@adamblanchard adamblanchard merged commit a84c52c into main Sep 10, 2025
2 checks passed
@rvedotrc rvedotrc deleted the 122-chore/session-plan-intro-to-backend branch October 15, 2025 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Move and tweak demos/session plan (Intro to Backend)

4 participants