Podcast
Questions and Answers
Which variable represents a normal blue color?
Which variable represents a normal blue color?
Which of the following is defined as the default color?
Which of the following is defined as the default color?
Which file contains global CSS styles not bound to a specific module?
Which file contains global CSS styles not bound to a specific module?
What is the primary purpose of the Person.js
file?
What is the primary purpose of the Person.js
file?
Signup and view all the answers
Which file type is less powerful than SCSS files?
Which file type is less powerful than SCSS files?
Signup and view all the answers
What is the primary purpose of Node.js?
What is the primary purpose of Node.js?
Signup and view all the answers
What is the Node Package Manager (NPM) mainly used for?
What is the Node Package Manager (NPM) mainly used for?
Signup and view all the answers
What is the main benefit of using Node Version Manager (NVM)?
What is the main benefit of using Node Version Manager (NVM)?
Signup and view all the answers
Which command is used to install the required Node.js modules?
Which command is used to install the required Node.js modules?
Signup and view all the answers
Which command is used to install Node.js version 18.18.2 using NVM on Windows?
Which command is used to install Node.js version 18.18.2 using NVM on Windows?
Signup and view all the answers
Which file stores environment variables for the application?
Which file stores environment variables for the application?
Signup and view all the answers
How do you check which version of Node.js is installed?
How do you check which version of Node.js is installed?
Signup and view all the answers
How can you list all installed Node.js versions using NVM on macOS?
How can you list all installed Node.js versions using NVM on macOS?
Signup and view all the answers
What is the purpose of the STORYBLOK_PREVIEW_SECRET
variable?
What is the purpose of the STORYBLOK_PREVIEW_SECRET
variable?
Signup and view all the answers
What is the function of an HTTPS proxy when developing locally with Storyblok CMS?
What is the function of an HTTPS proxy when developing locally with Storyblok CMS?
Signup and view all the answers
In the Storyblok preview URL, what should YOUR_STORYBLOK_PREVIEW_SECRET_GOES_HERE
be replaced with?
In the Storyblok preview URL, what should YOUR_STORYBLOK_PREVIEW_SECRET_GOES_HERE
be replaced with?
Signup and view all the answers
What is the typical protocol and port used for the local development server?
What is the typical protocol and port used for the local development server?
Signup and view all the answers
Which of these statements accurately describes Node.js?
Which of these statements accurately describes Node.js?
Signup and view all the answers
What action is needed to enable the Storyblok visual editor?
What action is needed to enable the Storyblok visual editor?
Signup and view all the answers
After setting up the environment, how do you start the debugging mode in VSCode?
After setting up the environment, how do you start the debugging mode in VSCode?
Signup and view all the answers
What is the final step to test the local development server?
What is the final step to test the local development server?
Signup and view all the answers
What command is used to build the site locally in a way that mirrors Vercel's production build process?
What command is used to build the site locally in a way that mirrors Vercel's production build process?
Signup and view all the answers
Where can environment variables be set for a Vercel project after an initial failed build?
Where can environment variables be set for a Vercel project after an initial failed build?
Signup and view all the answers
How can a new build be triggered from the 'Deployments' page in Vercel?
How can a new build be triggered from the 'Deployments' page in Vercel?
Signup and view all the answers
What action is required to reflect changes made to the site's content online, when the site is statically generated?
What action is required to reflect changes made to the site's content online, when the site is statically generated?
Signup and view all the answers
What is the function of a deploy hook in Vercel?
What is the function of a deploy hook in Vercel?
Signup and view all the answers
What is the role of a webhook in the context of content changes and Vercel?
What is the role of a webhook in the context of content changes and Vercel?
Signup and view all the answers
After successfully deploying your site to Vercel, what is the key change in the URL that can be noticed?
After successfully deploying your site to Vercel, what is the key change in the URL that can be noticed?
Signup and view all the answers
If environment variables are forgotten initially, what must be done to ensure that new values are picked up by Vercel?
If environment variables are forgotten initially, what must be done to ensure that new values are picked up by Vercel?
Signup and view all the answers
Which of the following best describes the primary difference between Google Analytics and HotJar?
Which of the following best describes the primary difference between Google Analytics and HotJar?
Signup and view all the answers
In the described development process, what is the primary function of Vercel?
In the described development process, what is the primary function of Vercel?
Signup and view all the answers
Which tool is primarily used for local code testing and debugging?
Which tool is primarily used for local code testing and debugging?
Signup and view all the answers
What role does GitHub play in the development process described?
What role does GitHub play in the development process described?
Signup and view all the answers
What is the purpose of an 'integration' environment in a real-world development setting?
What is the purpose of an 'integration' environment in a real-world development setting?
Signup and view all the answers
What does an 'acceptance' environment provide for the software development process?
What does an 'acceptance' environment provide for the software development process?
Signup and view all the answers
Which of the following tools is explicitly described as an email communication tool?
Which of the following tools is explicitly described as an email communication tool?
Signup and view all the answers
According to the passage, what causes the deployment process to happen automatically when using Vercel?
According to the passage, what causes the deployment process to happen automatically when using Vercel?
Signup and view all the answers
What is the primary purpose of a Vercel Deploy Hook?
What is the primary purpose of a Vercel Deploy Hook?
Signup and view all the answers
In the context of the described code execution order, what is the role of getStaticPaths
?
In the context of the described code execution order, what is the role of getStaticPaths
?
Signup and view all the answers
Which of the following best describes the purpose of getStaticProps
?
Which of the following best describes the purpose of getStaticProps
?
Signup and view all the answers
What is the correct order of code execution when processing an incoming request, according to the material?
What is the correct order of code execution when processing an incoming request, according to the material?
Signup and view all the answers
What is the role of the _app.js/MyApp
component?
What is the role of the _app.js/MyApp
component?
Signup and view all the answers
Why would a website be statically generated when deploying to Vercel?
Why would a website be statically generated when deploying to Vercel?
Signup and view all the answers
Which of these is NOT one of the primary component systems described in this content?
Which of these is NOT one of the primary component systems described in this content?
Signup and view all the answers
What action initiates the fetching of data for a specific URL in this setup?
What action initiates the fetching of data for a specific URL in this setup?
Signup and view all the answers
Study Notes
Connecting the CMS and the Site
- Introduction
- The data model was introduced and implemented in Storyblok
- The resume website needs to connect to the new data model in the content management system
- Getting the Code
- The easiest way to get the code for the Resume project is to fork it.
- Instructions for forking the repository are available at: https://docs.github.com/en/get-started/quickstart/fork-a-repo
- Steps to get the code:
- Log in to your GitHub account
- Search for JanMoonsUGent/resume
- Open the repository
- Fork the repository
- You will now be in your account/resume
- Git Clone vs. Fork
- Developers who work on a common codebase will clone the repository to synchronize changes
- Forking creates a new codebase. Updates to a fork are not synchronized with the original repo
- Cloning the Project
- Use the GitHub CLI to clone the project from your online GitHub account to your local computer. This is described in part 1, starting from step 7
Software Structure
- After cloning, open the folder in VSCode
- The file structure is a Next.js project
- Important folders/files:
-
components
: Contains JavaScript files for UI components -
node_modules
: Contains external modules used by the site -
public
: Contains publicly accessible assets (e.g., images) -
styles
: Contains CSS stylesheets (using SCSS) -
pages
: Contains Next.js pages. Includes[[...slug]].js
,_app.js
, and_document.js
which are relevant for StoryBlok
-
- Specific files:
-
_app.js
: Initializes pages in NextJS -
[[...slug]].js
: Uses dynamic routes based on Storyblok information. The catch-all route handler runs before any page. -
styles/colors.scss
: Contains CSS color variables
-
- Code examples:
-
pages/_app.js
: maps Storyblok component names to Next.js component names -
pages/[[...slug]].js
: responsible for executing for every URL request to the site and includes three important methods:
- getStaticPaths: gets all possible paths for the server-side rendering of pages
- getStaticProps: retrieves data from the CMS needed for the current page
-
components/genericComponents/Person/Person.js
: Displays person information, including experience. Uses storyblokEditable to support real-time editing in Storyblok. -
components/genericComponents/Experience/Experience.js
: Displays experience information. Uses RichTextToHTML to handle rich text content from Storyblok, making the code snippet dynamically generate HTML.
Environment Variables
-
.env.local
: Contains sensitive information like API keys, preview secret key, and deployment URL -
STORYBLOK_API_KEY
: Allows connection to the Storyblok CMS -
STORYBLOK_PREVIEW_SECRET
: Used for previewing the site within Storyblok -
NEXT_PUBLIC_DEPLOY_URL
: URL to the site after deployment
Deployment to Vercel
- Deploy the project to Vercel using the deployment button
- Set the environment variables in Vercel settings before deploying
- Now the site will be accessible online.
Additional Notes
-
npm run build
: Builds the site for production. - Deployment hooks and webhooks can be used to automatically rebuild the website when changes are made in Storyblok.
- If environment variables aren't correctly configured, the site may not function correctly.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Related Documents
Description
Test your knowledge on Node.js, CSS, and related tools with this quiz. Answer questions related to file types, environment variables, and key functionalities of Node.js and its package manager NPM. Ideal for developers and those learning web technologies.