CodeBlanks Logo Icon CodeBlanks

Project design

Design the skeleton of the expert final mini app.

Project: Expert final

In this 5-lesson project you will build an expert final: an application skeleton that combines native addons, distributed tracing and performance engineering. Each lesson adds one layer, and the final lesson unifies all four layers in a single report.

The first lesson prepares the skeleton: the setupProject function carries name and version. return { name: 'ExpertProject', version: '1.0' } returns these fields. Each lesson's starting code will contain the previous lesson's solution, so the application grows step by step. The final lesson's integrationReport joins all layers. This project gathers concepts from the earlier expert groups (native addons, distributed systems, performance engineering) into one mini application.

Building the skeleton

The skeleton of a Node.js project carries configuration and identity. The setupProject function returns these in an object; later lessons add layers on top of this skeleton.

Example: const project = setupProject() returns {name: 'ExpertProject', version: '1.0'}. project.name gives the name, project.version the version. This model will be the base as you add native addon, distributed tracing and performance layers. Each layer returns a similar object; the final lesson's integrationReport joins them. Building the skeleton solid in the first step guarantees the later layers sit well.

Practice Write the project skeleton

Write function setupProject(). Return { name: 'ExpertProject', version: '1.0' }. Print console.log(setupProject().name) and console.log(setupProject().version).

Starter code

index.js
// Write the setupProject function
// Return an object holding name and version
// Print name and version on separate lines
// write here

Sample solution

index.js
function setupProject() {
  return { name: 'ExpertProject', version: '1.0' };
}
console.log(setupProject().name);
console.log(setupProject().version);

Expected output

ExpertProject
1.0

Questions and answers

Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.

1 What does setupProject() return?

index.js
function setupProject() { return {name: 'ExpertProject', version: '1.0'}; }
  • Only the name
  • Only the version
  • An empty string
  • A name and version object Correct answer

Explanation: setupProject returns an object holding name and version.

2 Complete the name field

Question
return { ____: 'ExpertProject', version: '1.0' };
Answer
return { name: 'ExpertProject', version: '1.0' };

Explanation: The name field carries the project name.

3 Match each piece to its role

Term Meaning
setupProject Returns the skeleton
name Project name
version Version
console.log Prints output

All lessons in Expert