lab-brussels-1 / home

Home repository for Lab Brussels 1.
https://lab-brussels-1.github.io/home
MIT License
4 stars 5 forks source link

Cristobal: Headless CMS, 3 weeks #408

Open alexander-lopez-s opened 2 years ago

alexander-lopez-s commented 2 years ago

headless cms

Learning goals

alexander-lopez-s commented 2 years ago

Week 1

I Need Help With:

What went well?

What went less well?

Sunday Prep Work

danielhalasz commented 2 years ago
  • If i change [0] for [1234], i get the same data, i don't know why we need those numbers.

well that's the way Strapi is written :) you do need to differentiate between the fields, as it is an array..so they can't have the same number

  • Is Strapi nowadays the most used headless CMS by companies?

it is popular, but not sure how you can measure that

  • Is it recommendable to use Strapi for designing API? I mean, the whole content of the website will be created dynamically with JS, is this a good practice? Or can we just use Strapi to manage specific elements of our webpage?

yes, that is why we have this module :) only that content will be dynamic that we want, definitely not the entire app. the content that can change constantly or often, or that needs to be generated interactively based on user input..is what can be dynamically generated into HTML

danielhalasz commented 2 years ago
  • When I close my laptop, my local server stops to work and I must type npm ci in the console to make the server run again. I wonder how can I fix this problem.

well, that is expected. you are emulating, simulating a server on your local machine. if you close it, it stops. but instead of npm ci, you should be able to just run npm run develop

danielhalasz commented 2 years ago

week2?

alexander-lopez-s commented 2 years ago

Week 2

I Need Help With:

What went well?

What went less well?

This was a very busy week for me but was able to at least understand the basics of Strapi and how to retrieve data from the server.

Lessons Learned

Sunday Prep Work

alexander-lopez-s commented 2 years ago

Week 3

What was not clear, where did you get stuck?

  1. Unfortunately, the authentication topic was explained too fast, I tried rewinding the video but I did not understand enough to make my own authentication JS function.
  2. I guess I need to understand better how the token works for authenticated users to able to log in.
  3. I do not know how to finish my chat app, I want to display the messages from the sender in the right side and the receiver in the left side but I cannot figure it out.

What was clear, what did you master?

  1. I was able to understand what an API is and how to manipulate data from the server.
  2. I was able to GET and POST data to/from my endpoint.
  3. I created my very first chat app (completed at least around 40% of the functionalities). a) Was able to fetch data from Strapi to show the chat usernames in my index.html. b) Was able to create a function that allows me to upload messages to Strapi. c) Was able to create a function that allows me to display/print the messages in the DOM. d) Was able to nest a SetInterval() function to refresh/download new messages. e) Worked a bit on CSS styling to avoid a long message chain to overflow.
  4. I tried creating a sign-up form and posting the data in the server.

https://user-images.githubusercontent.com/97364283/191841110-bbe9f8b3-2b2e-4dfe-a082-17ee05492560.mov

Where can you still use some help?

  1. I need a refresher to use DELETE method. I tried but it did not work. I want to make a button that once clicked, it could delete messages from my app. I cannot find any JS function on the internet that could give me an idea.

Where can you help others moving forwards?

  1. I am very confident with fetching data and printing it in the DOM.
  2. I can create new data elements and post them.

The Course

What can there be more of?

  1. Maybe a little bit more of attention/time to complex topics such registering/authenticating new users.
  2. More projects like the chat app.

What can there be less of?

  1. Nothing less, I was wondering if we can start earlier (at least one hour), so that we do not rush and maybe the topics will be clearer.

What material were most helpful (from HYF or elsewhere)?

  1. Everything provided by HYF was of a great help.

What HYF material was least helpful?

  1. Strapi documentation, really flat and not so clear. I prefer Youtube tutorials, once again.

Any suggestions for future classes?

  1. Little retro-quizzes at the beginning of the class to refresh what was studied previous week.
  2. Random questions from the coaches to the students to challenge our knowledge/understanding.

Thanks

  1. Special thanks to @yoshimalaise for his time and his charisma to teach us in this module, @danielhalasz for reviewing, guiding us and giving us feedback, @MMikhailova for being a very intelligent student who always helps us with what she can.

THANK YOU!

danielhalasz commented 2 years ago
  • how can we implement functionalities such us loging in, storing passwords, creating unique usernames, etc? Do we need hel from any other programming language?

we have covered Auth since then, do you still have questions about it? everything is possible with JS ;)

danielhalasz commented 2 years ago
  • Price and Products have a relation, but what tells me that the relation is one-to-many or many-to-one? Why is this useful?

well, you have to think about the relation type, in order to be able to create a useable database that can store and fetch information in a sensible way

danielhalasz commented 2 years ago
  • PostMan helps us retrieve a API and if we give permissions, edit it or delete it.

Postman is good for testing an API, the various request types of GET, POST, etc.

danielhalasz commented 2 years ago

2. guess I need to understand better how the token works for authenticated users to able to log in.

I have explained it in Slack to Maria, have you seen it?

danielhalasz commented 2 years ago

3. I want to display the messages from the sender in the right side and the receiver in the left side but I cannot figure it out.

take a look at CSS flexbox for positioning

danielhalasz commented 2 years ago
  1. I need a refresher to use DELETE method. I tried but it did not work. I want to make a button that once clicked, it could delete messages from my app. I cannot find any JS function on the internet that could give me an idea.

my first assumption is that only authorized users can delete anything from the database.. so probably you have to provide a Bearer JWT token in the header of the request.